Skip to content

otel: remove the last workspace crate feature#16469

Merged
bolinfest merged 1 commit intomainfrom
pr16469
Apr 1, 2026
Merged

otel: remove the last workspace crate feature#16469
bolinfest merged 1 commit intomainfrom
pr16469

Conversation

@bolinfest
Copy link
Copy Markdown
Collaborator

@bolinfest bolinfest commented Apr 1, 2026

Why

codex-otel still carried disable-default-metrics-exporter, which was the last remaining workspace crate feature.

We are removing workspace crate features because they do not fit our current build model well:

  • our Bazel setup does not honor crate features today, which can let feature-gated issues go unnoticed
  • they create extra crate build permutations that we want to avoid

For this case, the feature was only being used to keep the built-in Statsig metrics exporter off in test and debug-oriented contexts. This repo already treats debug_assertions as the practical proxy for that class of behavior, so OTEL should follow the same convention instead of keeping a dedicated crate feature alive.

What changed

  • removed disable-default-metrics-exporter from codex-rs/otel/Cargo.toml
  • removed the codex-otel dev-dependency feature activation from codex-rs/core/Cargo.toml
  • changed codex-rs/otel/src/config.rs so the built-in OtelExporter::Statsig default resolves to None when debug_assertions is enabled, with a focused unit test covering that behavior
  • removed the final feature exceptions from .github/scripts/verify_cargo_workspace_manifests.py, so workspace crate features are now hard-banned instead of temporarily allowlisted
  • expanded the verifier error message to explain the Bazel mismatch and build-permutation cost behind that policy

How tested

  • python3 .github/scripts/verify_cargo_workspace_manifests.py
  • cargo test -p codex-otel
  • cargo test -p codex-core metrics_exporter_defaults_to_statsig_when_missing
  • cargo test -p codex-app-server app_server_default_analytics_
  • just bazel-lock-check

Copy link
Copy Markdown
Contributor

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: e7e1e27f0a

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

// incremental local development and test runs do not emit
// best-effort OTEL traffic unless a test or binary opts into an
// explicit exporter configuration.
if cfg!(debug_assertions) {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

P2 Badge Preserve test-time exporter disable outside debug assertions

Switching the Statsig guard to cfg!(debug_assertions) means tests built with optimized profiles (cargo test --release or any profile with debug-assertions = false) will now resolve OtelExporter::Statsig to a real OTLP endpoint instead of None. Before this change, the workspace feature kept test runs from emitting network telemetry regardless of optimization level; with this condition, those test contexts can perform outbound export unexpectedly and become flaky/fail in network-restricted environments.

Useful? React with 👍 / 👎.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

We don't claim that cargo test --release works in this project.

@bolinfest bolinfest merged commit 323aa96 into main Apr 1, 2026
22 checks passed
@bolinfest bolinfest deleted the pr16469 branch April 1, 2026 20:45
@github-actions github-actions bot locked and limited conversation to collaborators Apr 1, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant