Skip to content

feat(filters): add OpenTelemetry routing spans - #729

Open
nerdalert wants to merge 1 commit into
praxis-proxy:mainfrom
nerdalert:feat/opentelemetry-routing
Open

feat(filters): add OpenTelemetry routing spans#729
nerdalert wants to merge 1 commit into
praxis-proxy:mainfrom
nerdalert:feat/opentelemetry-routing

Conversation

@nerdalert

Copy link
Copy Markdown
Member

Summary

Adds feature-gated OpenTelemetry instrumentation for successful intelligent_route decisions.

When enabled, the filter emits a bounded routing.select child span after the route has been successfully applied. It records privacy-safe routing metadata such as provider, cluster, site, overlay revision, rank, selection tier, selection group, and picker policy.

This PR intentionally does not add an OpenTelemetry SDK, exporter, sampler, propagator, or request-lifecycle root span to AI. That support is being added separately to Praxis core by @Ladas. AI only emits structured tracing spans, so this change remains independently mergeable and does not depend on the core work to compile or operate safely.

  • Default builds and runtime behavior are unchanged.
  • The opentelemetry feature adds no AI-owned SDK or exporter dependency.
  • AI continues to work without the pending Praxis core OpenTelemetry PRs.
  • With current Praxis core, the spans behave as normal structured tracing events.
  • Once the core telemetry stack is available and enabled, it can export these spans without further routing changes.
  • The implementation avoids duplicate root spans and conflicting context propagation by leaving both concerns entirely in core.

The span is emitted only after fallible provider-context mutation succeeds, preventing telemetry from claiming a successful selection when route application fails. Recorded attributes are bounded and exclude credentials, prompts, bodies, authorization headers, cookies, session keys, and request IDs.

Related issue

Closes #

Validation

  • Unit tests
  • Integration or functional tests
  • make lint

Validation completed:

  • Formatting passed.
  • Clippy passed.
  • Feature-enabled filter tests passed: 1,011 tests.
  • All-features workspace validation passed.
  • Praxis AI proxy OpenTelemetry feature tests passed.
  • Documentation passed with warnings denied.
  • git diff --check passed.
  • Default and OpenTelemetry-feature release builds passed.
  • Dependency inspection confirmed that AI does not own an OpenTelemetry SDK or exporter.
  • Attribute projection was tested with populated and absent optional values.
  • Jaeger runtime validation remains pending integration with the separate Praxis core telemetry stack.

Checklist

  • I reviewed every changed line and can explain the change.
  • New capabilities include an example config and functional example test.
  • User-facing behavior and generated documentation are updated.
  • Performance-sensitive changes include appropriate benchmark or load-test evidence.
  • Commits are signed and include a Signed-off-by trailer.

Breaking changes

None. The feature is disabled by default. Existing configurations, default builds, routing behavior, and deployments remain unchanged. Enabling the feature before Praxis core export support is available is also safe: AI emits ordinary structured tracing spans, but no OpenTelemetry backend export is performed unless core provides and configures that capability.

Add feature-gated routing.select spans for successful intelligent_route decisions while leaving request lifecycle, propagation, sampling, and export ownership in Praxis core.

Keep the default build unchanged and avoid OpenTelemetry SDK dependencies in the AI filters. Record only validated, bounded routing attributes and document the ownership and privacy boundaries.

Signed-off-by: Brent Salisbury <bsalisbu@redhat.com>
@nerdalert
nerdalert requested review from a team and franciscojavierarceo August 13, 2026 03:44
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