Skip to content

fix: //orchestrion:ignore is not respected for Echo handlers - #788

Open
Trighap52 wants to merge 1 commit into
DataDog:mainfrom
Trighap52:fix-709-echo-ignore
Open

fix: //orchestrion:ignore is not respected for Echo handlers#788
Trighap52 wants to merge 1 commit into
DataDog:mainfrom
Trighap52:fix-709-echo-ignore

Conversation

@Trighap52

Copy link
Copy Markdown

Why is this change being made?

//orchestrion:ignore was not effective for Echo routes because tracing was injected at router level (echo.New -> e.Use(echotrace.Middleware())), so ignored handlers were still traced.

This caused high-volume endpoints (for example readiness/liveness probes) to emit traces even when explicitly marked with //orchestrion:ignore.

What is the change?

  • Added a built-in aspect that rewrites echo.New() to runtime/echoignore.New().
  • Added runtime/echoignore helper package:
    • creates Echo router
    • installs echotrace.Middleware with WithIgnoreRequest(...)
    • skips tracing when matched route handler is registered as ignored
  • Added injector pre-pass to register ignored Echo handlers by injecting:
    • var _ = echoignore.RegisterIgnoredEchoHandlerFunc(...)
  • Added runtime tests for ignore handler registration and request-ignore matching.
  • Added a samples regression case for ignored Echo handlers and updated snapshots.

How was this tested?

  • go test ./runtime/echoignore
  • go test ./internal/injector/...
  • cd samples && go test -run TestSamples .

Fixes: #709

@Trighap52
Trighap52 requested a review from a team as a code owner February 13, 2026 16:49
@RomainMuller

Copy link
Copy Markdown
Contributor

Hey @Trighap52 the actual aspect that is used in live applications is in github.com/DataDog/dd-trace-go, what is in this repository is just an example for integrators.

@Trighap52

Copy link
Copy Markdown
Author

Hi @RomainMuller Thanks, that makes sense. To make sure I move this in the right direction: should the fix live entirely in dd-trace-go’s Echo integration, or would you expect Orchestrion core to expose some generic mechanism for integrations to observe //orchestrion:ignore declarations?
My current understanding is that Echo-specific runtime behavior should move out of orchestrion, but I’m not sure whether the “register ignored handler” part should become a generic Orchestrion hook or be implemented fully inside the dd-trace-go aspect/runtime package.

Copy link
Copy Markdown
Contributor

IMHO you'd want to do this fully in the dd-trace-go side… I don't think there would be a clean way to signal arbitrary registrations from "usage-agnostic" orchestrion to "usage-specific" tracer integrations. So in this case we'd probably want to introduce a dd-trace-go specific pragma/directive that would be used in this way…

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] //orchestrion:ignore directive not respected for Echo router handlers

2 participants