I am working on setting up tracing with the c++ opentelemetry library (https://github.com/open-telemetry/opentelemetry-cpp). I manage to export traces into New Relic using the opentelemetry http exporter (as opposed to the grpc one). It mostly behaves as I would expect: all the spans in a trace share a traceId, the root span has no parentId, and the child spans have a parentId. However, the value of the parentId is not correct. By placing breakpoints, I have determined that the following json in the http request:
{“resource_spans”:
[{
“instrumentation_library_spans”:[{
“instrumentation_library”:{“name”:“foo_library”,“version”:“1.4.0”},
“spans”:[{
“attributes”:[
{“key”:“custom_attribute”,“value”:{“string_value”:“custom value”}},
{“key”:“parentId”,“value”:{“string_value”:“674695c1786e492f”}},
{“key”:“parent.id”,“value”: {“string_value”:“674695c1786e492f”}}],
“end_time_unix_nano”:“1653473808383162400”,
“kind”:1,
“name”:“f2”,
“parent_span_id”:“674695c1786e492f”,
“span_id”:“deec627e46294f43”,
“start_time_unix_nano”:“1653473785526072300”,
“trace_id”:“ebad050d74667129d3036d695577cab6”}]}],
“resource”:{
“attributes”:[
{“key”:“entity.name”,“value”:{“string_value”:“anton-test”}},
{“key”:“telemetry.sdk.name”,“value”: {“string_value”:“opentelemetry”}},
{“key”:“service.name”,“value”:{“string_value”:“anton-test”}},
{“key”:“telemetry.sdk.language”,“value”:{“string_value”:“cpp”}},
{“key”:“telemetry.sdk.version”,“value”:{“string_value”:“1.4.0”}}
]
}
}
]
}
However, what shows up in the New Relic dashboard is the following
Note that I have specifically added the parentId and parent.id attributes to the json in an effort to remedy the issue, and while this fixed the problem for parentId, it did not for parent.id. The opentelemetry specification seems to mention that parent.id should be set from parent_span_id in the json, but this is evidently not what happens here. Is this an issue on the new relic side, or on my side?