-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
[BUG] OTLP arrays are converted to strings #28598
Comments
Thanks for reporting this. I instrumented a basic Golang application with both an otlp http logger and an otlp grpc logger and sent the same log, with attributes However, the specific log exporter I am using uses protobuf to transmit both gRPC and HTTP logs, so I think it's more related to JSON format than gRPC/HTTP. |
Yes the bug happens when the service exports using OTLP protobuf over gRPC (I did not try HTTP). The service is sending the array in the protobuf but the Datadog web UI shows it as a string so it's being converted to a string at some point after the agent receives the protobuf, but I don't know exactly where. The JSON lines over TCP example I gave is what I was expecting it to do, where it is preserved as an array with separate child items in the Datadog UI instead of being converted to a string. We're trying to migrate from using JSON over TCP to OTLP over gRPC. |
I noticed you linked the sending custom logs to Agent via TCP documentation; so you aren't sending them currently to the OTLP endpoint in Agent, just directly to the custom logs endpoint in Agent? |
We are currently using custom logs with JSON over TCP, and trying to migrate to OpenTelemetry using OTLP over gRPC. This bug report is only for OTLP in the Datadog agent. I only provided the JSON/TCP example to demonstrate the expected behaviour, but there is no bug with custom logs, the bug is only when OTLP is used. The bug with OTLP is currently blocking us from migrating to OpenTelemetry because it is breaking the data that we are sending to Datadog. |
Thank you. I understand. I've opened an internal ticket to investigate and fix this behavior. It might still be helpful if you can provide more details on the config.yaml you are using for the custom logs, as well as the command you are using to transmit this log via TCP to the agent? I am having trouble reproducing it the same way that it shows on your end in the custom log pipeline; it shows up as the "message" as opposed to the attributes. If I can reproduce the way you are currently doing it via custom logs, it may provide insight on how I can fix the issue with the OTLP intake pipeline. |
- type: tcp
port: 10518
service: test
source: custom Then you just send utf-8 encoded JSON with a If it appears as the message it generally means the JSON is invalid and could not be parsed by Datadog. |
thanks, was just missing the line break. I'll let you know when I have any updates or further questions |
just wanted to let you know I've got a fix pending, waiting on a tweak to our backend api to get released so that I can push this change. |
Agent Environment
docker image
datadog/agent:7.55.3
withDD_LOGS_ENABLED=true
andDD_OTLP_CONFIG_LOGS_ENABLED=true
Describe what happened:
Sending arrays to the Datadog agent with OTLP over gRPC causes the array to be displayed as a string in the Datadog UI, and the individual items are not indexed.
If the log is exported from the Datadog UI, it contains
"arr": "[\"ab\",\"cd\"]"
Describe what you expected:
I expected these to be preserved as an array instead of flattened to a string, as it is with JSON over TCP
Sending arrays to the Datadog agent on the JSON lines over TCP format causes arrays to be correctly displayed in the Datadog UI.
This is just the following JSON sent over TCP to the agent with a line break afterwards.
This allows filtering on queries like
@arr:ab
Steps to reproduce the issue:
This is a C# example but it's just using the protobuf generated from https://github.com/open-telemetry/opentelemetry-proto/blob/main/opentelemetry/proto/collector/logs/v1/logs_service.proto
The same thing happens with https://github.com/open-telemetry/opentelemetry-dotnet but I just wanted to rule that library out and do it directly.
This should repro in any language as long as it sends an array over OTLP (only tested with gRPC).
The text was updated successfully, but these errors were encountered: