GitHub Agentic Workflows

OpenTelemetry

Observability in GitHub Agentic Workflows often begins with inspecting a single run. That is usually enough at first, but it breaks down once you need retained telemetry, visibility across runs, and a way to investigate without repeatedly spending GitHub API quota or running into rate limits.

OpenTelemetry is the standard way to do that. It lets you export workflow traces through the OpenTelemetry Protocol (OTLP) to backends such as Datadog, Grafana, or Sentry, and read telemetry back through MCP when agents need to investigate. Most workflows should use either write-side OTLP or read-side MCP. Use both only when you need to correlate newly emitted spans with traces already in the backend.

OpenTelemetry gives you a standard way to export workflow traces. The main choice is which backend should receive and surface that telemetry.

  • Datadog is a strong fit when workflow telemetry needs to plug into broader operational monitoring and service health.
  • Grafana is a strong fit for teams that want an OpenTelemetry-first stack for traces, dashboards, and investigation.
  • Sentry is a strong fit when workflow telemetry should live next to application errors and performance debugging.

This is configured with observability.otlp in workflow frontmatter:

.github/workflows/daily-report.md
---
network:
allowed:
- "*.datadoghq.com"
- "*.datadoghq.eu"
- "*.ddog-gov.com"
observability:
otlp:
endpoint:
- url: ${{ secrets.GH_AW_OTEL_DATADOG_ENDPOINT }}
headers:
DD-API-KEY: ${{ secrets.DD_API_KEY }}
---

We also support sending to multiple OTLP endpoints in the same workflow. Use the array form when the workflow should fan out to more than one collector, for example Datadog and Grafana or Datadog and Sentry.

Once configured, GitHub Agentic Workflows exports built-in workflow spans such as setup and conclusion events to the configured OTLP backend or backends, such as Datadog, Grafana, Sentry, or another OTLP-compatible system. You can also emit custom spans from your workflow code using the OpenTelemetry API and an OTLP-compatible client library in your workflow language. In the backend, those spans are available as traces for querying and drilldown.

This is configured with mcp-servers in workflow frontmatter. Use the read path when the agent needs to inspect telemetry that already exists in a backend such as Datadog, Grafana, Sentry, Tempo, or another OpenTelemetry-compatible system.

.github/workflows/telemetry-investigation.md
---
mcp-servers:
datadog:
url: "https://mcp.datadoghq.com/api/unstable/mcp-server/mcp"
headers:
DD_API_KEY: "${{ secrets.DD_API_KEY }}"
DD_APPLICATION_KEY: "${{ secrets.DD_APPLICATION_KEY }}"
DD_SITE: "${{ secrets.DD_SITE || 'datadoghq.com' }}"
allowed:
- search_datadog_dashboards
- search_datadog_slos
- search_datadog_metrics
- get_datadog_metric
---

In this model, the workflow does not emit new spans by itself. It gives the agent a tool that can query existing traces and spans from an external backend.

Keep both write-side OTLP configuration and read-side MCP configuration in shared workflow files and import them where needed. In this repository, that usually means shared/otlp.md for the combined Sentry and Grafana OTLP pattern, shared/mcp/grafana.md or shared/mcp/datadog.md for read access, and shared/otel-queries.md for the query playbook.

Choose your backend here and follow the matching setup path. When many workflows need the same observability wiring, shared imports are usually the right default.

To set up Datadog as an OTLP write backend and an MCP read source, follow these steps.

Datadog uses one OTLP endpoint plus DD_API_KEY for write, and DD_API_KEY, DD_APPLICATION_KEY, and DD_SITE for read.

  1. Choose the Datadog site you will use. Keep write-side OTLP export and read-side MCP access pointed at the same Datadog site. Store that site in DD_SITE. Common values include datadoghq.com, datadoghq.eu, ddog-gov.com, us5.datadoghq.com, and ap1.datadoghq.com.

  2. Create a Datadog API key. In Datadog, open Organization Settings, then API Keys, and create a key for workflow telemetry. Store it as DD_API_KEY. This key is used for OTLP write and is also sent to the Datadog MCP server.

  3. Create a Datadog application key. In Datadog, open Organization Settings, then Application Keys, and create a key for read-side investigation workflows. Store it as DD_APPLICATION_KEY. The MCP configuration needs this key in addition to DD_API_KEY.

  4. Store the OTLP endpoint for the same site. Get the Datadog OTLP traces endpoint for the site selected in step 1 and store it as GH_AW_OTEL_DATADOG_ENDPOINT. Keep GH_AW_OTEL_DATADOG_ENDPOINT, DD_API_KEY, DD_APPLICATION_KEY, and DD_SITE aligned to the same Datadog account and site.

  5. Run one workflow to write and one workflow to read. Trigger a workflow that exports spans through OTLP, then run a Datadog-backed investigation workflow that imports shared/mcp/datadog.md. If write-side OTLP and read-side MCP point at different Datadog sites, export may succeed while the investigation workflow reads the wrong account or environment.

  • Imports for bundling shared observability configuration
  • Architecture for the broader runtime observability model