Skip to content

Opentelemetry doesn't have trace link on grafana #5565

@HuakunShen

Description

@HuakunShen

What version of Effect is running?

3.17.14

What steps can reproduce the bug?

how to report logs to LGTM so that a link to trace is shown?

But when I follow the docs https://effect.website/docs/observability/tracing/

There is no Links section on grafana, and no trace_id link

What is the expected behavior?

In my other projects without effect, I can see a link to trace.
Image

What do you see instead?

Image

Additional information

I uploaded the 2 files for reproduction
https://gist.github.com/HuakunShen/60354f49c3b9c866a9bb08e8792d568a

One is effect style, one is traditional opentelemetry library.
docker run -p 3000:3000 -p 4317:4317 -p 4318:4318 --rm -it docker.io/grafana/otel-lgtm

Run lgtm with docker first
I ran them with bun, with the traditional code, I could see the Trace button, but with effect code, I don't see the button

I inspected the http traffic for both scripts. For the same log message,
traditional on the left, effect style on the right.
The effect style log is missing "traceId" in the log record root level. traceId is only in the attributes.

Image

I guess, the attributes are rendered as fields in grafana lgtm, while the other traceId is responsible for linking to an actual trace.

Image

effect code doesn't provide the "Links" section

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions