-
Notifications
You must be signed in to change notification settings - Fork 792
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: new span StatusCode is being exported to collector with wrong value in v0.13.0 #1736
Labels
bug
Something isn't working
Comments
Example of the bug in exporter/[email protected]: "use strict";
const opentelemetry = 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');
const exporter = new CollectorTraceExporter({
serviceName: "basic-service",
});
const provider = new BasicTracerProvider();
provider.addSpanProcessor(new SimpleSpanProcessor(exporter));
provider.register();
const tracer = opentelemetry.trace.getTracer("example-collector-exporter-node");
const parentSpan = tracer.startSpan("main");
parentSpan.end();
// give some time before it is closed
setTimeout(() => {
// flush and close the connection.
exporter.shutdown();
}, 2000); shows up in collector v0.16.0 with exporters:
logging:
loglevel: debug as:
This is because it's being exported with the wrong status code (1 == UNSET) which interpreted in the collector as {
traceId: '3bfa30d26e0988db2a40f2ff231818ce',
parentId: undefined,
name: 'main',
id: '6af40bbf384e45da',
kind: 0,
timestamp: 1607870176358482,
duration: 188,
attributes: {},
status: { code: 1 },
events: []
} 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
pichlermarc
pushed a commit
to dynatrace-oss-contrib/opentelemetry-js
that referenced
this issue
Dec 15, 2023
Co-authored-by: Trent Mick <[email protected]>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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: