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

Add OTLP log endpoint to convert log events to span annotations #21

Open
codefromthecrypt opened this issue Nov 15, 2024 · 3 comments · May be fixed by #26
Open

Add OTLP log endpoint to convert log events to span annotations #21

codefromthecrypt opened this issue Nov 15, 2024 · 3 comments · May be fixed by #26
Assignees
Labels
enhancement New feature or request

Comments

@codefromthecrypt
Copy link
Contributor

Feature

This would add a configurable log listener, which would convert log events to span annotations. It could make some heuristic decisions to say tell the difference between a normal log record and a log event. Also, it could make a decision on if it drops the bodies, or attaches them to the span as tag values.

This should be an option, not always on, as certainly some will be fine to use the existing approach of storing logs in ElasticSearch and using UI properties to link to a query.

Rationale

This helps as currently span events are migrating to log events, which dramatically impacts navigation in zipkin. For example, you would need to setup log correlation and jump screens to get to them, vs now when annotations are in the same UI.

Technically, the out-of-order concern isn't a problem in zipkin as out-of-order data has been a norm since day one. Specifically the problem of span annotations sent before or after the span isn't an issue.

Example Scenario

Notably, this is just now happening with OpenAI which moved from span events to log events.

open-telemetry/opentelemetry-python-contrib#3006

Prior Art

None so far as there's no work on something like this to my knowledge.

@codefromthecrypt codefromthecrypt added the enhancement New feature or request label Nov 15, 2024
@making
Copy link
Collaborator

making commented Dec 20, 2024

@codefromthecrypt It this UI something you are expecting?

image

the trace data is 4d5f222a01f81091be15d76e2af0c528.json.

@codefromthecrypt
Copy link
Contributor Author

@making yeah. there are some choices we could make with regards to truncation, or dropping the large event payload (e.g. replace it with event.name), but this is the start indeed and for beginners it is much better than dropping the log events entirely.

Another note is that while python is using the "Event api" other languages are likely to skip that and just write logs directly. For example, this one does that https://github.com/elastic/elastic-otel-node/tree/main/packages/instrumentation-openai

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

Successfully merging a pull request may close this issue.

2 participants