Skip to content

[tracing] Enhanced Tracing Configuration and Trace Quality #2581

Description

@AtharvaPakade

Summary

This issue proposes improvements to tracing configuration and trace quality for the Gateway API Inference Extension, building upon the discussion in PR #2518 and issue #2327. The focus is on making tracing more configurable, performant, and insightful for end-to-end request tracing across all components.

Background

The project currently uses environment variables for tracing configuration through the InitTracing function in pkg/common/observability/tracing/telemetry.go . EPP/BBR already implements tracing with a root span named "gateway.request" , and BBR is moving toward pluggable architecture that would benefit from enhanced tracing.

Proposed Improvements

1. Service-Level Configuration Structure

Problem: Current configuration relies on environment variables, which is less user-friendly and harder to validate.

Solution: Create a dedicated configuration struct for tracing settings that can be:

  • Passed through the application stack
  • Validated at startup
  • Easily extended with new options
  • Integrated with existing Helm configuration

2. Conditional Tracing in ExtProc Server

Problem: As we add richer tracing (events, sub-spans), the overhead may become significant for high-throughput scenarios.

Solution: Pass tracing configuration to the extproc server to:

  • Conditionally enable/disable tracing at runtime
  • Allow per-request tracing decisions based on sampling or headers
  • Reduce overhead when detailed tracing isn't needed

Open Questions:

  • Does the conditional check itself introduce overhead that offsets the benefits?
  • What is the acceptable overhead threshold for production workloads?

3. End-to-End Trace Context Propagation

Problem: No unified view of request latency across all components in the request path.

Solution: Implement W3C trace context propagation across:

Client → Gateway → BBR → Gateway → EPP → Model

This would enable:

  • Component-level latency analysis
  • Bottleneck identification
  • Request correlation across services
  • Performance optimization insights

4. Richer Plugin-Scoped Sub-spans

Problem: Current tracing doesn't provide detailed insights into plugin execution.

Solution: Automatically create sub-spans for :

  • Each BBR plugin execution
  • Each EPP scheduling plugin
  • Plugin configuration attributes (maybe having a plugin level conf)
  • Plugin-specific metrics and events

Open Questions:

  • Is the overhead of automatic sub-spans worth the observability benefit?
  • Should we provide root spans to plugins by default and let plugins decide on sub-span creation, rather than enforcing out-of-box instrumentation?

Discussion & Feedback Needed

looking for community discussion on:

  1. Whether to proceed: Should we implement all four improvements together, or prioritize specific areas? Are there points that don't align with the project's direction?

  2. Feedback on value: Do these improvements address real pain points? Is the observability benefit worth the added complexity?

  3. Specific considerations while building:

    • Acceptable overhead threshold for conditional tracing checks
    • Plugin instrumentation philosophy (automatic vs. opt-in)
    • Shared vs. separate tracing configs for BBR and EPP
    • Backward compatibility strategy for environment variables
    • Should end-to-end propagation be separate or bundled?
  4. General suggestions:

    • Alternative approaches to reduce tracing overhead
    • Lessons learned from similar pluggable observability systems
    • Any architectural concerns we should consider

cc @nirrozenbaum @sallyom @JeffLuoo - please share your thoughts on the proposed improvements and open questions above. Feel free to tag anyone else who can add valuable insights to this discussion.

Metadata

Metadata

Assignees

No one assigned

    Labels

    lifecycle/staleDenotes an issue or PR has remained open with no activity and has become stale.needs-triageIndicates an issue or PR lacks a `triage/foo` label and requires one.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions