-
Notifications
You must be signed in to change notification settings - Fork 64
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
Add zap fields and setting attribututes to trace in context #59
Comments
It depends on how general we can make it so it is useful for more than once person. Also see #60 |
We are using open telemetry with datadog, and in order to connect our logs and traces we need to provide both a trace_id and a span_id using specific field names (i.e. https://docs.datadoghq.com/tracing/connect_logs_and_traces/opentelemetry/ Having an option to add arbitrary fields on zap logs would be really beneficial to tying these all together. We can of course see the events in our traces, however would prefer leveraging the logs + trace connection within datadog directly if possible. |
we currently are following a pattern where we use
ctxzap
fromhttps://github.com/grpc-ecosystem/go-grpc-middleware/blob/v1.3.0/logging/zap/ctxzap/context.go#L24-L30
where we are able to add additional zap fields into the context logger so that when the function starts/exits, the logger middleware will be able to runInfo
and have all the additional fields added alongside the function.We want to be able to combine that functionality with what we have here with
otelzap
so that any call to a newAddFields
functions willl.l.extrafields
(?)span.SetAttributes
for those fields into the span tracerLemme know if this is something we can have otelzap support, or if im approaching this incorrectly.
The text was updated successfully, but these errors were encountered: