Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support Loki derived fields in jsonData #375

Closed
techgnosis opened this issue Feb 4, 2022 · 0 comments · Fixed by #397
Closed

Support Loki derived fields in jsonData #375

techgnosis opened this issue Feb 4, 2022 · 0 comments · Fixed by #397
Assignees

Comments

@techgnosis
Copy link

The provider already provides lots of options for creating data sources but there is some key functionality missing for Loki. Loki lets you create "derived fields" and then link from those fields to a URL. This is usually used to find a trace ID in a log line and then link to Tempo or Jaeger.

https://grafana.com/docs/grafana/latest/datasources/loki/#derived-fields

Here are some examples from a provisioning file

jsonData:
        maxLines: 1000
        derivedFields:
        - datasourceUid: jaeger-ds
          matcherRegex: .*(?:jaeger_trace_id=|jaeger_trace_id\":\s*\")(.*?)(?:\"|\s).*
          name: "JaegerTraceId"
          url: "$${__value.raw}"
        - datasourceUid: zipkin-ds
          matcherRegex: .*(?:zipkin_trace_id=|zipkin_trace_id\":\s*\")(.*?)(?:\"|\s).*
          name: "ZipkinTraceId"
          url: "$${__value.raw}"
        - datasourceUid: tempo
          matcherRegex: .*(?:tempo_trace_id=|tempo_trace_id\":\s*\")(.*?)(?:\"|\s).*
          name: "TempoTraceId"
          url: "$${__value.raw}"
        - datasourceUid: tempo
          matcherRegex: (?:traceID|trace_id)=(\w+)
          name: "TraceID"
          url: $${__value.raw}
@julienduchesne julienduchesne self-assigned this Feb 16, 2022
julienduchesne added a commit that referenced this issue Feb 21, 2022
julienduchesne added a commit that referenced this issue Feb 21, 2022
julienduchesne added a commit that referenced this issue Feb 21, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants