This PR adds a new endpoint like this:
curl -v http://localhost:14318/api/traces/0b0462c3-4698-ff90-dbc6-6870ced6775b/json
{
"resourceSpans":[
{
"instrumentationLibrarySpans":[
{
"spans":[
{
"traceId":"CwRiw0aY/5DbxmhwztZ3Ww==",
"spanId":"JdNs9MF0KeQ=",
"parentSpanId":"AAAAAAAAAAA=",
"name":"GET /*path",
"kind":"SPAN_KIND_SERVER",
"startTimeUnixNano":"1651733829634968350",
"endTimeUnixNano":"1651733829783441370",
"attributes":[
{
"key":"http.flavor",
"value":{
"stringValue":"1.1"
}
},
{
"key":"net.host.name",
"value":{
"stringValue":"localhost"
}
},
{
"key":"http.wrote_bytes",
"value":{
"intValue":"2680172"
}
},
{
"key":"telemetry.sdk.name",
"value":{
"stringValue":"opentelemetry"
}
},
{
"key":"http.user_agent.version",
"value":{
"stringValue":"101.0.4951.41"
}
},
{
"key":"http.route",
"value":{
"stringValue":"/*path"
}
},
{
"key":"service.name",
"value":{
"stringValue":"serve"
}
},
{
"key":"http.user_agent.name",
"value":{
"stringValue":"Chrome"
}
},
{
"key":"telemetry.sdk.language",
"value":{
"stringValue":"go"
}
},
{
"key":"http.target",
"value":{
"stringValue":"/js/chunk-vendors.76f0d740.js.map"
}
},
{
"key":"http.user_agent.os",
"value":{
"stringValue":"Linux"
}
},
{
"key":"http.route.param.path",
"value":{
"stringValue":"js/chunk-vendors.76f0d740.js.map"
}
},
{
"key":"http.user_agent",
"value":{
"stringValue":"Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/101.0.4951.41 Safari/537.36"
}
},
{
"key":"host.name",
"value":{
"stringValue":"vmihailenco"
}
},
{
"key":"net.peer.ip",
"value":{
"stringValue":"::1"
}
},
{
"key":"net.host.port",
"value":{
"intValue":"14318"
}
},
{
"key":"otel.library.version",
"value":{
"stringValue":"semver:0.31.0"
}
},
{
"key":"http.method",
"value":{
"stringValue":"GET"
}
},
{
"key":"http.host",
"value":{
"stringValue":"localhost:14318"
}
},
{
"key":"http.scheme",
"value":{
"stringValue":"http"
}
},
{
"key":"net.transport",
"value":{
"stringValue":"ip_tcp"
}
},
{
"key":"net.peer.port",
"value":{
"intValue":"46672"
}
},
{
"key":"http.user_agent.os_version",
"value":{
"stringValue":"x86_64"
}
},
{
"key":"http.client_ip",
"value":{
"stringValue":"::1"
}
},
{
* Connection #0 to host localhost left intact"key":"otel.library.name",
"value":{
"stringValue":"go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp"
}
},
{
"key":"telemetry.sdk.version",
"value":{
"stringValue":"1.6.3"
}
},
{
"key":"http.status_code",
"value":{
"intValue":"200"
}
}
],
"status":{
"code":"STATUS_CODE_OK"
}
}
]
}
]
}
]
}
@lmangani I am using the official protobuf bindings for Go from go.opentelemetry.io/proto/otlp/trace/v1 and it seems to work fine, but the example you provided also contains some fields that are not part of OTLP, for example:
"instrumentationLibrarySpans": [
{
"instrumentationLibrary": {},
"spans": [
{
"traceID": "d6e9329d67b6146b",
"spanID": "1234",
"name": "span from bash!",
"references": [],
"startTime": 1651401486889077,
"startTimeUnixNano": 1651401486889077000,
"endTimeUnixNano": 1651401486989077000,
// OTLP DOES NOT HAVE THESE FIELDS START
"duration": 100000,
"tags": [
{
"key": "http.method",
"value": "GET",
"type": "string"
},
{
"key": "http.path",
"value": "/api",
"type": "string"
}
],
"logs": [],
"processID": "p1",
"warnings": null,
"localEndpoint": {
"serviceName": "shell script"
},
// OTLP DOES NOT HAVE THESE FIELDS END
"traceId": "AAAAAAAAAADW6TKdZ7YUaw==",
"spanId": "AAAAAAAAEjQ="
}
]
}
]