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

0.35.0 trace autologging provides incorrect trace IDs #4552

Closed
hedss opened this issue Jul 21, 2023 · 1 comment · Fixed by #4578
Closed

0.35.0 trace autologging provides incorrect trace IDs #4552

hedss opened this issue Jul 21, 2023 · 1 comment · Fixed by #4578
Assignees
Labels
bug Something isn't working frozen-due-to-age Locked due to a period of inactivity. Please open new issues or PRs if more discussion is needed.

Comments

@hedss
Copy link

hedss commented Jul 21, 2023

What's wrong?

Prior to v0.35.0, autologging correctly output loglines with the trace ID that was passed to it, eg:

  | 2023-07-21 11:21:24.493 | span=requester dur=12181760ns status=STATUS_CODE_OK http.method=GET http.target=unicorn svc=mythical-requester traceId=be8481dd93f1c751bd1ee320e5629197
-- | -- | --

From 0.35.0, the trace ID is now converted into what appears to be a decimal only identifer (that is not convertable to a working HEX trace ID hash):

2023-07-21 11:25:47.392 | span=requester dur=27946240ns status=Ok http.method=GET http.target=beholder svc=mythical-requester traceId=3661626132633865396432653963323538376566646565303064373233613266
-- | --

This means that correlation between traces that generate autologged log lines is not longer possible and breaks the general log->traces workflow.

Steps to reproduce

Install Agent v0.35.0 into any ecosystem and then configure it to receive traces and autogenerate logs from traces.

You can easily test this out using the Intro to MLT sandbox, and changing this line to image: grafana/agent:v0.35.0, then use the docker-compose.yaml file to initialise a working system.

Go to the Explorer to see the result and inability to correlate with traces.

System information

MacOS 12.6.5 (21G531)

Software version

Grafana Agent v0.35.0

Configuration

automatic_logging:
        # Use the logs instance defined at the start of the configuration file, specifying a logs instance and the
        # named Promtail instance.
        backend: logs_instance
        logs_instance_name: loki
        # Ensure one log one line per root span (ie. one per trace).
        roots: true
        processes: false
        # Setting spans to `true` (default false) will generate a log line *per span* received. Note that this
        # can produce a huge amount of log information.
        spans: false
        # If present in the span, add the http.method, http.target and http.status_code span attributes to the log line.
        span_attributes:
          - http.method
          - http.target
          - http.status_code
        # Force the trace ID to be set as `traceId`. This ensures correlation from within Grafana between data sources.
        overrides:
          trace_id_key: "traceId"

Logs

2023-07-21 11:25:47.392 | span=requester dur=27946240ns status=Ok http.method=GET http.target=beholder svc=mythical-requester traceId=3661626132633865396432653963323538376566646565303064373233613266
-- | --
@rfratto
Copy link
Member

rfratto commented Jul 21, 2023

This is likely related to #3858 which updated the OpenTelemetry dependency. cc @ptodev

@ptodev ptodev self-assigned this Jul 24, 2023
@ptodev ptodev moved this from Todo to In Progress in Grafana Agent (Public) Jul 24, 2023
@ptodev ptodev linked a pull request Jul 25, 2023 that will close this issue
3 tasks
@github-project-automation github-project-automation bot moved this from In Progress to Done in Grafana Agent (Public) Jul 25, 2023
@github-actions github-actions bot added the frozen-due-to-age Locked due to a period of inactivity. Please open new issues or PRs if more discussion is needed. label Feb 21, 2024
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Feb 21, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something isn't working frozen-due-to-age Locked due to a period of inactivity. Please open new issues or PRs if more discussion is needed.
Projects
No open projects
Development

Successfully merging a pull request may close this issue.

3 participants