feat(gateway): identify gateways in exported traces - #2647
Conversation
9d1a276 to
e26d157
Compare
|
🌿 Preview your docs: https://nvidia-preview-pr-2647.docs.buildwithfern.com/openshell |
e26d157 to
769e26d
Compare
Add a first-class operator-assigned gateway name with TOML, CLI, environment, and Helm configuration surfaces. Local gateways default to openshell, while Helm defaults to the chart fullname; operators sharing a collector across namespaces or clusters can set a globally distinct name. Signed-off-by: Kris Hicks <khicks@nvidia.com>
Attach the configured gateway installation name and compute driver to the gateway OpenTelemetry resource so operators can filter traces from multiple installations that share a collector. Forward the gateway name and OTLP endpoint to managed external drivers so their distinct service resources carry the same installation identity. Keep service.name stable per process type, omit blank resource values, and leave per-span operation names and request attributes unchanged. Refs #2507 Signed-off-by: Kris Hicks <khicks@nvidia.com>
769e26d to
f870a4f
Compare
| .and_then(|f| f.openshell.gateway.otlp.as_ref()); | ||
| let gateway_resource = crate::otel_tracing::GatewayResourceAttributes::new( | ||
| Some(prepared.config.name.as_str()), | ||
| prepared.config.compute_drivers.first().map(String::as_str), |
There was a problem hiding this comment.
it seems prepared.config.compute_drivers is often intentionally left empty, leaving it up to openshell to choose the right driver. I'm not sure when that auto-detection hapens, and if it mutates this field, or if maybe the gateway_resource naming has to happen later?
drew
left a comment
There was a problem hiding this comment.
gator-agent
PR Review Status
Validation: Project-valid maintainer-authored observability work aligned with issue #2507.
Head SHA: f870a4f7715a92674e172fffe1dab7d5ac286541
Base SHA: f48b05e31228a25d5a34cc929bb6383cc0e8921a
Merge base SHA: f48b05e31228a25d5a34cc929bb6383cc0e8921a
Patch ID: b450d5af9c18a913016b1477d6362def1cf09f79
Gator payload: 3
Review mode: initial
Previous reviewed SHA: none
Blocking findings:
GATOR-f870a4f7-01: The newopenshell.gateway.compute_driverresource attribute is omitted for supported auto-detected drivers.
Carried findings:
- None
Non-blocking suggestions:
- None
Docs: Fern gateway configuration docs were updated, but their compute-driver reporting claim depends on resolving this finding.
Next state: gator:in-review
| .and_then(|f| f.openshell.gateway.otlp.as_ref()); | ||
| let gateway_resource = crate::otel_tracing::GatewayResourceAttributes::new( | ||
| Some(prepared.config.name.as_str()), | ||
| prepared.config.compute_drivers.first().map(String::as_str), |
There was a problem hiding this comment.
gator-agent
Warning — GATOR-f870a4f7-01
Invariant: Gateway OTLP resources must identify the actual supported compute driver, including the documented auto-detection path, rather than only an explicitly configured driver.
Prerequisite: An operator enables [openshell.gateway.otlp] and omits --drivers, OPENSHELL_DRIVERS, and compute_drivers, relying on supported Kubernetes, Podman, or Docker auto-detection.
Entry point → sink: openshell-gateway startup with OTLP enabled and no explicit driver → run_from_args builds the OTel resource here before configured_compute_driver later auto-detects the effective driver.
Base → head: Base exported no compute-driver resource attribute. Head promises and exports openshell.gateway.compute_driver, but reads only the still-empty configured vector, so an auto-detected gateway omits the attribute.
Impact: Common default/package-managed deployments emit incomplete trace identity, making the newly documented compute-driver dimension materially false for a supported startup mode.
Reproducer: Configure only [openshell.gateway.otlp] endpoint = "http://127.0.0.1:4317"; provide a Kubernetes environment or responsive Podman/Docker socket; start without any explicit driver selection; export a span and observe that openshell.gateway.compute_driver is absent. Explicitly configure the same driver and the attribute appears.
PR ownership: This PR introduces both the attribute and its public documentation, while this new line sources it before the existing auto-detection path runs.
Requested change: Populate the resource from the same effective driver resolution used by startup—either resolve the default driver before tracing installation or share/refactor the existing resolution so tracing receives the actual selected driver without duplicating divergent selection rules.
Summary
Now that we can trace gateways, we also need to identify which gateways spans are coming from, as an operator may have multiple gateways sending spans to the same collector. This adds a new configuration to the gateway,
name, which will be used solely for adding a resource attribute showing which gateway the spans came from.We might in the future choose to use this name as the default name when registering a gateway with the CLI (rather than the hostname, as at present), but that would require a mechanism for the CLI to discover it, and that's out of scope for this change.
Related Issue
Changes
Testing
mise run pre-commitpassesChecklist