Add echo.Context Support for //dd:span in dd-trace-go #3333
korECM
started this conversation in
Feature Request
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Package Name
No response
Package Version(s)
No response
Describe the feature you'd like
Extend the existing
//dd:span
directive in the orchestrion component to automatically handle functions that have an echo.Context parameter.This upgrade should automatically extract the context from
echo.Context
via itsRequest()
method, similar to how*net/http.Request
is handled, so that users of the Echo framework can benefit from automatic instrumentation without having to manually add tracing logic.Is your feature request related to a problem?
Yes. Currently, when using Echo—whose handler functions accept
echo.Context
—manual tracing must be added, as the//dd:span
directive does not automatically handleecho.Context
. This creates an inconsistency in instrumentation and requires extra effort from developers when using non-standard context types.Describe alternatives you've considered
The alternative would be to keep the current behavior, where manual instrumentation is required for
echo.Context
in Echo-based applications.Additional context
The proposed change focuses on modifying the orchestrion template (specifically, a153c0d/ddtrace/tracer/orchestrion.yml, lines 69–123) to include an additional check for
echo.Context
. If found, it should extract the underlying*http.Request
context (using the Request() method) and update theecho.Context’s request
with the new context. This enhancement would allow for seamless integration with Echo framework applications and maintain backward compatibility with existing functionality.However, I do not believe that this approach is scalable. If you are considering extending the support of //dd:span to a broader range of function signatures, I would appreciate it if alternative methods could be discussed.
Beta Was this translation helpful? Give feedback.
All reactions