Skip to content

cli: avoid retaining telemetry in silent sessions - #13762

Merged
sipsma merged 2 commits into
dagger:mainfrom
sipsma:fix/silent-session-telemetry-retention
Jul 29, 2026
Merged

sipsma merged 2 commits into
dagger:mainfrom
sipsma:fix/silent-session-telemetry-retention

Conversation

@sipsma

@sipsma sipsma commented Jul 29, 2026 •

Copy link
Copy Markdown
Contributor

Summary

  • honor DAGGER_SILENT as the environment equivalent of --silent
  • omit frontend span, log, and metric exporters for silent dagger session processes before telemetry initialization
  • keep Dagger Cloud and detected OTLP exporters enabled

Motivation

Native CI workers can run 20 concurrent Go SDK clients, each of which starts a dagger session CLI child. The frontend in each child owns a dagui.DB that retains every relayed span, log, and metric for the session lifetime, even when progress output is silent and discarded.

In the observed 8 GiB worker OOMs, the worker process itself held about 172 MiB RSS while almost all remaining cgroup memory was held by the session children. Removing the frontend exporters in this mode prevents the unbounded frontend ownership path instead of hiding output or dropping retained data at shutdown.

Semantics and tradeoffs

Default and non-session telemetry behavior is unchanged. Silent sessions still drain engine telemetry and export it to configured Cloud and OTLP destinations. They do not populate the local frontend database, so frontend-derived progress history is intentionally unavailable in the mode that already suppresses progress.

This change proves the ownership-path reduction but does not claim an exact RSS reduction without a representative production heap profile.

Tests

  • go test ./internal/cmd/dagger -run="Test(EngineTelemetryConfig|SilentFromEnv)" -count=1
  • go test -race ./internal/cmd/dagger -run="Test(EngineTelemetryConfig|SilentFromEnv)" -count=1
  • dagger api call engine-dev test --pkg ./core/integration --run="TestClient/TestSilentSessionExportsTelemetryToCloud" with isolated credentials and a local fake Cloud collector
  • dagger check "golang:lint"
  • git diff --check

@sipsma
sipsma merged commit 205462f into dagger:main Jul 29, 2026
86 of 87 checks passed
marcosnils pushed a commit that referenced this pull request Jul 29, 2026
marcosnils pushed a commit that referenced this pull request Jul 29, 2026
social4hyq pushed a commit to social4hyq/homebrew-core that referenced this pull request Sep 20, 2026
dagger 0.21.8

Created-by: HarmonybrewBot
Commit-by: HarmonybrewBot
Merged-by: HarmonybrewBot
Description: Created by `brew bump`

---

Created with `brew bump-formula-pr`.<details>
  <summary>release notes</summary>
  <pre>## v0.21.8 - 2026-07-29

### Changed

- Changeset diffs are now computed from filesystem metadata instead of full-content comparison, significantly speeding up diff computation for large directories. by @marcosnils in
  dagger/dagger#13615

### Fixed

- Dockerfile build layer caching so unrelated build-context changes no longer bust the cache: `COPY`-ed directories now get a content-based cache identity, re-keying downstream steps only when copied content
  actually changes. by @marcosnils in dagger/dagger#13765
- The `--x-release` CLI re-exec so `_EXPERIMENTAL_DAGGER_RUNNER_HOST` is preserved (with a warning) instead of being stripped, and clarified its startup message to avoid implying it runs from any build. by
  @tiborvass in dagger/dagger#13752
- Silent SDK sessions no longer retain frontend telemetry in memory while Cloud and OTLP export remain enabled. `DAGGER_SILENT` is now honored as the equivalent of `--silent`. by @sipsma in
  dagger/dagger#13762

### What to do next?

- Read the [documentation](https://docs.dagger.io)
- Join our [Discord server](https://discord.gg/dagger-io)
- Follow us on [Twitter](https://twitter.com/dagger_io)

</pre>
  <p>View the full release notes at <a href="https://github.com/dagger/dagger/releases/tag/v0.21.8">https://github.com/dagger/dagger/releases/tag/v0.21.8</a>.</p>
</details>
<hr>

See merge request: Harmonybrew/homebrew-core!15378
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants