You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: CHANGELOG.md
+4Lines changed: 4 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,4 +1,8 @@
1
1
# Changelog
2
+
## 1.7.1 (2026-08-17)
3
+
* Add **Get trace project from the query** option to the Logs to traces settings (`logsToTraces.projectIdFromQuery`). When enabled, "View trace" links use the project of the query that produced the log entry (falling back to the default project) instead of the project embedded in the entry's `trace` path — for setups where logs are routed through a central logging project that stamps its own ID into the trace path. The setting is preserved when the trace data source is changed or cleared
4
+
* Fix "View trace" links under GCE authentication intermittently missing for entries whose `trace` label is not a canonical resource path: the auto-detected default project is now resolved whenever a trace data source is configured (concurrently with the query), shared across simultaneous queries, and no longer re-fetched before every query after a failed lookup
5
+
2
6
## 1.7.0 (2026-07-20)
3
7
* Add **Logs to traces** correlation: select a Google Cloud Trace data source in the data source settings, and log entries carrying a trace ID get a "View trace" link in the log details. The picker is restricted to Google Cloud Trace data sources, since the link query uses Cloud Trace's query format. When a log entry's `trace` value is not in the canonical `projects/<project>/traces/<id>` form, the link uses the data source's default project, or is omitted when no project can be determined
4
8
* Support queries arriving via Grafana's trace-to-logs span links (`query` field): interpolate template variables and fall back to the default project when the span link carries no project ID. The fallback also covers GCE authentication (auto-detected project) and applies only to span-link queries, so dashboard queries with an empty project ID still surface an error
Copy file name to clipboardExpand all lines: README.md
+5Lines changed: 5 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -109,12 +109,17 @@ If a pattern contains invalid regex syntax, it is treated as a literal string ma
109
109
110
110
You can link log entries to a [Google Cloud Trace](https://grafana.com/grafana/plugins/googlecloud-trace-datasource/) data source. In the data source settings, under **Logs to traces**, select the Google Cloud Trace data source. Once configured, any log entry written with the [LogEntry `trace` field](https://cloud.google.com/logging/docs/reference/v2/rest/v2/LogEntry) shows a `traceId` field with a **View trace** link in the log details — clicking it opens the trace in the selected data source. The link carries the project parsed from the entry's `projects/<project>/traces/<id>` path; if the `trace` value is not in that form, the data source's default project is used, and if no project can be determined the link is omitted.
111
111
112
+
If your logs are routed through a central logging project (for example, an OpenTelemetry collector writes to one project and a [log sink](https://cloud.google.com/logging/docs/export/configure_export_v2) forwards entries to tenant projects), the `trace` path is stamped with the routing project's ID even though the trace lives in the tenant project, so the parsed project is wrong. Enable **Get trace project from the query** to make the link use the project of the query that produced the log entry instead (falling back to the data source's default project; if neither resolves, the link is omitted). Only the link target changes — the raw `trace` label in the log details still shows the original path.
113
+
112
114
Provisioning example:
113
115
114
116
```yaml
115
117
jsonData:
116
118
logsToTraces:
117
119
datasourceUid: my-cloud-trace-datasource-uid
120
+
# Optional: use the queried project for View trace links instead of the
121
+
# project in the log entry's trace path (for centrally routed logs)
122
+
# projectIdFromQuery: true
118
123
```
119
124
120
125
> **Note: a "View trace" link is not a guarantee that the trace was recorded.** For services with automatic request tracing (Cloud Run, App Engine, GKE ingress, and other services behind Google's HTTP load balancing), every request log entry carries a trace ID, but Cloud Trace only stores traces for **sampled** requests — and the built-in sampling rate is low (roughly 0.1 traces per second per instance for Cloud Run). Clicking **View trace** for an unsampled request shows a "trace not found" result; this is expected and matches the behavior of the trace links in the Google Cloud console's Logs Explorer. To make more links resolve, increase sampling on the application side: instrument the service with [OpenTelemetry](https://cloud.google.com/trace/docs/setup) and configure your own sampling rate, or force sampling on individual requests by sending an `X-Cloud-Trace-Context: <trace-id>/<span-id>;o=1` header (or a W3C `traceparent` header with the sampled flag set). Note that Cloud Trace bills per ingested span, so consider cost before sampling at 100% on high-traffic services.
description="Use the query's project ID (or the default project) for 'View trace' links instead of the project in the log entry's trace field. If neither resolves, the link is omitted. Enable this when logs are routed through a central logging project that stamps its own ID into the trace path."
0 commit comments