Skip to content

[bug fix] Export atenet-egress traces and metrics with service.name=atenet-egress - #3417

Merged
Eitan Yarmush (EItanya) merged 1 commit into
agent-substrate:mainfrom
bochengchu:egress-service-name
Oct 31, 2026
Merged

Eitan Yarmush (EItanya) merged 1 commit into
agent-substrate:mainfrom
bochengchu:egress-service-name

Conversation

@bochengchu

@bochengchu Bo-Cheng Chu (bochengchu) commented Oct 29, 2026 •

Copy link
Copy Markdown
Collaborator

atenet-egress runs cmd/atenet router --mode=egress, which previously initialized OpenTelemetry with the hardcoded service name "atenet-router".

  • Set OTel service.name in RouterServer.Run based on --mode ("atenet-egress" for egress, "atenet-router" for ingress) and pass the meter to extproc.NewRouteDurationHistogram.
  • Remove the unused trace span in handleStatusz.
  • Include atenet-egress in ate-setup's otelOverrideDeployments so --otlp-endpoint restarts it too.
  • Update the metrics registry/docs and E2E metrics test to verify atenet-egress telemetry is exported under atenet-egress and not atenet-router.

Fixes #3308

AI use:

  • Tests pass
  • Docs updated

Comment thread cmd/atenet/internal/router/status.go Resolved
Comment thread internal/e2e/atenet_dataplane.go Resolved
Comment thread cmd/atenet/internal/router/config.go Resolved
@JeffLuoo

Copy link
Copy Markdown
Collaborator

Please rebase

@bochengchu
Bo-Cheng Chu (bochengchu) force-pushed the egress-service-name branch 3 times, most recently from 76ec734 to 87db6ff Compare October 29, 2026 20:57
Select the OTel service name from s.cfg.Mode in RouterServer.Run so that --mode=egress exports traces and metrics as atenet-egress instead of atenet-router. Also include atenet-egress in otelOverrideDeployments so --otlp-endpoint restarts it alongside the other control plane workloads.

Fixes agent-substrate#3308

Signed-off-by: Bo-Cheng Chu <[email protected]>
@bochengchu

Copy link
Copy Markdown
Collaborator Author

Bowei Du (@bowei) The OTel name is now set based on --mode.

@LiorLieberman Lior Lieberman (LiorLieberman) changed the title Export atenet-egress traces and metrics with service.name=atenet-egress [bug fix] Export atenet-egress traces and metrics with service.name=atenet-egress Oct 30, 2026
@zlammerts-svg Zheng Lammerts (zlammerts-svg) added this to the M3 milestone Oct 30, 2026

@thockin Tim Hockin (thockin) 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.

OK for followup

// below, because otelgrpc.NewClientHandler captures the global
// TracerProvider at construction time. Resolved once so the router's SDK
// sampler and Envoy's RandomSampling percent cannot drift.
serviceName := "atenet-router"

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.

We define this twice - should it just be something like cmd/atenet/internal/metrics.ServiceName ?

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.

Bo-Cheng Chu (@bochengchu) can you take this follow up?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

opened #3564 to address this

@EItanya
Eitan Yarmush (EItanya) added this pull request to the merge queue Oct 31, 2026
Merged via the queue into agent-substrate:main with commit 0f7ebfa Oct 31, 2026
7 checks passed
Dmitry Berkovich (dberkov) pushed a commit that referenced this pull request Nov 2, 2026
…tenet-egress (#3417)

`atenet-egress` runs `cmd/atenet router --mode=egress`, which previously
initialized OpenTelemetry with the hardcoded service name
`"atenet-router"`.

- Set OTel `service.name` in `RouterServer.Run` based on `--mode`
(`"atenet-egress"` for egress, `"atenet-router"` for ingress) and pass
the meter to `extproc.NewRouteDurationHistogram`.
- Remove the unused trace span in `handleStatusz`.
- Include `atenet-egress` in `ate-setup`'s `otelOverrideDeployments` so
`--otlp-endpoint` restarts it too.
- Update the metrics registry/docs and E2E metrics test to verify
`atenet-egress` telemetry is exported under `atenet-egress` and not
`atenet-router`.

Fixes #3308

<!-- e.g. "AI-assisted, I reviewed and tested it." No AI co-author
trailers. -->
AI use:

<!-- Breaking change? Describe what users must do on upgrade and ask for
the `breaking-change` label. -->

- [ ] Tests pass
- [ ] Docs updated

Signed-off-by: Bo-Cheng Chu <[email protected]>
(cherry picked from commit 0f7ebfa)
Signed-off-by: Eitan Yarmush <[email protected]>
@bochengchu
Bo-Cheng Chu (bochengchu) deleted the egress-service-name branch November 2, 2026 18:40
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.

[bug-bash] atenet-egress exports traces and metrics as service.name=atenet-router

7 participants