Skip to content

Commit

Permalink
Docs: Add derived field datasourceUid information (grafana#26285)
Browse files Browse the repository at this point in the history
* Add datasourceUid info

* Revert "Add datasourceUid info"

This reverts commit 84dce1d.

* Add datasourceUid info

* Update docs/sources/features/datasources/loki.md

Co-authored-by: Diana Payton <52059945+oddlittlebird@users.noreply.github.com>

* Update derived fields info

Co-authored-by: Diana Payton <52059945+oddlittlebird@users.noreply.github.com>
  • Loading branch information
ivanahuckova and oddlittlebird committed Jul 15, 2020
1 parent dd3fcab commit 5b2ff44
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions docs/sources/features/datasources/loki.md
Expand Up @@ -47,9 +47,10 @@ You can use this functionality to link to your tracing backend directly from you
{{< docs-imagebox img="/img/docs/v65/loki_derived_fields.png" class="docs-image--no-shadow" caption="Screenshot of the derived fields configuration" >}}
Each derived field consists of:

- **Name:** Shown in the log details as a label.
- **Regex:** A Regex pattern that runs on the log message and captures part of it as the value of the new field. Can only contain a single capture group.
- **URL**: A URL template used to construct a link next to the field value in log details. Use special `${__value.raw}` value in your template to interpolate the real field value into your URL template.
- **Name -** Shown in the log details as a label.
- **Regex -** A Regex pattern that runs on the log message and captures part of it as the value of the new field. Can only contain a single capture group.
- **URL/query -** If the link is external, then enter the full link URL. If the link is internal link, then this input serves as query for the target data source. In both cases, you can interpolate the value from the field with `${__value.raw }` macro.
- **Internal link -** Select if the link is internal or external. In case of internal link, a data source selector allows you to select the target data source. Only tracing data sources are supported.

You can use a debug section to see what your fields extract and how the URL is interpolated. Click **Show example log message** to show the text area where you can enter a log message.
{{< docs-imagebox img="/img/docs/v65/loki_derived_fields_debug.png" class="docs-image--no-shadow" caption="Screenshot of the derived fields debugging" >}}
Expand Down Expand Up @@ -193,6 +194,7 @@ datasources:
derivedFields:
# Field with internal link pointing to data source in Grafana.
# Right now, Grafana supports only Jaeger and Zipkin data sources as link targets.
# datasourceUid value can be anything, but it should be unique across all defined data source uids.
- datasourceUid: my_jaeger_uid
matcherRegex: "traceID=(\\w+)"
name: TraceID
Expand Down

0 comments on commit 5b2ff44

Please sign in to comment.