Skip to content

[BUG] //orchestrion:ignore directive not respected for Echo router handlers #709

@karthikraobr

Description

@karthikraobr

Bug Description

The //orchestrion:ignore directive is not preventing traces from being emitted for handlers when using Echo router with orchestrion. Despite adding the ignore directive to the readiness handler, traces are still being generated.

Environment

  • Framework: Echo router
  • Deployment: Kubernetes
  • Orchestrion: latest

Handler with Ignore Directive

//orchestrion:ignore
func (h *HealthCheckHandlers) ReadinessProbe(c echo.Context) error {
    // Handler implementation
}

Generated Router Code (code from the work directory)

The orchestrion middleware is being applied at the router level:

router :=
//line <generated>:1
    func() *echo.Echo {
        e :=
//line /Users/kaarthik.raogoflink.com/workspace/go/shipping-fee-service/internal/infrastructure/handlers/http/router.go:13
            echo.New()
//line <generated>:1
        e.Use(__orchestrion_echotrace.Middleware())
        return e
    }()

Analysis

It appears that when orchestrion applies middleware at the router level (e.Use(__orchestrion_echotrace.Middleware())), it wraps all handlers regardless of individual //orchestrion:ignore directives. The middleware-level instrumentation seems to take precedence over function-level ignore directives.

Possible Solutions

  1. The orchestrion middleware should check for //orchestrion:ignore directives on individual handlers before applying tracing
  2. Provide a way to exclude specific routes/handlers from middleware-level tracing
  3. Allow more granular control over which handlers get instrumented when using router-level middleware

Additional Context

This issue is particularly relevant for health check endpoints (readiness/liveness probes) in Kubernetes environments, where high-frequency health checks can generate excessive trace data that provides little observability value.

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions