diff --git a/src/content/docs/workers/observability/exporting-opentelemetry-data/grafana-cloud.mdx b/src/content/docs/workers/observability/exporting-opentelemetry-data/grafana-cloud.mdx index 7fbec8b8287cbd8..9b834999972c69e 100644 --- a/src/content/docs/workers/observability/exporting-opentelemetry-data/grafana-cloud.mdx +++ b/src/content/docs/workers/observability/exporting-opentelemetry-data/grafana-cloud.mdx @@ -12,7 +12,7 @@ Grafana Cloud is a fully managed observability platform that provides visualizat This guide will walk you through configuring Cloudflare Workers to export OpenTelemetry-compliant traces and logs to your Grafana Cloud stack. -![Grafana Tempo trace view showing a distributed trace for a service with multiple spans including fetch requests, durable object subrequests, and queue operations, with timing information displayed on a timeline](~/assets/images/workers-observability/grafana-traces.png) +![Pre-built Grafana dashboard showing Total requests, request rate (req/sec), and unique request tracking via Ray IDs Log Severity: Breakdown of info, warning, and error logs with color-coded indicators Geographic Distribution: Unique countries, colos, and execution regions](https://storage.googleapis.com/grafanalabs-integration-assets/cloudflare-workers/cloudflare-workers-1.png) ## Prerequisites @@ -21,26 +21,23 @@ Before you begin, ensure you have: - An active [Grafana Cloud account](https://grafana.com/auth/sign-up/create-user) (free tier available) - A deployed Worker that you want to monitor -## Step 1: Access the OpenTelemetry setup guide +## Step 1: Access the Grafana Cloud Credentials -1. Log in to your [Grafana Cloud portal](https://grafana.com/) +1. Log in to your [Grafana Cloud stack](https://grafana.com/) 2. From your organization's home page, navigate to **Connections** → **Add new connection** -3. Search for "OpenTelemetry" and select **OpenTelemetry (OTLP)** -4. Select **Quickstart** then select **JavaScript** -6. Click **Create a new token** -7. Enter a name for your token (e.g., `cloudflare-workers-otel`) and click **create token** -8. Click on **Close** without copying the token -9. Copy and Save the value for `OTEL_EXPORTER_OTLP_ENDPOINT` and `OTEL_EXPORTER_OTLP_HEADERS` in the `Environment variables` code block as the OTel endpoint and as the Auth header value respectively - +3. Search for "Cloudflare" and select **Cloudflare workers** +4. Follow the instructions to create a **Create a new token** and access the grafana Cloud OTLP Credentials for Traces and Logs + * Make sure you note your OTLP endpoint, authorization header name, and authorization header value as these will be used in Step 2 ## Step 2: Set up destination 1. Navigate to your Cloudflare account's [Workers Observability](https://dash.cloudflare.com/?to=/:account/workers-and-pages/observability/pipelines) section 2. Click **Add destination** and configure a destination name (e.g. `grafana-tracing`) -3. From Grafana, copy your Otel endpoint, auth header, and auth value - * Your OTEL endpoint will look like `https://otlp-gateway-prod-us-east-2.grafana.net/otlp` (append `/v1/traces` for traces and `/v1/logs` for logs) - * Your custom header should include: - * Your auth header name `Authorization` - * Your auth header value `Basic MTMxxx...` +3. Configuring the Trace and Logs destination: + * For the endpoint, use the OTLP endpoint obtained in Step 1 + * Your OTEL endpoint will look like `https://otlp-gateway-prod-us-east-2.grafana.net/otlp` (append `/v1/traces` for traces and `/v1/logs` for logs) + * For authentication, set the: + * Header name as `Authorization` + * Header value to the value of your auth header value from Step 1. Your auth header value will look like `Basic MTMxxx...` ## Step 3: Configure your Worker @@ -67,7 +64,7 @@ With your destination created in the Cloudflare dashboard, update your Worker's -After updating your configuration, deploy your Worker for the changes to take effect. +After updating your configuration, deploy your Worker for the changes to take effect. If not using the Grafana Cloud Integration for Cloudflare workers, You can also import the pre-built dashboard from [here](https://github.com/grafana/jsonnet-libs/tree/master/cloudflare-workers-mixin/dashboards) :::note It may take a few minutes after deployment for data to appear in Grafana Cloud.