-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
out_opentelemetry: support metadata key properties #8475
out_opentelemetry: support metadata key properties #8475
Conversation
302aba5
to
be5f064
Compare
thanks for working on this PR @nokute78 some feedback:
|
@edsiper Thank you for feedback.
I think following values should be specified.
I sent a patch to store OTLP data as a So I added Or it may be better to support properties to seek a value from
I think so. I'll modify this patch. |
If I wrong please correct me. This PR is to fix #8205. It is to support forwarding OTLP. {"ObservedTimestamp":1706312272306657295, "Attributes":{"log.file.name":"a.log"}, "TraceFlags":0, "Resource":{"host.name":"taka-VirtualBox", "os.type":"linux"}, "InstrumentationScope":{"Name":"test_scope", "Version":"1"}} #8491 will store all above metadata as Attributes of OTLP. I tested following configuration and #8491 patch. |
be5f064
to
81dd95d
Compare
Hi @nokute78 , #8491 aims to solve only body and attributes that are set as random keys from the record. Yes, I agree that PR is not to solve everything. If we let the concept of forwarding and in_opentelemetry in the side for a moment, I think this PR should purely focus on the discovery and setting of the keys you described above that are part from the data model:
I skipped the Since the urgency is to solve let me know what do you think, thanks |
@braydonk can you approve please |
My approval won't have any effect on moving this PR forward as I'm not a maintainer and my review wasn't directly requested, but I can press the button if it helps. |
I see, i guess we need someone with the magic touch |
@edsiper @koleini @fujimotos @leonardo-albertovich Can you please approve/review so we can move this forward. |
@cb645j This patch is to get a value from There are some points to discuss.
|
@nokute78 I see what your saying now. Can we not change this to get this data from the message or support both like you suggested in one of your comments. So the user can specify either logs_trace_id_message_key or logs_trace_id_metadata_key, then based on that the out_otel will get the trace id either from metadata or message depending on which key property you have set....... Im not sure how you even set the metadata.... All my log events have a blank metadata but im NOT using the in_otel, im using tail to read logs from a file... So my log events look like this [55] appTag: [[1710185880.635000000, {}], {"timestamp"=>"2024-03-11 14:38:00.635", "loglevel"=>"INFO", "trace_id"=>"95e1d11ece6460e7d00c61d45cc195ff", "span_id"=>"11aafe22712ca02c", "message"=>"Hello world app is up and running"}] |
Signed-off-by: Takahiro Yamashita <[email protected]>
Signed-off-by: Takahiro Yamashita <[email protected]>
Signed-off-by: Takahiro Yamashita <[email protected]>
7660e3f
to
d34be86
Compare
@cb645j Thank you for information. It may be better to support properties for MESSAGE like |
@nokute78 @edsiper I tested this and the trace id and span id fields do not work as strings. The other fields work but trace id and span id dont. It looks like @nokute78 test above did not cover testing these fields. In his metadat example test above he left these out. This is what he had. Metadata {"ObservedTimestamp":1234, "Timestamp":3456, "SeverityText":"WARN", "SeverityNumber":5, "TraceFlags":13, "Attributes":{"log.file.name":"a.log"} If you add in TraceId and SpanId to his example above, those fields dont get set still. You can test with this and see. Metadata {"ObservedTimestamp":1234, "Timestamp":3456, "TraceId": "95e1d11ece6460e7d00c61d45cc195ff", "SeverityText":"WARN", "SeverityNumber":5, "TraceFlags":13, "Attributes":{"log.file.name":"a.log"} So you have merged code that does not fully work |
@cb645j The type of TraceId and SpanId are byte sequence. https://opentelemetry.io/docs/specs/otel/logs/data-model/#field-traceid |
@nokute78 thanks, yes i figured that out. For when getting from message of log event, since the traceid and spanid are strings in this case, i had to convert to byte arrays. Please see my PR and make any suggestions or comments. i was able to get it working for the 4 fields i added (span-id, trace-id, sev text, and sev number). |
This patch is to support several metadata key properties to get a OTLP values from metadata.
See also #8294 and #8205
Enter
[N/A]
in the box, if an item is not applicable to your change.Testing
Before we can approve your change; please submit the following in a comment:
If this is a change to packaging of containers or native binaries then please confirm it works for all targets.
ok-package-test
label to test for all targets (requires maintainer to do).Documentation
Backporting
Configuration
Config for otelcol-contrib:
Debug/Valgrind output
Output of otelcol-contrib:
Fluent Bit is licensed under Apache 2.0, by submitting this pull request I understand that this code will be released under the terms of that license.