-
Notifications
You must be signed in to change notification settings - Fork 773
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Capture custom request/response properties #73
Comments
I've just come up against this in my usage of wanting to add many activity specific tags (e.g. head tags for http in activities, and redis key tags for redis activities). The hook solution (2) seems to best cover this use case in an easy to understand way for all instrumentation libraries, and allows for a common setup for all activities for a particular source. Actually thinking about this a bit more, what I really wish for (and I realize this might be specific to me) are two hooks one on activity start and the other on activity end, similar to the ActivityProcessors. That way I can capture whatever extra information from the end of a call. |
Hi, is option (2) feature available yet? |
@redondoxx The ability on enhance span using request/response is available now. Its achieved differently than this issue describes. I'll be posting a doc with example usage today. |
@cijothomas thank for your response, it will be very nice if we have some docs about this 👍 . |
@redondoxx Please take a look at this: #1193 |
thank i will give it a try soon :) |
closing as this feature is done. Docs are being working now. |
@cijothomas I think I found an issue with this, I opened a bug ticket here #1208 |
* Use complete project name for test step * replacing project names with env var
* WCF instrumentation + example apps. * Added an event source to log errors in Wcf instrumentation. * Added content to the WCF instrumentation's README. * Added support for the .NET Core version of WCF clients. * Code review feedback. * Updated code for 1.0 and changes done in main. * Lint errors. * Server tests and cleanup. * Added client tests. * Fixed some weirdness with SuppressDownstreamInstrumentation. * Bug fixes. * Attempting to fix lint errors. * Code review and clean up. * Added "wcf-" MinVerTagPrefix in csproj. * Fun with copy-paste. * Removed OpenTelemetry.Instrumentation.Http from wcf client examples. * Updated link paths. * Code review. * Added wcf examples readme. * Code review. * Typo. * Markdown lint. * Code review. * Code review. * Code review. * Code review. * Add support for To & Via properties. * Code review. * Code review. * Example readme update. * Mirror fix from PR open-telemetry#73. * Nits. * Hashtable for cache. * Code review.
Original: census-instrumentation/opencensus-csharp#130
The scenario:
Azure APIs return server request is in HTTP response headers and we want to put it on the span created to trace this http call.
We may argue the validity of this scenario and this might change in the future with W3C adoption, current support processes rely on this.
Also, this scenario of enhancing telemetry based on arbitrary request properties is popular among ApplicationInsights users.
While HttpClient instrumentation with DiagnosticSource allows it easily (you have the whole response object), Http listener in opencensus does not capture anything custom and does not provide extensibility points.
We have several options here
Keep it as is. Ask users/library owners to implement Http listeners on their own which just enhance current span. This approach requires deep knowledge of DiagnosticSource, error-prone and extremely inefficient. It also requires special configurations done by users.
This is a viable workaround for now.
Provide hooks through
DependenciesCollectorOptions
likeAny of above requires someone to reimplement the whole HTTP instrumentation to do something as simple as reading one custom header. And custom instrumentations would be error prone and likely would not produce high-quality data.
So I believe
(1) is workaround
(2) is a possible solution, but we might want to spend time designing better API
The text was updated successfully, but these errors were encountered: