Skip to content

feat(cubestore): add OpenTelemetry metrics exporter - #1

Draft
deedubs wants to merge 2 commits into
universefrom
claude/cubestore-otel-exporter-9uowsg
Draft

feat(cubestore): add OpenTelemetry metrics exporter#1
deedubs wants to merge 2 commits into
universefrom
claude/cubestore-otel-exporter-9uowsg

Conversation

@deedubs

@deedubs deedubs commented Jul 24, 2026

Copy link
Copy Markdown

Check List

  • Tests have been run in packages where changes have been made if available
  • Linter has been run for changed code
  • Tests for the changes have been added if not covered yet
  • Docs have been added / updated if required

Description of Changes Made (if issue reference is not provided)

Adds an OpenTelemetry (OTLP) metrics exporter to the cubestore process as an
alternative to the existing StatsD/DogStatsD UDP sink.

  • New backend, same reporting API. Introduces a MetricSink trait so the
    process-wide metrics sink can be either the StatsD UDP sink or the new
    OpenTelemetry sink. All existing app_metrics call sites (counters, gauges,
    histograms) are unchanged.
  • util/metrics/otel.rs. New OtelSink that lazily creates and caches
    OpenTelemetry instruments by metric name, maps DogStatsD-style name:value
    tags to OTLP attributes, and pushes over OTLP/HTTP via a periodic exporter.
  • Selection & config. Set CUBESTORE_METRICS_FORMAT=otel to enable it. The
    exporter is initialized inside the Tokio runtime (it is push-based and needs
    an async runtime). Endpoint/interval are configurable via
    CUBESTORE_METRICS_OTEL_ENDPOINT and CUBESTORE_METRICS_OTEL_INTERVAL_SECS,
    falling back to the standard OTEL_EXPORTER_OTLP_* environment variables.
  • Docs. Documents the new otel format value and env vars in the
    environment-variables reference.
  • Fork process. Adds a "Syncing with Upstream" section to the root
    CLAUDE.md describing how our organization-specific changes are maintained on
    the long-running universe branch (rebased on upstream cube-js/cube master,
    synced on demand via a chore: Sync release PR).

Verification

  • cargo check -p cubestore --bin cubestored compiles cleanly.
  • rustfmt run on all changed Rust files (clean).
  • Added a parse_tag unit test. The full cargo test suite was not run in this
    environment (network-restricted dependency fetch); reviewers should run the
    cubestore test suite in CI.

🤖 Generated with Claude Code

https://claude.ai/code/session_01KNKdpuR2ibDAX8eWJwUcLm


Generated by Claude Code

claude added 2 commits July 24, 2026 20:34
Add an OTLP metrics backend to the cubestore process as an alternative to
the existing StatsD/DogStatsD UDP sink. Selected with
`CUBESTORE_METRICS_FORMAT=otel`, it exports all existing `app_metrics`
(counters, gauges, histograms) over OTLP/HTTP using a periodic push
exporter.

- Introduce a `MetricSink` trait so the global metrics sink can be either
  the StatsD UDP sink or the new OpenTelemetry sink; existing call sites are
  unchanged.
- Add `util/metrics/otel.rs` with `OtelSink`, lazily creating and caching
  OpenTelemetry instruments by metric name and mapping DogStatsD-style tags
  to OTLP attributes.
- Initialize the exporter inside the Tokio runtime (it is push-based and
  needs an async runtime), honoring `CUBESTORE_METRICS_OTEL_ENDPOINT` and
  `CUBESTORE_METRICS_OTEL_INTERVAL_SECS`, and falling back to the standard
  `OTEL_EXPORTER_OTLP_*` env vars.
- Document the new format value and env vars.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01KNKdpuR2ibDAX8eWJwUcLm
Describe the fork-maintenance model in the root CLAUDE.md: our
organization-specific changes live on the long-running `universe` branch,
kept rebased on upstream `cube-js/cube` master, and synced on demand via a
`chore: Sync release` PR that carries the upstream sync only.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01KNKdpuR2ibDAX8eWJwUcLm
@deedubs
deedubs changed the base branch from master to universe July 24, 2026 21:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants