Skip to content

feat(gateway): identify gateways in exported traces - #2647

Open
krishicks wants to merge 2 commits into
mainfrom
hicks/push-vmvlusspsklu
Open

feat(gateway): identify gateways in exported traces#2647
krishicks wants to merge 2 commits into
mainfrom
hicks/push-vmvlusspsklu

Conversation

@krishicks

Copy link
Copy Markdown
Collaborator

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-commit passes
  • Unit tests added/updated
  • E2E tests added/updated (if applicable)

Checklist

  • Follows Conventional Commits
  • Commits are signed off (DCO)
  • Architecture docs updated (if applicable)

@krishicks
krishicks force-pushed the hicks/push-vmvlusspsklu branch from 9d1a276 to e26d157 Compare August 6, 2026 21:27
@github-actions

github-actions Bot commented Aug 6, 2026

Copy link
Copy Markdown

@krishicks
krishicks force-pushed the hicks/push-vmvlusspsklu branch from e26d157 to 769e26d Compare August 7, 2026 15:10
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>
@krishicks
krishicks force-pushed the hicks/push-vmvlusspsklu branch from 769e26d to f870a4f Compare August 10, 2026 14:45
.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),

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.

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 drew left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 new openshell.gateway.compute_driver resource 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),

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

@drew drew added the gator:in-review Gator is reviewing or awaiting PR review feedback label Aug 11, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

gator:in-review Gator is reviewing or awaiting PR review feedback

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants