"use strict";(self.webpackChunkgrafana=self.webpackChunkgrafana||[]).push([[6976],{16250:(e,a,t)=>{t.d(a,{n:()=>p});var s,o=t(77813),n=(t(76687),t(68786)),i=t(27668),l=t(23277),r=t(50385),c=t(46286),d=t(52010);function p(e){var a;let{options:t,onOptionsChange:o}=e;const p=(0,i.yK)(h);return(0,d.jsxs)("div",{className:p.container,children:[s||(s=(0,d.jsx)("h3",{className:"page-heading",children:"Node Graph"})),(0,d.jsx)(l.Z,{className:p.row,children:(0,d.jsx)(r._,{tooltip:"Enables the Node Graph visualization in the trace viewer.",label:"Enable Node Graph",labelWidth:26,children:(0,d.jsx)(c.x,{id:"enableNodeGraph",value:null===(a=t.jsonData.nodeGraph)||void 0===a?void 0:a.enabled,onChange:e=>(0,n.tp)({onOptionsChange:o,options:t},"nodeGraph",Object.assign({},t.jsonData.nodeGraph,{enabled:e.currentTarget.checked}))})})})]})}const h=e=>({container:o.css`
    label: container;
    width: 100%;
  `,row:o.css`
    label: row;
    align-items: baseline;
  `})},63595:(e,a,t)=>{t.d(a,{Z:()=>h});var s,o,n,i=t(77813),l=(t(76687),t(27668)),r=t(57868),c=t(97770),d=t(39756),p=t(52010);const h=e=>{let{values:a,onChange:t,id:i,keyPlaceholder:h="Key",valuePlaceholder:u="Value (optional)"}=e;const j=(0,l.yK)(g);return(0,p.jsx)("div",{className:j.wrapper,children:a.length?a.map(((e,n)=>(0,p.jsxs)("div",{className:j.pair,children:[(0,p.jsx)(r.X,{id:`${i}-key-${n}`,placeholder:h,value:e.key,onChange:e=>{t(a.map(((a,t)=>(t===n&&(a.key=String(e)),a))))}}),(0,p.jsx)(c.W,{"aria-label":"equals",className:j.operator,width:3,children:"="}),(0,p.jsx)(r.X,{id:`${i}-value-${n}`,placeholder:u,value:e.value,onChange:e=>{t(a.map(((a,t)=>(t===n&&(a.value=String(e)),a))))}}),(0,p.jsx)("button",{onClick:()=>t([...a.slice(0,n),...a.slice(n+1)]),className:"gf-form-label query-part","aria-label":"Remove tag",type:"button",children:s||(s=(0,p.jsx)(d.J,{name:"times"}))}),n===a.length-1?(0,p.jsx)("button",{onClick:()=>t([...a,{key:"",value:""}]),className:"gf-form-label query-part","aria-label":"Add tag",type:"button",children:o||(o=(0,p.jsx)(d.J,{name:"plus"}))}):null]},n))):(0,p.jsx)("button",{onClick:()=>t([...a,{key:"",value:""}]),className:"gf-form-label query-part","aria-label":"Add tag",type:"button",children:n||(n=(0,p.jsx)(d.J,{name:"plus"}))})})},g=e=>({wrapper:i.css`
    display: flex;
    flex-direction: column;
    gap: ${e.spacing.xs} 0;
  `,pair:i.css`
    display: flex;
    justify-content: start;
    align-items: center;
  `,operator:i.css`
    color: ${e.palette.orange};
  `})},4017:(e,a,t)=>{t.d(a,{Z:()=>j});var s,o=t(77813),n=(t(76687),t(68786)),i=t(10661),l=t(27668),r=t(23277),c=t(50385),d=t(68803),p=t(46286),h=t(9120),g=t(63595),u=t(52010);function j(e){var a,t,j,T,b,m,x,y,D,f,C,w,k,O;let{options:L,onOptionsChange:q}=e;const N=(0,l.yK)(v);return(0,u.jsxs)("div",{className:(0,o.css)({width:"100%"}),children:[s||(s=(0,u.jsx)("h3",{className:"page-heading",children:"Trace to logs"})),(0,u.jsx)("div",{className:N.infoText,children:"Trace to logs lets you navigate from a trace span to the selected data source's logs."}),(0,u.jsx)(r.Z,{children:(0,u.jsx)(c._,{tooltip:"The data source the trace is going to navigate to",label:"Data source",labelWidth:26,children:(0,u.jsx)(i.q,{inputId:"trace-to-logs-data-source-picker",filter:e=>"loki"===e.type||"grafana-splunk-datasource"===e.type,current:null===(a=L.jsonData.tracesToLogs)||void 0===a?void 0:a.datasourceUid,noDefault:!0,width:40,onChange:e=>{var a;return(0,n.tp)({onOptionsChange:q,options:L},"tracesToLogs",Object.assign({},L.jsonData.tracesToLogs,{datasourceUid:e.uid,tags:null===(a=L.jsonData.tracesToLogs)||void 0===a?void 0:a.tags}))}})})}),null!==(t=L.jsonData.tracesToLogs)&&void 0!==t&&t.mapTagNamesEnabled?(0,u.jsx)(r.Z,{children:(0,u.jsx)(c._,{tooltip:"Tags that will be used in the Loki query. Default tags: 'cluster', 'hostname', 'namespace', 'pod'",label:"Tags",labelWidth:26,children:(0,u.jsx)(g.Z,{keyPlaceholder:"Tag",values:null!==(j=null!==(T=null===(b=L.jsonData.tracesToLogs)||void 0===b?void 0:b.mappedTags)&&void 0!==T?T:null===(m=L.jsonData.tracesToLogs)||void 0===m||null===(x=m.tags)||void 0===x?void 0:x.map((e=>({key:e}))))&&void 0!==j?j:[],onChange:e=>(0,n.tp)({onOptionsChange:q,options:L},"tracesToLogs",Object.assign({},L.jsonData.tracesToLogs,{mappedTags:e}))})})}):(0,u.jsx)(r.Z,{children:(0,u.jsx)(c._,{tooltip:"Tags that will be used in the Loki query. Default tags: 'cluster', 'hostname', 'namespace', 'pod'",label:"Tags",labelWidth:26,children:(0,u.jsx)(d.B,{tags:null===(y=L.jsonData.tracesToLogs)||void 0===y?void 0:y.tags,width:40,onChange:e=>(0,n.tp)({onOptionsChange:q,options:L},"tracesToLogs",Object.assign({},L.jsonData.tracesToLogs,{tags:e}))})})}),(0,u.jsx)(r.Z,{children:(0,u.jsx)(c._,{label:"Map tag names",labelWidth:26,grow:!0,tooltip:"Map trace tag names to log label names. Ex: k8s.pod.name -> pod",children:(0,u.jsx)(p.x,{id:"mapTagNames",value:null!==(D=null===(f=L.jsonData.tracesToLogs)||void 0===f?void 0:f.mapTagNamesEnabled)&&void 0!==D&&D,onChange:e=>(0,n.tp)({onOptionsChange:q,options:L},"tracesToLogs",Object.assign({},L.jsonData.tracesToLogs,{mapTagNamesEnabled:e.currentTarget.checked}))})})}),(0,u.jsx)(r.Z,{children:(0,u.jsx)(c._,{label:"Span start time shift",labelWidth:26,grow:!0,tooltip:"Shifts the start time of the span. Default 0 (Time units can be used here, for example: 5s, 1m, 3h)",children:(0,u.jsx)(h.I,{type:"text",placeholder:"1h",width:40,onChange:e=>(0,n.tp)({onOptionsChange:q,options:L},"tracesToLogs",Object.assign({},L.jsonData.tracesToLogs,{spanStartTimeShift:e.currentTarget.value})),value:(null===(C=L.jsonData.tracesToLogs)||void 0===C?void 0:C.spanStartTimeShift)||""})})}),(0,u.jsx)(r.Z,{children:(0,u.jsx)(c._,{label:"Span end time shift",labelWidth:26,grow:!0,tooltip:"Shifts the end time of the span. Default 0 Time units can be used here, for example: 5s, 1m, 3h",children:(0,u.jsx)(h.I,{type:"text",placeholder:"1h",width:40,onChange:e=>(0,n.tp)({onOptionsChange:q,options:L},"tracesToLogs",Object.assign({},L.jsonData.tracesToLogs,{spanEndTimeShift:e.currentTarget.value})),value:(null===(w=L.jsonData.tracesToLogs)||void 0===w?void 0:w.spanEndTimeShift)||""})})}),(0,u.jsx)(r.Z,{children:(0,u.jsx)(c._,{label:"Filter by Trace ID",labelWidth:26,grow:!0,tooltip:"Filters logs by Trace ID. Appends '|=<trace id>' to the query.",children:(0,u.jsx)(p.x,{id:"filterByTraceID",value:null===(k=L.jsonData.tracesToLogs)||void 0===k?void 0:k.filterByTraceID,onChange:e=>(0,n.tp)({onOptionsChange:q,options:L},"tracesToLogs",Object.assign({},L.jsonData.tracesToLogs,{filterByTraceID:e.currentTarget.checked}))})})}),(0,u.jsx)(r.Z,{children:(0,u.jsx)(c._,{label:"Filter by Span ID",labelWidth:26,grow:!0,tooltip:"Filters logs by Span ID. Appends '|=<span id>' to the query.",children:(0,u.jsx)(p.x,{id:"filterBySpanID",value:null===(O=L.jsonData.tracesToLogs)||void 0===O?void 0:O.filterBySpanID,onChange:e=>(0,n.tp)({onOptionsChange:q,options:L},"tracesToLogs",Object.assign({},L.jsonData.tracesToLogs,{filterBySpanID:e.currentTarget.checked}))})})})]})}const v=e=>({infoText:o.css`
    padding-bottom: ${e.spacing.md};
    color: ${e.colors.textSemiWeak};
  `})},80829:(e,a,t)=>{t.d(a,{F:()=>u});var s,o=t(77813),n=(t(76687),t(68786)),i=t(10661),l=t(27668),r=t(23277),c=t(50385),d=t(55312),p=t(9120),h=t(63595),g=t(52010);function u(e){var a,t,u,v,T,b;let{options:m,onOptionsChange:x}=e;const y=(0,l.yK)(j);return(0,g.jsxs)("div",{className:(0,o.css)({width:"100%"}),children:[s||(s=(0,g.jsx)("h3",{className:"page-heading",children:"Trace to metrics"})),(0,g.jsx)("div",{className:y.infoText,children:"Trace to metrics lets you navigate from a trace span to the selected data source."}),(0,g.jsxs)(r.Z,{className:y.row,children:[(0,g.jsx)(c._,{tooltip:"The data source the trace is going to navigate to",label:"Data source",labelWidth:26,children:(0,g.jsx)(i.q,{inputId:"trace-to-metrics-data-source-picker",pluginId:"prometheus",current:null===(a=m.jsonData.tracesToMetrics)||void 0===a?void 0:a.datasourceUid,noDefault:!0,width:40,onChange:e=>(0,n.tp)({onOptionsChange:x,options:m},"tracesToMetrics",Object.assign({},m.jsonData.tracesToMetrics,{datasourceUid:e.uid}))})}),null!==(t=m.jsonData.tracesToMetrics)&&void 0!==t&&t.datasourceUid?(0,g.jsx)(d.zx,{type:"button",variant:"secondary",size:"sm",fill:"text",onClick:()=>{(0,n.tp)({onOptionsChange:x,options:m},"tracesToMetrics",Object.assign({},m.jsonData.tracesToMetrics,{datasourceUid:void 0}))},children:"Clear"}):null]}),(0,g.jsx)(r.Z,{children:(0,g.jsx)(c._,{tooltip:"Tags that will be used in the metrics query.",label:"Tags",labelWidth:26,children:(0,g.jsx)(h.Z,{keyPlaceholder:"Tag",values:null!==(u=null===(v=m.jsonData.tracesToMetrics)||void 0===v?void 0:v.tags)&&void 0!==u?u:[],onChange:e=>(0,n.tp)({onOptionsChange:x,options:m},"tracesToMetrics",Object.assign({},m.jsonData.tracesToMetrics,{tags:e}))})})}),null===(T=m.jsonData.tracesToMetrics)||void 0===T||null===(b=T.queries)||void 0===b?void 0:b.map(((e,a)=>(0,g.jsxs)("div",{className:y.queryRow,children:[(0,g.jsx)(c._,{label:"Link Label",labelWidth:10,children:(0,g.jsx)(p.I,{label:"Link Label",type:"text",allowFullScreen:!0,value:e.name,onChange:e=>{var t,s;let o=null!==(t=null===(s=m.jsonData.tracesToMetrics)||void 0===s?void 0:s.queries.slice())&&void 0!==t?t:[];o[a].name=e.currentTarget.value,(0,n.tp)({onOptionsChange:x,options:m},"tracesToMetrics",Object.assign({},m.jsonData.tracesToMetrics,{queries:o}))}})}),(0,g.jsx)(c._,{label:"Query",labelWidth:10,tooltip:"The Prometheus query that will run when navigating from a trace to metrics. Interpolate tags using the `$__tags` keyword.",grow:!0,children:(0,g.jsx)(p.I,{label:"Query",type:"text",allowFullScreen:!0,value:e.query,onChange:e=>{var t,s;let o=null!==(t=null===(s=m.jsonData.tracesToMetrics)||void 0===s?void 0:s.queries.slice())&&void 0!==t?t:[];o[a].query=e.currentTarget.value,(0,n.tp)({onOptionsChange:x,options:m},"tracesToMetrics",Object.assign({},m.jsonData.tracesToMetrics,{queries:o}))}})}),(0,g.jsx)(d.zx,{variant:"destructive",title:"Remove query",icon:"times",type:"button",onClick:()=>{var e;let t=null===(e=m.jsonData.tracesToMetrics)||void 0===e?void 0:e.queries.slice();null==t||t.splice(a,1),(0,n.tp)({onOptionsChange:x,options:m},"tracesToMetrics",Object.assign({},m.jsonData.tracesToMetrics,{queries:t}))}})]},a))),(0,g.jsx)(d.zx,{variant:"secondary",title:"Add query",icon:"plus",type:"button",onClick:()=>{var e,a;(0,n.tp)({onOptionsChange:x,options:m},"tracesToMetrics",Object.assign({},m.jsonData.tracesToMetrics,{queries:[...null!==(e=null===(a=m.jsonData.tracesToMetrics)||void 0===a?void 0:a.queries)&&void 0!==e?e:[],{query:""}]}))},children:"Add query"})]})}const j=e=>({infoText:o.css`
    padding-bottom: ${e.spacing.md};
    color: ${e.colors.textSemiWeak};
  `,row:o.css`
    label: row;
    align-items: baseline;
  `,queryRow:o.css`
    display: flex;
  `})}}]);
//# sourceMappingURL=6976.65bcbacdd33f981e0f7f.js.map