Skip to content
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

Consistent trace id #5387

Closed
BrynCooke opened this issue Jun 10, 2024 · 5 comments
Closed

Consistent trace id #5387

BrynCooke opened this issue Jun 10, 2024 · 5 comments

Comments

@BrynCooke
Copy link
Contributor

BrynCooke commented Jun 10, 2024

Users are having trouble correlating their logs due to there being multiple IDs floating around, sampling affecting the presence or not of a trace_id.

The behaviour we would like:

  1. Otel Trace ID is exposable on logs. This functionality already exists.
telemetry:
  exporters:
    logging:
      stdout:
        format:
          json:
            display_trace_id: true
  1. Promote attributes from the root span to the json container as a top level attribute. This will allow users to have headers etc that have been attached to the root span be output on logs.
telemetry:
  exporters:
    logging:
      stdout:
        format:
          json:
            promote_span_attributes:
              - my.custom.attribute 
  1. TraceID generated for logs even if the request is not sampled. FIxed in: fix(telemetry): always create trace id even if the trace is not sampled #5447

  2. experimental_response_trace_id should use the same logic as in #3 to enable a consistent trace id to be returned to the client. Fixed in: fix(telemetry): always create trace id even if the trace is not sampled #5447

@Samjin
Copy link

Samjin commented Jun 17, 2024

Would this method also add custom attribute to custom events as well? For instance, when user does trace.info!(), would the log object include the custom attribute?

@abernix
Copy link
Member

abernix commented Jun 17, 2024

This issue might be fixed by @bnjjj's #5447.

Would this method also add custom attribute to custom events as well? For instance, when user does trace.info!(), would the log object include the custom attribute?

Good question! I think @bnjjj would need to answer this part.

@Samjin
Copy link

Samjin commented Jun 25, 2024

Talked to @BrynCooke that this feature would also append to custom request logs.

@BrynCooke
Copy link
Contributor Author

I'm going to close this and split out item 2 into a new ticket as we think the rest has been solved already.
#5540

@BrynCooke
Copy link
Contributor Author

The PRs that closed items 3 and 4 are linked in the description, but is also here: #5447

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants