Skip to content

feat(observability): add support for tracing#23

Open
thiagohsc21 wants to merge 1 commit into
mainfrom
thiagohsc/tracing-sup-for-statsig
Open

feat(observability): add support for tracing#23
thiagohsc21 wants to merge 1 commit into
mainfrom
thiagohsc/tracing-sup-for-statsig

Conversation

@thiagohsc21

@thiagohsc21 thiagohsc21 commented Jun 17, 2026

Copy link
Copy Markdown

Summary

  • Add APM tracing spans to all public evaluation methods (check_gate, get_dynamic_config, get_config, get_experiment, get_experiment_without_local_evaluation)
  • Each span includes the gate/config/experiment name via otel.name for readable Datadog waterfalls
  • A statsig.evaluation attribute distinguishes http (server round-trip) from local (in-memory) evaluations
  • Differentiate get_experiment_remote span name from get_experiment to avoid trace collisions

Motivation

The statsig-rs SDK silently falls back to HTTP server-side evaluation when a ConditionType or OperatorType isn't implemented locally. These round-trips (~30-50ms) are invisible in APM, making it hard to diagnose unexpected latency in endpoints that appear to only do in-memory work.

What changes

  • src/client.rs: wrap each evaluation method body with async { ... }.instrument(span).await
  • No API changes, no new dependencies (uses tracing which is already a dependency)

What does NOT change

  • No call site changes required by consumers
  • No behavioral changes to evaluation logic
  • log_event intentionally left uninstrumented (fire-and-forget analytics, not evaluation)

@thiagohsc21
thiagohsc21 force-pushed the thiagohsc/tracing-sup-for-statsig branch 3 times, most recently from 91b9f63 to b26f2b5 Compare June 17, 2026 21:38

@EduardoGiacomini EduardoGiacomini left a comment

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.

LGTM! Some points do fix:

  1. Can you provide a minimal PR description write in Eglish?
  2. It will be necessary change the crate version to publish the code.

@thiagohsc21
thiagohsc21 force-pushed the thiagohsc/tracing-sup-for-statsig branch from b26f2b5 to c9e1ca7 Compare June 18, 2026 12:32
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