Skip to content

feat: add configurable telemetry support#36

Merged
markovejnovic merged 10 commits intomainfrom
marko/mes-717-telemetry
Feb 12, 2026
Merged

feat: add configurable telemetry support#36
markovejnovic merged 10 commits intomainfrom
marko/mes-717-telemetry

Conversation

@markovejnovic
Copy link
Collaborator

Summary

  • Add [telemetry] config block with vendor (bool, default false) and collector-url (optional string) for configuring OpenTelemetry trace export
  • Make OTLP dependencies always-included (remove __otlp_export feature flag) so telemetry is runtime-configurable
  • Refactor Trc tracing builder to accept telemetry config and create per-endpoint OTLP batch exporters
  • Reorder main.rs to load config before tracing init so telemetry settings are available
  • Add vendor telemetry opt-in prompt to onboarding wizard (default: yes)

Resolves MES-717

Config example

[telemetry]
vendor = true
collector-url = "https://my-collector.example.com"

Both vendor and collector-url can be active simultaneously — each gets its own independent OTLP batch exporter.

Remaining work

Grafana Alloy deployment at telemetry.priv.mesa.dev is tracked separately as infrastructure work.

Test plan

  • 7 new unit tests for TelemetryConfig deserialization and endpoints() logic
  • cargo clippy --all-targets --all-features -- -D warnings passes
  • All 50 tests pass
  • Manual: run onboarding wizard, verify telemetry prompt appears after org setup
  • Manual: set vendor = true in config, verify OTLP exporter initializes (check "Telemetry export enabled" log)

@mesa-dot-dev
Copy link

mesa-dot-dev bot commented Feb 12, 2026

Mesa Description

Summary

  • Add [telemetry] config block with vendor (bool, default false) and collector-url (optional string) for configuring OpenTelemetry trace export
  • Make OTLP dependencies always-included (remove __otlp_export feature flag) so telemetry is runtime-configurable
  • Refactor Trc tracing builder to accept telemetry config and create per-endpoint OTLP batch exporters
  • Reorder main.rs to load config before tracing init so telemetry settings are available
  • Add vendor telemetry opt-in prompt to onboarding wizard (default: yes)

Resolves MES-717

Config example

[telemetry]
vendor = true
collector-url = "https://my-collector.example.com"

Both vendor and collector-url can be active simultaneously — each gets its own independent OTLP batch exporter.

Remaining work

Grafana Alloy deployment at telemetry.priv.mesa.dev is tracked separately as infrastructure work.

Test plan

  • 7 new unit tests for TelemetryConfig deserialization and endpoints() logic
  • cargo clippy --all-targets --all-features -- -D warnings passes
  • All 50 tests pass
  • Manual: run onboarding wizard, verify telemetry prompt appears after org setup
  • Manual: set vendor = true in config, verify OTLP exporter initializes (check "Telemetry export enabled" log)

Description generated by Mesa. Update settings

@markovejnovic
Copy link
Collaborator Author

LGTM, but needs testing

@markovejnovic markovejnovic self-assigned this Feb 12, 2026
Copy link

@mesa-dot-dev mesa-dot-dev bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Performed full review of 0453e34...491ab6d

Analysis

  1. Telemetry initialization happens up front for every execution path, which could impact performance in paths that don't need tracing capabilities.

  2. The exporter lifecycle is tightly coupled to process lifecycle (initialization, daemonization, shutdown), which may create issues with fork-safety and accurate success reporting.

  3. Early failures before config loading fall back to eprintln!, creating inconsistent command-line user experience depending on whether tracing was initialized.

  4. System correctness now depends on config validation and process lifecycle management rather than cargo features, introducing new potential points of failure.

Tip

Help

Slash Commands:

  • /review - Request a full code review
  • /review latest - Review only changes since the last review
  • /describe - Generate PR description. This will update the PR body or issue comment depending on your configuration
  • /help - Get help with Mesa commands and configuration options

5 files reviewed | 1 comments | Edit Agent SettingsRead Docs

OTLP BatchSpanProcessor threads created before daemonize::Daemonize::start()
do not survive the fork — the child process only retains the main thread.
Move tracing initialization (including OTLP exporter setup) to after the
fork so exporter threads are created in the daemon child process.
@markovejnovic markovejnovic merged commit b7a88b3 into main Feb 12, 2026
6 checks passed
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.

1 participant