mirror of
https://github.com/grafana/grafana.git
synced 2024-11-30 04:34:23 -06:00
Jaeger and Zipkin: Config & docs upgrade (#64250)
* Jaeger and Zipkin upgrades docs and condig * Update text * Update docs/sources/datasources/jaeger/_index.md Co-authored-by: Kim Nylander <104772500+knylander-grafana@users.noreply.github.com> * Update docs/sources/datasources/jaeger/_index.md Co-authored-by: Kim Nylander <104772500+knylander-grafana@users.noreply.github.com> * Update docs/sources/datasources/jaeger/_index.md Co-authored-by: Kim Nylander <104772500+knylander-grafana@users.noreply.github.com> * Update docs/sources/datasources/jaeger/_index.md Co-authored-by: Kim Nylander <104772500+knylander-grafana@users.noreply.github.com> * Update docs/sources/datasources/jaeger/_index.md Co-authored-by: Kim Nylander <104772500+knylander-grafana@users.noreply.github.com> * Update docs/sources/datasources/jaeger/_index.md Co-authored-by: Kim Nylander <104772500+knylander-grafana@users.noreply.github.com> * Update docs/sources/datasources/jaeger/_index.md Co-authored-by: Kim Nylander <104772500+knylander-grafana@users.noreply.github.com> * Update docs/sources/datasources/jaeger/_index.md Co-authored-by: Kim Nylander <104772500+knylander-grafana@users.noreply.github.com> * Update docs/sources/datasources/jaeger/_index.md Co-authored-by: Kim Nylander <104772500+knylander-grafana@users.noreply.github.com> * Update docs/sources/datasources/tempo/_index.md Co-authored-by: Kim Nylander <104772500+knylander-grafana@users.noreply.github.com> * Update docs/sources/datasources/tempo/query-editor/index.md Co-authored-by: Kim Nylander <104772500+knylander-grafana@users.noreply.github.com> * Update docs/sources/datasources/tempo/query-editor/index.md Co-authored-by: Kim Nylander <104772500+knylander-grafana@users.noreply.github.com> * Update docs/sources/datasources/zipkin/_index.md Co-authored-by: Kim Nylander <104772500+knylander-grafana@users.noreply.github.com> * Update docs/sources/datasources/zipkin/_index.md Co-authored-by: Kim Nylander <104772500+knylander-grafana@users.noreply.github.com> * Update docs/sources/datasources/zipkin/_index.md Co-authored-by: Kim Nylander <104772500+knylander-grafana@users.noreply.github.com> * Minor text formatting updates * yarn prettier:write * Update docs/sources/datasources/zipkin/_index.md Co-authored-by: Kim Nylander <104772500+knylander-grafana@users.noreply.github.com> --------- Co-authored-by: Kim Nylander <104772500+knylander-grafana@users.noreply.github.com>
This commit is contained in:
parent
07305c72bf
commit
596e5b43d9
@ -22,6 +22,8 @@ For instructions on how to add a data source to Grafana, refer to the [administr
|
||||
Only users with the organization administrator role can add data sources.
|
||||
Administrators can also [configure the data source via YAML]({{< relref "#provision-the-data-source" >}}) with Grafana's provisioning system.
|
||||
|
||||
Once you've added the data source, you can [configure it]({{< relref "#configure-the-data-source" >}}) so your Grafana instance's users can create queries in the [query editor]({{< relref "#query-the-data-source" >}}) when the users [build dashboards]({{< relref "../../dashboards/build-dashboards/" >}}) and use [Explore]({{< relref "../../explore/" >}}).
|
||||
|
||||
You can also [upload a JSON trace file]({{< relref "#upload-a-json-trace-file" >}}), and [link a trace ID from logs]({{< relref "#link-a-trace-id-from-logs" >}}) in Loki.
|
||||
|
||||
## Configure the data source
|
||||
@ -43,47 +45,78 @@ Set the data source's basic configuration options carefully:
|
||||
| **User** | Defines the user name for basic authentication. |
|
||||
| **Password** | Defines the password for basic authentication. |
|
||||
|
||||
You can also configure settings specific to the Jaeger data source:
|
||||
You can also configure settings specific to the Jaeger data source. These options are described in the sections below.
|
||||
|
||||
### Configure trace to logs
|
||||
### Trace to logs
|
||||
|
||||
{{< figure src="/static/img/docs/explore/traces-to-logs-settings-8-2.png" class="docs-image--no-shadow" caption="Screenshot of the trace to logs settings" >}}
|
||||
![Trace to logs settings](/media/docs/tempo/tempo-trace-to-logs-9-4.png)
|
||||
|
||||
> **Note:** Available in Grafana v7.4 and higher.
|
||||
> If you use Grafana Cloud, open a [support ticket in the Cloud Portal](/profile/org#support) to access this feature.
|
||||
|
||||
The **Trace to logs** setting configures the [trace to logs feature]({{< relref "../../explore/trace-integration" >}}) that is available when you integrate Grafana with Jaeger.
|
||||
|
||||
**To configure trace to logs:**
|
||||
There are two ways to configure the trace to logs feature:
|
||||
|
||||
- Use a simplified configuration with default query, or
|
||||
- Configure a custom query where you can use a [template language]({{< relref "../../dashboards/variables/variable-syntax">}}) to interpolate variables from the trace or span.
|
||||
|
||||
#### Use a simple configuration
|
||||
|
||||
1. Select the target data source.
|
||||
2. Select which tags to use in the logs query. The tags you configure must be present in the spans attributes or resources for a trace to logs span link to appear.
|
||||
- **Single tag**
|
||||
- Configuring `job` as a tag and clicking on a span link will take you to your configured logs datasource with the query `{job='value from clicked span'}`.
|
||||
- **Multiple tags**
|
||||
- If multiple tags are used they will be concatenated so the logs query would look like `{job='value from clicked span', service='value from clicked span'}`.
|
||||
- **Mapped tags**
|
||||
- For a mapped tag `service.name` with value `service`, clicking on a span link will take you to your configured logs datasource with the query `{service='value from clicked span'}` instead of `{service.name='value from clicked span'}`.
|
||||
- This is useful for instances where your tracing datasource tags and your logs datasource tags don't match one-to-one.
|
||||
1. Set start and end time shift. Since the logs timestamps may not exactly match the timestamps of the spans in trace, it may be necessary to search in larger or shifted time range to find the desired logs.
|
||||
1. Select which tags to use in the logs query. The tags you configure must be present in the spans attributes or resources for a trace to logs span link to appear. You can optionally configure a new name for the tag. This is useful if the tag has dots in the name and the target data source does not allow dots in labels. In that case, you can, for example, remap `http.status` to `http_status`.
|
||||
1. Optionally, switch on the **Filter by trace ID** and/or **Filter by span ID** setting to further filter the logs if your logs consistently contain trace or span IDs.
|
||||
|
||||
#### Configure a custom query
|
||||
|
||||
1. Select the target data source.
|
||||
1. Set start and end time shift. Since the logs timestamps may not exactly match the timestamps of the spans in the trace, you may need to widen or shift the time range to find the desired logs.
|
||||
1. Optionally, select tags to map. These tags can be used in the custom query with `${__tags}` variable. This variable will interpolate the mapped tags as a list in an appropriate syntax for the data source and will only include the tags that were present in the span omitting those that weren't present. You can optionally configure a new name for the tag. This is useful in cases where the tag has dots in the name and the target data source does not allow dots in labels. For example, you can remap `http.status` to `http_status`. If you don't map any tags here, you can still use any tag in the query like this `method="${__span.tags.method}"`.
|
||||
1. Skip **Filter by trace ID** and **Filter by span ID** settings as these cannot be used with a custom query.
|
||||
1. Switch on **Use custom query**.
|
||||
1. Specify a custom query to be used to query the logs. You can use various variables to make that query relevant for current span. The link is present only if all the variables are interpolated with non-empty values to prevent creating an invalid query.
|
||||
|
||||
#### Variables that can be used in a custom query
|
||||
|
||||
To use a variable you need to wrap it in `${}`. For example: `${__span.name}`.
|
||||
|
||||
| Variable name | Description |
|
||||
| ---------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
||||
| **\_\_tags** | This variable uses the tag mapping from the UI to create a label matcher string in the specific data source syntax. The variable only uses tags that are present in the span. The link is still created even if only one of those tags is present in the span. You can use this if all tags are not required for the query to be useful. |
|
||||
| **\_\_span.spanId** | The ID of the span. |
|
||||
| **\_\_span.traceId** | The ID of the trace. |
|
||||
| **\_\_span.duration** | The duration of the span. |
|
||||
| **\_\_span.name** | Name of the span. |
|
||||
| **\_\_span.tags** | Namespace for the tags in the span. To access a specific tag named `version`, you would use `${__span.tags.version}`. In case the tag contains dot, you have to access it as `${__span.tags["http.status"]}`. |
|
||||
| **\_\_trace.traceId** | The ID of the trace. |
|
||||
| **\_\_trace.duration** | The duration of the trace. |
|
||||
| **\_\_trace.name** | The name of the trace. |
|
||||
|
||||
The following table describes the ways in which you can configure your trace to logs settings:
|
||||
|
||||
| Name | Description |
|
||||
| ------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
||||
| **Data source** | Sets the target data source. |
|
||||
| **Tags** | Defines the tags to use in the logs query. Default is `'cluster', 'hostname', 'namespace', 'pod'`. |
|
||||
| **Map tag names** | Enables configuring how Jaeger tag names map to logs label names. For example, map `service.name` to `service`. |
|
||||
| **Span start time shift** | Shifts the start time for the logs query based on the span start time. To extend to the past, use a negative value. Use time interval units like `5s`, `1m`, `3h`. Default is `0`. |
|
||||
| **Span end time shift** | Shifts the end time for the logs query based on the span end time. Use time interval units. Default is `0`. |
|
||||
| **Filter by Trace ID** | Toggles whether to append the trace ID to the logs query. |
|
||||
| **Filter by Span ID** | Toggles whether to append the span ID to the logs query. |
|
||||
| Setting name | Description |
|
||||
| ------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
||||
| **Data source** | Defines the target data source. You can select only Loki or Splunk \[logs\] data sources. |
|
||||
| **Span start time shift** | Shifts the start time for the logs query, based on the span's start time. You can use time units, such as `5s`, `1m`, `3h`. To extend the time to the past, use a negative value. Default: `0`. |
|
||||
| **Span end time shift** | Shifts the end time for the logs query, based on the span's end time. You can use time units. Default: `0`. |
|
||||
| **Tags** | Defines the the tags to use in the logs query. Default is `cluster`, `hostname`, `namespace`, `pod`. You can change the tag name for example to remove dots from the name if they are not allowed in the target data source. For example map `http.status` to `http_status`. |
|
||||
| **Filter by trace ID** | Toggles whether to append the trace ID to the logs query. |
|
||||
| **Filter by span ID** | Toggles whether to append the span ID to the logs query. |
|
||||
| **Use custom query** | Toggles use of custom query with interpolation. |
|
||||
| **Query** | Input to write custom query. Use variable interpolation to customize it with variables from span. |
|
||||
|
||||
### Configure trace to metrics
|
||||
### Trace to metrics
|
||||
|
||||
> **Note:** This feature is behind the `traceToMetrics` [feature toggle]({{< relref "../../setup-grafana/configure-grafana#feature_toggles" >}}).
|
||||
> If you use Grafana Cloud, open a [support ticket in the Cloud Portal](/profile/org#support) to access this feature.
|
||||
|
||||
The **Trace to metrics** section configures the [trace to metrics feature](/blog/2022/08/18/new-in-grafana-9.1-trace-to-metrics-allows-users-to-navigate-from-a-trace-span-to-a-selected-data-source/).
|
||||
The **Trace to metrics** section configures the [trace to metrics feature](/blog/2022/08/18/new-in-grafana-9.1-trace-to-metrics-allows-users-to-navigate-from-a-trace-span-to-a-selected-data-source/) available when integrating Grafana with Jaeger.
|
||||
|
||||
Use the settings to select the target Prometheus data source, and create any desired linked queries.
|
||||
To configure trace to metrics:
|
||||
|
||||
1. Select the target data source.
|
||||
1. Create any desired linked queries.
|
||||
|
||||
| Setting name | Description |
|
||||
| --------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
||||
@ -97,13 +130,13 @@ Each linked query consists of:
|
||||
Interpolate tags using the `$__tags` keyword.
|
||||
For example, when you configure the query `requests_total{$__tags}`with the tags `k8s.pod=pod` and `cluster`, the result looks like `requests_total{pod="nginx-554b9", cluster="us-east-1"}`.
|
||||
|
||||
### Enable Node Graph
|
||||
### Node Graph
|
||||
|
||||
The **Node Graph** setting enables the [Node Graph visualization]({{< relref "../../panels-visualizations/visualizations/node-graph/" >}}), which is disabled by default.
|
||||
|
||||
Once enabled, Grafana displays the Node Graph after loading the trace view.
|
||||
Once enabled, Grafana displays the Node Graph above the trace view.
|
||||
|
||||
### Configure the span bar label
|
||||
### Span bar label
|
||||
|
||||
The **Span bar label** section helps you display additional information in the span bar row.
|
||||
|
||||
@ -159,22 +192,12 @@ datasources:
|
||||
basicAuthPassword: my_password
|
||||
```
|
||||
|
||||
## Query traces
|
||||
## Query the data source
|
||||
|
||||
You can query and display traces from Jaeger via [Explore]({{< relref "../../explore" >}}).
|
||||
|
||||
{{< figure src="/static/img/docs/explore/jaeger-search-form.png" class="docs-image--no-shadow" caption="Screenshot of the Jaeger query editor" >}}
|
||||
|
||||
You can query by trace ID, or use the search form to find traces.
|
||||
|
||||
### Query by trace ID
|
||||
|
||||
{{< figure src="/static/img/docs/explore/jaeger-trace-id.png" class="docs-image--no-shadow" caption="Screenshot of the Jaeger query editor with trace ID selected" >}}
|
||||
|
||||
**To query by trace ID:**
|
||||
|
||||
1. Select **TraceID** from the **Query** type selector.
|
||||
1. Insert the ID into the text input.
|
||||
This topic explains configuration and queries specific to the Jaeger data source.
|
||||
For general documentation on querying data sources in Grafana, see [Query and transform data]({{< relref "../../panels-visualizations/query-transform-data" >}}).
|
||||
|
||||
### Query by search
|
||||
|
||||
@ -188,10 +211,21 @@ You can query by trace ID, or use the search form to find traces.
|
||||
| **Service** | Returns a list of services. |
|
||||
| **Operation** | Populated when you select a service with related operations. Select `All` to query all operations. |
|
||||
| **Tags** | Sets tags with values in the [logfmt](https://brandur.org/logfmt) format, such as `error=true db.statement="select * from User"`. |
|
||||
| **Min Duration** | Filters all traces with a duration higher than the set value. Valid values are `1.2s, 100ms, 500us`. |
|
||||
| **Max Duration** | Filters all traces with a duration lower than the set value. Valid values are `1.2s, 100ms, 500us`. |
|
||||
| **Min Duration** | Filters all traces with a duration higher than the set value. Possible values are `1.2s, 100ms, 500us`. |
|
||||
| **Max Duration** | Filters all traces with a duration lower than the set value. Possible values are `1.2s, 100ms, 500us`. |
|
||||
| **Limit** | Limits the number of traces returned. |
|
||||
|
||||
{{< figure src="/static/img/docs/explore/jaeger-search-form.png" class="docs-image--no-shadow" caption="Screenshot of the Jaeger query editor" >}}
|
||||
|
||||
### Query by trace ID
|
||||
|
||||
To query a particular trace:
|
||||
|
||||
1. Select the **TraceID** query type.
|
||||
1. Enter the trace's ID into the **Trace ID** field.
|
||||
|
||||
{{< figure src="/static/img/docs/explore/jaeger-trace-id.png" class="docs-image--no-shadow" caption="Screenshot of the Jaeger query editor with TraceID selected" >}}
|
||||
|
||||
## Upload a JSON trace file
|
||||
|
||||
You can upload a JSON file that contains a single trace and visualize it.
|
||||
|
@ -15,7 +15,7 @@ weight: 1400
|
||||
|
||||
# Tempo data source
|
||||
|
||||
Grafana ships with built-in support for Tempo, a high-volume, minimal-dependency trace storage, open-source tracing solution from Grafana Labs.
|
||||
Grafana ships with built-in support for [Tempo](https://grafana.com/docs/tempo/latest/), a high-volume, minimal-dependency trace storage, open-source tracing solution from Grafana Labs. This topic explains configuration and queries specific to the Tempo data source.
|
||||
|
||||
For instructions on how to add a data source to Grafana, refer to the [administration documentation]({{< relref "../../administration/data-source-management/" >}}).
|
||||
Only users with the organization administrator role can add data sources.
|
||||
@ -112,7 +112,7 @@ The following table describes the ways in which you can configure your trace to
|
||||
|
||||
The **Trace to metrics** setting configures the [trace to metrics feature](/blog/2022/08/18/new-in-grafana-9.1-trace-to-metrics-allows-users-to-navigate-from-a-trace-span-to-a-selected-data-source/) available when integrating Grafana with Tempo.
|
||||
|
||||
**To configure trace to metrics:**
|
||||
To configure trace to metrics:
|
||||
|
||||
1. Select the target data source.
|
||||
1. Create any desired linked queries.
|
||||
@ -141,7 +141,7 @@ To use the Service Graph, refer to the [Service Graph documentation]({{< relref
|
||||
|
||||
The **Node Graph** setting enables the [node graph visualization]({{< relref "../../panels-visualizations/visualizations/node-graph/" >}}), which is disabled by default.
|
||||
|
||||
Once enabled, Grafana displays the node graph after loading the trace view.
|
||||
Once enabled, Grafana displays the node graph above the trace view.
|
||||
|
||||
### Tempo search
|
||||
|
||||
|
@ -19,13 +19,26 @@ The Tempo data source's query editor helps you query and display traces from Tem
|
||||
This topic explains configuration and queries specific to the Tempo data source.
|
||||
For general documentation on querying data sources in Grafana, see [Query and transform data]({{< relref "../../../panels-visualizations/query-transform-data" >}}).
|
||||
|
||||
## Query Tempo search
|
||||
## Query by search
|
||||
|
||||
Tempo search is an experimental feature behind a feature toggle.
|
||||
Use this to search for traces by service name, span name, duration range, or process-level attributes that are included in your application's instrumentation, such as HTTP status code and customer ID.
|
||||
|
||||
To configure Tempo and the Tempo data source for search, refer to [Configure the data source]({{< relref "../#configure-the-data-source" >}}).
|
||||
|
||||
To search for traces:
|
||||
|
||||
1. Select **Search** from the **Query** type selector.
|
||||
1. Fill out the search form:
|
||||
|
||||
| Name | Description |
|
||||
| ---------------- | --------------------------------------------------------------------------------------------------------------------------------- |
|
||||
| **Service Name** | Returns a list of services. |
|
||||
| **Span Name** | Returns a list of span names. |
|
||||
| **Tags** | Sets tags with values in the [logfmt](https://brandur.org/logfmt) format, such as `error=true db.statement="select * from User"`. |
|
||||
| **Min Duration** | Filters all traces with a duration higher than the set value. Possible values are `1.2s`, `100ms`, `500us`. |
|
||||
| **Max Duration** | Filters all traces with a duration lower than the set value. Possible values are `1.2s`, `100ms`, `500us`. |
|
||||
| **Limit** | Limits the number of traces returned. |
|
||||
|
||||
{{< figure src="/static/img/docs/explore/tempo-search.png" class="docs-image--no-shadow" max-width="750px" caption="Screenshot of the Tempo search feature with a trace rendered in the right panel" >}}
|
||||
|
||||
### Search recent traces
|
||||
@ -41,18 +54,18 @@ Tempo includes the ability to search the entire backend datastore.
|
||||
|
||||
To configure your Tempo data source to use this feature, refer to the [Tempo documentation](/docs/tempo/latest/getting-started/tempo-in-grafana/#search-of-the-backend-datastore).
|
||||
|
||||
## Query Loki for traces
|
||||
## Query by trace ID
|
||||
|
||||
To find traces to visualize, you can use the [Loki query editor]({{< relref "../../loki#loki-query-editor" >}}).
|
||||
For results, you must configure [derived fields]({{< relref "../../loki#configure-derived-fields" >}}) in the Loki data source that point to this data source.
|
||||
|
||||
{{< figure src="/static/img/docs/tempo/query-editor-search.png" class="docs-image--no-shadow" max-width="750px" caption="Screenshot of the Tempo query editor showing the search tab" >}}
|
||||
|
||||
## Trace ID search
|
||||
|
||||
**To query a particular trace:**
|
||||
To query a particular trace:
|
||||
|
||||
1. Select the **TraceID** query type.
|
||||
1. Enter the trace's ID into the **Trace ID** field.
|
||||
|
||||
{{< figure src="/static/img/docs/tempo/query-editor-traceid.png" class="docs-image--no-shadow" max-width="750px" caption="Screenshot of the Tempo TraceID query type" >}}
|
||||
|
||||
## Query Loki for traces
|
||||
|
||||
To find traces to visualize, you can use the [Loki query editor]({{< relref "../../loki#loki-query-editor" >}}).
|
||||
For results, you must configure [derived fields]({{< relref "../../loki#configure-derived-fields" >}}) in the Loki data source that point to this data source.
|
||||
|
||||
{{< figure src="/static/img/docs/tempo/query-editor-search.png" class="docs-image--no-shadow" max-width="750px" caption="Screenshot of the Tempo query editor showing the Loki Search tab" >}}
|
||||
|
@ -15,13 +15,13 @@ weight: 1600
|
||||
|
||||
# Zipkin data source
|
||||
|
||||
Grafana ships with built-in support for Zipkin, an open source, distributed tracing system.
|
||||
Grafana ships with built-in support for Zipkin, an open source, distributed tracing system. This topic explains configuration and queries specific to the Zipkin data source.
|
||||
|
||||
For instructions on how to add a data source to Grafana, refer to the [administration documentation]({{< relref "../../administration/data-source-management/" >}}).
|
||||
Only users with the organization administrator role can add data sources.
|
||||
Administrators can also [configure the data source via YAML]({{< relref "#provision-the-data-source" >}}) with Grafana's provisioning system.
|
||||
|
||||
Once you've added the Zipkin data source, you can [configure it]({{< relref "#configure-the-data-source" >}}) so that your Grafana instance's users can create queries in its [query editor]({{< relref "#query-traces" >}}) when they [build dashboards]({{< relref "../../dashboards/build-dashboards/" >}}) and use [Explore]({{< relref "../../explore/" >}}).
|
||||
Once you've added the Zipkin data source, you can [configure it]({{< relref "#configure-the-data-source" >}}) so that your Grafana instance's users can create queries in its [query editor]({{< relref "#query-the-data-source" >}}) when they [build dashboards]({{< relref "../../dashboards/build-dashboards/" >}}) and use [Explore]({{< relref "../../explore/" >}}).
|
||||
|
||||
## Configure the data source
|
||||
|
||||
@ -42,46 +42,76 @@ Set the data source's basic configuration options carefully:
|
||||
| **User** | Defines the user name for basic authentication. |
|
||||
| **Password** | Defines the password for basic authentication. |
|
||||
|
||||
### Configure trace to logs
|
||||
### Trace to logs
|
||||
|
||||
{{< figure src="/static/img/docs/explore/traces-to-logs-settings-8-2.png" class="docs-image--no-shadow" caption="Screenshot of the trace to logs settings" >}}
|
||||
![Trace to logs settings](/media/docs/tempo/tempo-trace-to-logs-9-4.png)
|
||||
|
||||
> **Note:** Available in Grafana v7.4 and higher.
|
||||
> If you use Grafana Cloud, open a [support ticket in the Cloud Portal](/profile/org#support) to access this feature.
|
||||
|
||||
The **Trace to logs** setting configures the [trace to logs feature]({{< relref "../../explore/trace-integration" >}}) that is available when you integrate Grafana with Zipkin.
|
||||
|
||||
**To configure trace to logs:**
|
||||
There are two ways to configure the trace to logs feature:
|
||||
|
||||
- Use a simplified configuration with default query, or
|
||||
- Configure a custom query where you can use a [template language]({{< relref "../../dashboards/variables/variable-syntax">}}) to interpolate variables from the trace or span.
|
||||
|
||||
#### Use a simple configuration
|
||||
|
||||
1. Select the target data source.
|
||||
1. Select which tags to use in the logs query. The tags you configure must be present in the spans attributes or resources for a trace to logs span link to appear.
|
||||
1. Set start and end time shift. As the logs timestamps may not exactly match the timestamps of the spans in trace it may be necessary to search in larger or shifted time range to find the desired logs.
|
||||
1. Select which tags to use in the logs query. The tags you configure must be present in the spans attributes or resources for a trace to logs span link to appear. You can optionally configure a new name for the tag. This is useful if the tag has dots in the name and the target data source does not allow using dots in labels. In that case, you can for example remap `http.status` to `http_status`.
|
||||
1. Optionally, switch on the **Filter by trace ID** and/or **Filter by span ID** setting to further filter the logs if your logs consistently contain trace or span IDs.
|
||||
|
||||
- **Single tag**
|
||||
- Configuring `job` as a tag and clicking on a span link will take you to your configured logs datasource with the query `{job='value from clicked span'}`.
|
||||
- **Multiple tags**
|
||||
- If multiple tags are used they will be concatenated so the logs query would look like `{job='value from clicked span', service='value from clicked span'}`.
|
||||
- **Mapped tags**
|
||||
- For a mapped tag `service.name` with value `service`, clicking on a span link will take you to your configured logs datasource with the query `{service='value from clicked span'}` instead of `{service.name='value from clicked span'}`.
|
||||
- This is useful for instances where your tracing datasource tags and your logs datasource tags don't match one-to-one.
|
||||
#### Configure a custom query
|
||||
|
||||
1. Select the target data source.
|
||||
1. Set start and end time shift. Since the logs timestamps may not exactly match the timestamps of the spans in the trace, you may need to widen or shift the time range to find the desired logs.
|
||||
1. Optionally, select tags to map. These tags can be used in the custom query with `${__tags}` variable. This variable will interpolate the mapped tags as list in an appropriate syntax for the data source and will only include the tags that were present in the span omitting those that weren't present. You can optionally configure a new name for the tag. This is useful when the tag has dots in the name and the target data source does not allow using dots in labels. For example, you can remap `http.status` to `http_status`. If you don't map any tags here, you can still use any tag in the query like this `method="${__span.tags.method}"`.
|
||||
1. Skip **Filter by trace ID** and **Filter by span ID** settings as these cannot be used with a custom query.
|
||||
1. Switch on **Use custom query**.
|
||||
1. Specify a custom query to be used to query the logs. You can use various variables to make that query relevant for current span. The link will only be shown only if all the variables are interpolated with non-empty values to prevent creating an invalid query.
|
||||
|
||||
#### Variables that can be used in a custom query
|
||||
|
||||
To use a variable you need to wrap it in `${}`. For example `${__span.name}`.
|
||||
|
||||
| Variable name | Description |
|
||||
| ---------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
||||
| **\_\_tags** | This variable uses the tag mapping from the UI to create a label matcher string in the specific data source syntax. The variable only uses tags that are present in the span. The link is still created even if only one of those tags is present in the span. You can use this if all tags are not required for the query to be useful. |
|
||||
| **\_\_span.spanId** | The ID of the span. |
|
||||
| **\_\_span.traceId** | The ID of the trace. |
|
||||
| **\_\_span.duration** | The duration of the span. |
|
||||
| **\_\_span.name** | Name of the span. |
|
||||
| **\_\_span.tags** | Namespace for the tags in the span. To access a specific tag named `version`, you would use `${__span.tags.version}`. In case the tag contains dot, you have to access it as `${__span.tags["http.status"]}`. |
|
||||
| **\_\_trace.traceId** | The ID of the trace. |
|
||||
| **\_\_trace.duration** | The duration of the trace. |
|
||||
| **\_\_trace.name** | The name of the trace. |
|
||||
|
||||
The following table describes the ways in which you can configure your trace to logs settings:
|
||||
|
||||
| Name | Description |
|
||||
| ------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
||||
| **Data source** | Sets the target data source. |
|
||||
| **Tags** | Defines the tags to use in the logs query. Default is `'cluster', 'hostname', 'namespace', 'pod'`. |
|
||||
| **Map tag names** | Enables configuring how Jaeger tag names map to logs label names. For example, map `service.name` to `service`. |
|
||||
| **Span start time shift** | Shifts the start time for the logs query based on the span start time. To extend to the past, use a negative value. Use time interval units like `5s`, `1m`, `3h`. Default is `0`. |
|
||||
| **Span end time shift** | Shifts the end time for the logs query based on the span end time. Use time interval units. Default is `0`. |
|
||||
| **Filter by Trace ID** | Toggles whether to append the trace ID to the logs query. |
|
||||
| **Filter by Span ID** | Toggles whether to append the span ID to the logs query. |
|
||||
| Setting name | Description |
|
||||
| ------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
||||
| **Data source** | Defines the target data source. You can select only Loki or Splunk \[logs\] data sources. |
|
||||
| **Span start time shift** | Shifts the start time for the logs query, based on the span's start time. You can use time units, such as `5s`, `1m`, `3h`. To extend the time to the past, use a negative value. Default: `0`. |
|
||||
| **Span end time shift** | Shifts the end time for the logs query, based on the span's end time. You can use time units. Default: `0`. |
|
||||
| **Tags** | Defines the the tags to use in the logs query. Default is `cluster`, `hostname`, `namespace`, `pod`. You can change the tag name for example to remove dots from the name if they are not allowed in the target data source. For example map `http.status` to `http_status`. |
|
||||
| **Filter by trace ID** | Toggles whether to append the trace ID to the logs query. |
|
||||
| **Filter by span ID** | Toggles whether to append the span ID to the logs query. |
|
||||
| **Use custom query** | Toggles use of custom query with interpolation. |
|
||||
| **Query** | Input to write custom query. Use variable interpolation to customize it with variables from span. |
|
||||
|
||||
### Configure trace to metrics
|
||||
### Trace to metrics
|
||||
|
||||
> **Note:** This feature is behind the `traceToMetrics` [feature toggle]({{< relref "../../setup-grafana/configure-grafana#feature_toggles" >}}).
|
||||
> If you use Grafana Cloud, open a [support ticket in the Cloud Portal](/profile/org#support) to access this feature.
|
||||
|
||||
The **Trace to metrics** section configures the [trace to metrics feature](/blog/2022/08/18/new-in-grafana-9.1-trace-to-metrics-allows-users-to-navigate-from-a-trace-span-to-a-selected-data-source/).
|
||||
The **Trace to metrics** section configures the [trace to metrics feature](/blog/2022/08/18/new-in-grafana-9.1-trace-to-metrics-allows-users-to-navigate-from-a-trace-span-to-a-selected-data-source/) available when integrating Grafana with Zipkin.
|
||||
|
||||
Use the settings to select the target Prometheus data source, and create any desired linked queries.
|
||||
To configure trace to metrics:
|
||||
|
||||
1. Select the target data source.
|
||||
1. Create any desired linked queries.
|
||||
|
||||
| Setting name | Description |
|
||||
| --------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
||||
@ -95,13 +125,13 @@ Each linked query consists of:
|
||||
Interpolate tags using the `$__tags` keyword.
|
||||
For example, when you configure the query `requests_total{$__tags}`with the tags `k8s.pod=pod` and `cluster`, the result looks like `requests_total{pod="nginx-554b9", cluster="us-east-1"}`.
|
||||
|
||||
### Enable Node Graph
|
||||
### Node Graph
|
||||
|
||||
The **Node Graph** setting enables the [Node Graph visualization]({{< relref "../../panels-visualizations/visualizations/node-graph/" >}}), which is disabled by default.
|
||||
|
||||
Once enabled, Grafana displays the Node Graph after loading the trace view.
|
||||
|
||||
### Configure the span bar label
|
||||
### Span bar label
|
||||
|
||||
The **Span bar label** section helps you display additional information in the span bar row.
|
||||
|
||||
@ -113,18 +143,23 @@ You can choose one of three options:
|
||||
| **Duration** | _(Default)_ Displays the span duration on the span bar row. |
|
||||
| **Tag** | Displays the span tag on the span bar row. You must also specify which tag key to use to get the tag value, such as `span.kind`. |
|
||||
|
||||
## Query traces
|
||||
## Query the data source
|
||||
|
||||
You can query and display traces from Zipkin via [Explore]({{< relref "../../explore/" >}}).
|
||||
|
||||
This topic explains configuration and queries specific to the Zipkin data source.
|
||||
For general documentation on querying data sources in Grafana, see [Query and transform data]({{< relref "../../panels-visualizations/query-transform-data" >}}).
|
||||
|
||||
### Query by trace ID
|
||||
|
||||
To query a particular trace:
|
||||
|
||||
1. Select the **TraceID** query type.
|
||||
1. Enter the trace's ID into the **Trace ID** field.
|
||||
|
||||
{{< figure src="/static/img/docs/v70/zipkin-query-editor.png" class="docs-image--no-shadow" caption="Screenshot of the Zipkin query editor" >}}
|
||||
|
||||
To query by trace ID, enter it.
|
||||
|
||||
{{< figure src="/static/img/docs/v70/zipkin-query-editor-open.png" class="docs-image--no-shadow" caption="Screenshot of the Zipkin query editor with trace selector expanded" >}}
|
||||
### Query by trace selector
|
||||
|
||||
To select a particular trace from all traces logged in the time range you have selected in Explore, you can also query by trace selector.
|
||||
The trace selector has three levels of nesting:
|
||||
@ -133,6 +168,8 @@ The trace selector has three levels of nesting:
|
||||
- Particular operation, part of the selected service
|
||||
- Specific trace in which the selected operation occurred, represented by the root operation name and trace duration
|
||||
|
||||
{{< figure src="/static/img/docs/v70/zipkin-query-editor-open.png" class="docs-image--no-shadow" caption="Screenshot of the Zipkin query editor with trace selector expanded" >}}
|
||||
|
||||
## View data mapping in the trace UI
|
||||
|
||||
You can view Zipkin annotations in the trace view as logs with annotation value displayed under the annotation key.
|
||||
|
@ -23,7 +23,11 @@ export function NodeGraphSettings({ options, onOptionsChange }: Props) {
|
||||
<div className={styles.container}>
|
||||
<h3 className="page-heading">Node graph</h3>
|
||||
<InlineFieldRow className={styles.row}>
|
||||
<InlineField tooltip="Displays the node graph above the trace view" label="Enable node graph" labelWidth={26}>
|
||||
<InlineField
|
||||
tooltip="Displays the node graph above the trace view. Default: disabled"
|
||||
label="Enable node graph"
|
||||
labelWidth={26}
|
||||
>
|
||||
<InlineSwitch
|
||||
id="enableNodeGraph"
|
||||
value={options.jsonData.nodeGraph?.enabled}
|
||||
|
@ -241,7 +241,7 @@ function TimeRangeShift(props: TimeRangeShiftProps) {
|
||||
label={`Span ${props.type} time shift`}
|
||||
labelWidth={26}
|
||||
grow
|
||||
tooltip={`Shifts the ${props.type} time of the span. Default 0 Time units can be used here, for example: 5s, 1m, 3h`}
|
||||
tooltip={`Shifts the ${props.type} time of the span. Default: 0 (Time units can be used here, for example: 5s, 1m, 3h)`}
|
||||
>
|
||||
<Input
|
||||
type="text"
|
||||
|
@ -97,7 +97,7 @@ export function TraceToMetricsSettings({ options, onOptionsChange }: Props) {
|
||||
label="Span start time shift"
|
||||
labelWidth={26}
|
||||
grow
|
||||
tooltip="Shifts the start time of the span. Default 0 (Time units can be used here, for example: 5s, 1m, 3h)"
|
||||
tooltip="Shifts the start time of the span. Default: 0 (Time units can be used here, for example: 5s, 1m, 3h)"
|
||||
>
|
||||
<Input
|
||||
type="text"
|
||||
@ -119,7 +119,7 @@ export function TraceToMetricsSettings({ options, onOptionsChange }: Props) {
|
||||
label="Span end time shift"
|
||||
labelWidth={26}
|
||||
grow
|
||||
tooltip="Shifts the end time of the span. Default 0 Time units can be used here, for example: 5s, 1m, 3h"
|
||||
tooltip="Shifts the end time of the span. Default: 0 (Time units can be used here, for example: 5s, 1m, 3h)"
|
||||
>
|
||||
<Input
|
||||
type="text"
|
||||
|
@ -106,7 +106,7 @@ export function NewTracePageHeader(props: TracePageHeaderEmbedProps) {
|
||||
);
|
||||
|
||||
let statusColor: BadgeColor = 'green';
|
||||
if (status && status.length > 0 && Number.isInteger(status[0].value)) {
|
||||
if (status && status.length > 0) {
|
||||
if (status[0].value.toString().charAt(0) === '4') {
|
||||
statusColor = 'orange';
|
||||
} else if (status[0].value.toString().charAt(0) === '5') {
|
||||
|
Loading…
Reference in New Issue
Block a user