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
Add detailed guide for exporting OpenTelemetry data to Grafana Cloud, including prerequisites, setup steps, and configuration examples for both wrangler.jsonc and wrangler.toml. This enhances the observability documentation by providing users with clear instructions on integrating Cloudflare Workers with Grafana Cloud for telemetry data visualization and analysis.
Copy file name to clipboardExpand all lines: src/content/docs/workers/observability/exporting-opentelemetry-data/grafana-cloud.mdx
+83Lines changed: 83 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -5,3 +5,86 @@ sidebar:
5
5
order: 2
6
6
---
7
7
8
+
import { Tabs, TabItem } from"~/components";
9
+
10
+
Grafana Cloud is a fully managed observability platform that provides visualization, alerting, and analytics for your telemetry data. By exporting your Cloudflare Workers telemetry to Grafana Cloud, you can:
11
+
- Visualize distributed traces in **Grafana Tempo** to understand request flows and performance bottlenecks
12
+
- Query and analyze logs in **Grafana Loki** alongside your traces
13
+
14
+
This guide will walk you through configuring Cloudflare Workers to export OpenTelemetry-compliant traces and logs to your Grafana Cloud stack.
15
+
16
+

17
+
18
+
## Prerequisites
19
+
20
+
Before you begin, ensure you have:
21
+
22
+
- An active [Grafana Cloud account](https://grafana.com/auth/sign-up/create-user) (free tier available)
23
+
- A deployed Worker that you want to monitor
24
+
25
+
## Step 1: Access the OpenTelemetry setup guide
26
+
27
+
1. Log in to your [Grafana Cloud portal](https://grafana.com/)
28
+
2. From your organization's home page, navigate to **Connections** → **Add new connection**
29
+
3. Search for "OpenTelemetry" and select **OpenTelemetry (OTLP)**
30
+
4. Select **Quickstart** then select **JavaScript**
31
+
6. Click **Create a new token**
32
+
7. Enter a name for your token (e.g., `cloudflare-workers-otel`) and click **create token**
33
+
34
+
35
+
## Step 2: Set up destination
36
+
1. Navigate to your Cloudflare account's [Workers Observability](https://dash.cloudflare.com/?to=/:account/workers-and-pages/observability/pipelines) section
37
+
2. Click **Add destination** and configure a destination name (e.g. `grafana-tracing`)
38
+
3. From Grafana, copy your Otel endpoint, auth header, and auth value
39
+
* Your OTEL endpoint will look like `https://otlp-gateway-prod-us-east-2.grafana.net/otlp` (append `/v1/traces for tracing and `/v1/logs` for logs)
40
+
* Your custom header should include:
41
+
* Your auth header name `Authorization`
42
+
* Your auth header value `Basic MTMxxx...`
43
+
44
+
## Step 3: Configure your Worker
45
+
46
+
With your destination created in the Cloudflare dashboard, update your Worker's configuration to enable telemetry export.
47
+
48
+
<Tabs>
49
+
<TabItemlabel="wrangler.jsonc">
50
+
51
+
```jsonc title="wrangler.jsonc"
52
+
{
53
+
"observability": {
54
+
"traces": {
55
+
"enabled":true,
56
+
// Must match the destination name in the dashboard
57
+
"destinations": ["grafana-traces"]
58
+
},
59
+
"logs": {
60
+
"enabled":true,
61
+
// Must match the destination name in the dashboard
62
+
"destinations": ["grafana-logs"]
63
+
}
64
+
}
65
+
}
66
+
```
67
+
68
+
</TabItem>
69
+
<TabItemlabel="wrangler.toml">
70
+
71
+
```toml title="wrangler.toml"
72
+
[observability.traces]
73
+
enabled = true
74
+
# Must match the destination name in the dashboard
75
+
destinations = ["grafana-traces"]
76
+
77
+
[observability.logs]
78
+
enabled = true
79
+
# Must match the destination name in the dashboard
80
+
destinations = ["grafana-logs"]
81
+
```
82
+
83
+
</TabItem>
84
+
</Tabs>
85
+
86
+
After updating your configuration, deploy your Worker for the changes to take effect.
87
+
88
+
:::note
89
+
It may take a few minutes after deployment for data to appear in Grafana Cloud.
0 commit comments