feat: Add with-otel example with pre-configured Grafana dashboard#12043
Merged
anthonyshew merged 9 commits intomainfrom Feb 27, 2026
Merged
feat: Add with-otel example with pre-configured Grafana dashboard#12043anthonyshew merged 9 commits intomainfrom
anthonyshew merged 9 commits intomainfrom
Conversation
Moves examples/local-otel-collector to examples/with-otel and transforms it into a proper Turborepo example following the create-turbo pattern. - Full monorepo structure (apps/web, apps/docs, shared packages) - Installed turbo@2.8.13-canary.1 as a devDependency - Pre-configured Grafana with a Turborepo Runs dashboard - Anonymous Grafana access so users see metrics immediately - meta.json, pnpm-workspace.yaml, and all standard boilerplate
Contributor
|
The latest updates on your projects. Learn more about Vercel for GitHub.
1 Skipped Deployment
|
…rimentalObservability: true`, causing the OTEL example to fail with an error when following the documented instructions.
This commit fixes the issue reported at examples/with-otel/turbo.json:2
## Bug Analysis
The `examples/with-otel` example documents a workflow where users set environment variables like `TURBO_EXPERIMENTAL_OTEL_ENABLED=1` and then run `turbo build` to export OpenTelemetry metrics. However, the example's `turbo.json` is missing the required `futureFlags.experimentalObservability: true` setting.
### How the gate works
In `crates/turborepo-lib/src/run/builder.rs` (lines 453-463), there is a hard gate:
```rust
if let Some(obs_opts) = &self.opts.experimental_observability {
if obs_opts.otel.is_some() && !self.opts.future_flags.experimental_observability {
return Err(turborepo_config::Error::InvalidExperimentalOtelConfig {
message: "experimentalObservability.otel is configured but \
futureFlags.experimentalObservability is not enabled in turbo.json."
.to_string(),
}
.into());
}
}
```
### The flow
1. User sets `TURBO_EXPERIMENTAL_OTEL_ENABLED=1` (and other env vars) as documented in the README
2. The env vars are parsed in `crates/turborepo-config/src/experimental_otel.rs` into `ExperimentalOtelOptions`
3. This gets wrapped as `ExperimentalObservabilityOptions { otel: Some(otel) }` in the config funnel
4. When `turbo build` runs, the gate checks `obs_opts.otel.is_some()` (true) AND `!self.opts.future_flags.experimental_observability` (true, since `FutureFlags` defaults to `false`)
5. The run fails with the error: "experimentalObservability.otel is configured but futureFlags.experimentalObservability is not enabled in turbo.json."
### The fix
Added the `futureFlags` block with `experimentalObservability: true` to `examples/with-otel/turbo.json`. This is a valid top-level field in turbo.json (defined in `crates/turborepo-turbo-json/src/raw.rs` line 291 and extensively tested). Without this, the example is completely non-functional as documented.
Co-authored-by: Vercel <vercel[bot]@users.noreply.github.com>
Co-authored-by: anthonyshew <anthonyshew@gmail.com>
- All stat panels use sum() to aggregate across runs (no duplicate numbers) - Cache Hit Rate shows a single gauge - Run Duration uses instant query that works with one-off runs - Replaced Runs Over Time with a Total Runs stat + Run Duration Over Time chart - Task Details table uses filterFieldsByName to exclude Prometheus-injected columns - All task breakdown queries use sum by (turbo_task_name) for clean grouping - Time-series panels use showPoints: always + spanNulls for sparse data
github-actions Bot
added a commit
that referenced
this pull request
Feb 27, 2026
## Release v2.8.13-canary.4 Versioned docs: https://v2-8-13-canary-4.turborepo.dev ### Changes - release(turborepo): 2.8.13-canary.3 (#12046) (`f384967`) - docs: Fix incorrect otel future flag bypass claim (#12047) (`ddbb12d`) - feat: Add with-otel example with pre-configured Grafana dashboard (#12043) (`d47c6c7`) - fix: Address root causes of 9 flaky tests and remove retry workarounds (#12045) (`ba2a830`) --------- Co-authored-by: Turbobot <turbobot@vercel.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
examples/local-otel-collectortoexamples/with-oteland transforms it into a standard Turborepo example following thecreate-turbopatterndocker compose up -d-- no manual datasource or dashboard setup requiredTry it
Testing