You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I might be missing something, but in v0.13.0, CanonicalCode changed to StatusCodein this PR, but in collector exporter the new enum is assigned to the proto status field without any proper format transformation here.
We are copying an enum looking like this:
Which is also not aligned with the new format (OK is 0 in JS and 1 in proto, and UNSET is 1 in JS and 0 on proto).
I believe this field needs to be transformed with a function toCollectorStatus similar to the other fields in the proto, and be set to the proper, new field in the protobuf ( StatusCode code = 3 instead of DeprecatedStatusCode deprecated_code = 1 [deprecated=true])
In additional, I'm not sure about compatibility to old collectors and to plugins dependent on old versions of the @opentelemetry/api but exporting with @opentelemetry/[email protected] (all the plugins in the contrib repo, for example)
The text was updated successfully, but these errors were encountered:
"use strict";constopentelemetry=require("@opentelemetry/api");const{
BasicTracerProvider,
ConsoleSpanExporter,
SimpleSpanProcessor,}=require("@opentelemetry/tracing");// const { CollectorTraceExporter } = require("@opentelemetry/exporter-collector");const{
CollectorTraceExporter,}=require("@opentelemetry/exporter-collector-grpc");// const { CollectorTraceExporter } = require('@opentelemetry/exporter-collector-proto');constexporter=newCollectorTraceExporter({serviceName: "basic-service",});constprovider=newBasicTracerProvider();provider.addSpanProcessor(newSimpleSpanProcessor(exporter));provider.register();consttracer=opentelemetry.trace.getTracer("example-collector-exporter-node");constparentSpan=tracer.startSpan("main");parentSpan.end();// give some time before it is closedsetTimeout(()=>{// flush and close the connection.exporter.shutdown();},2000);
shows up in collector v0.16.0 with
exporters:
logging:
loglevel: debug
as:
Span #0
Trace ID : 3bfa30d26e0988db2a40f2ff231818ce
Parent ID :
ID : 6af40bbf384e45da
Name : main
Kind : SPAN_KIND_INTERNAL
Start time : 2020-12-13 16:36:16.358481664 +0200 IST
End time : 2020-12-13 16:36:16.358669568 +0200 IST
Status code : STATUS_CODE_ERROR <== <== <== <== <== <== <== <== <== <== <==
Status message :
This is because it's being exported with the wrong status code (1 == UNSET) which interpreted in the collector as STATUS_CODE_CANCELLED as explained above:
This is a new bug introduced in v0.13.0 of the opentelemetry-js.
blumamir
changed the title
New StatusCode and exporter collector
Bug: new span StatusCode is being exported to collector with wrong value in v0.13.0
Dec 13, 2020
What version of OpenTelemetry are you using?
v0.13.0
I might be missing something, but in v0.13.0,
CanonicalCode
changed toStatusCode
in this PR, but in collector exporter the new enum is assigned to the proto status field without any proper format transformation here.We are copying an enum looking like this:
Into an enum looking like this:
By the way, the new field in the proto for the new status code format is:
Which is also not aligned with the new format (
OK
is 0 in JS and 1 in proto, andUNSET
is 1 in JS and 0 on proto).I believe this field needs to be transformed with a function
toCollectorStatus
similar to the other fields in the proto, and be set to the proper, new field in the protobuf (StatusCode code = 3
instead ofDeprecatedStatusCode deprecated_code = 1 [deprecated=true]
)In additional, I'm not sure about compatibility to old collectors and to plugins dependent on old versions of the
@opentelemetry/api
but exporting with@opentelemetry/[email protected]
(all the plugins in the contrib repo, for example)The text was updated successfully, but these errors were encountered: