-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
[opentelemetry source] Incorrect message
when body
is an ArrayValue
#13926
Labels
Comments
spencergilbert
changed the title
Incorrect
[opentelemetry source] Incorrect Aug 10, 2022
message
when body
is an ArrayValue
message
when body
is an ArrayValue
spencergilbert
added
type: bug
A code related bug.
source: opentelemetry
Anything `opentelemetry` source related
labels
Aug 10, 2022
Nothing conclusive, but in case it helps, I wrote a small program using pdata (the module the Collector uses) package main
import (
"encoding/json"
"fmt"
"go.opentelemetry.io/collector/pdata/pcommon"
"go.opentelemetry.io/collector/pdata/plog/plogotlp"
)
func main() {
arrayVal := pcommon.NewValueSlice()
slice := pcommon.NewSliceFromRaw([]any{"string", 42, true})
slice.CopyTo(arrayVal.SliceVal())
request := plogotlp.NewRequest()
arrayVal.CopyTo(
request.Logs().ResourceLogs().AppendEmpty().ScopeLogs().AppendEmpty().LogRecords().AppendEmpty().Body())
bytes, err := json.MarshalIndent(request, "", " ")
if err != nil {
panic(err)
}
fmt.Println(string(bytes))
} It prints {
"resourceLogs": [
{
"resource": {},
"scopeLogs": [
{
"scope": {},
"logRecords": [
{
"body": {
"arrayValue": {
"values": [
{
"stringValue": "string"
},
{
"intValue": "42"
},
{
"boolValue": true
}
]
}
},
"traceId": "",
"spanId": ""
}
]
}
]
}
]
} Reading the spec I am not sure if both camel case and snake case should be supported (spec just says 'whatever proto3 does'). There are other differences (resource, traceID, spanID), not sure if those are relevant either |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
When running the otel-col and vector locally with the following configs...
opentelemetry-collector:
vector:
Curling this input to the collector results in dropped values from the
body
, this behavior is seen both in Vector and thelogging
exporter from the otel-collector.Input:
Output:
The text was updated successfully, but these errors were encountered: