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

Need a way to set 'key' field in jaeger span logs #2299

Open
VivekSubr opened this issue Sep 7, 2023 · 4 comments
Open

Need a way to set 'key' field in jaeger span logs #2299

VivekSubr opened this issue Sep 7, 2023 · 4 comments
Labels
Stale triage/needs-information Indicates an issue needs more information in order to work on it.

Comments

@VivekSubr
Copy link

Is your feature request related to a problem?
In Opentracing, it was possible to set the 'key' field in span logs, since the api took an array of key value pairs:
Span->Log({ { key, value } })

However, in opentelemetry's AddEvent api, you can only set a single log string, or optionally a timestamp and tags... there doesn't seem to be a way to get equivalent behavior as opentracing.

example:
"logs": [
{
"timestamp": 1691424565488606,
"fields": [
{
"key": "event", <--- How to set this?
"type": "string", <--- Or this?
"value": "log"
}

Describe the solution you'd like
A way to set the key field in jaeger span log

Describe alternatives you've considered
Seen the AddEvent overloads in class span

@github-actions github-actions bot added the needs-triage Indicates an issue or PR lacks a `triage/foo` label and requires one. label Sep 7, 2023
@lalitb
Copy link
Member

lalitb commented Sep 8, 2023

Can't you set the key-value using attributes argument below:

  void AddEvent(nostd::string_view name,
                opentelemetry::common::SystemTimestamp timestamp,
                const opentelemetry::common::KeyValueIterable &attributes) noexcept override;

Probably I didn't understand your question, if you can elaborate more?

@marcalff marcalff added triage/needs-information Indicates an issue needs more information in order to work on it. and removed needs-triage Indicates an issue or PR lacks a `triage/foo` label and requires one. labels Sep 11, 2023
@VivekSubr
Copy link
Author

VivekSubr commented Sep 28, 2023

@lalitb - sorry for the late reply, so your saying, something like
AddEvent("event", opentelemetry::common::SystemTimestamp(), "log")

Would translate to key : value for jaeger? I'll try that and get back to you, but right off the first problem is why would a log be of type 'keyvalueiterable'?

To use this, I need to change my log string to some sort of array structure so it's constructible by KeyValueInterableView?

@lalitb
Copy link
Member

lalitb commented Nov 2, 2023

@VivekSubr It would be mapped as mentioned here -

https://github.com/open-telemetry/opentelemetry-specification/blob/v1.26.0/specification/trace/sdk_exporters/jaeger.md#events

But Jaeger exporter has been removed and you should be using OTLP exporter for this. Let us know if you have any further questions.

Copy link

github-actions bot commented Jan 2, 2024

This issue was marked as stale due to lack of activity.

@github-actions github-actions bot added the Stale label Jan 2, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Stale triage/needs-information Indicates an issue needs more information in order to work on it.
Projects
None yet
Development

No branches or pull requests

3 participants