-
Notifications
You must be signed in to change notification settings - Fork 30
Description
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
- The orchestrion middleware should check for
//orchestrion:ignoredirectives on individual handlers before applying tracing - Provide a way to exclude specific routes/handlers from middleware-level tracing
- 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.