Skip to content
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

JaegerExporter sets error flag when span status is Unset #1757

Closed
debagger opened this issue Dec 17, 2020 · 1 comment
Closed

JaegerExporter sets error flag when span status is Unset #1757

debagger opened this issue Dec 17, 2020 · 1 comment
Labels
bug Something isn't working

Comments

@debagger
Copy link
Contributor

Please answer these questions before submitting a bug report.

What version of OpenTelemetry are you using?

"@opentelemetry/core": "^0.13.0",
"@opentelemetry/exporter-jaeger": "^0.13.0",
"@opentelemetry/node": "^0.13.0",
"@opentelemetry/plugin-dns": "^0.11.0",
"@opentelemetry/plugin-express": "^0.11.0",
"@opentelemetry/plugin-http": "^0.13.0",
"@opentelemetry/plugin-https": "^0.13.0",
"@opentelemetry/plugin-pg": "^0.11.0",
"@opentelemetry/plugin-pg-pool": "^0.11.0",
"@opentelemetry/tracing": "^0.13.0"

What version of Node are you using?

v15.4.0

Please provide the code you used to setup the OpenTelemetry SDK

import { LogLevel } from '@opentelemetry/core';
import { NodeTracerProvider } from '@opentelemetry/node';

import { SimpleSpanProcessor, BatchSpanProcessor } from '@opentelemetry/tracing';
// import { ZipkinExporter } from '@opentelemetry/exporter-zipkin';
// For Jaeger, use the following line instead:
import { JaegerExporter } from '@opentelemetry/exporter-jaeger';
export function initTracing() {
  const provider: NodeTracerProvider = new NodeTracerProvider({
    logLevel: LogLevel.INFO,
    plugins: {
      express: {
        enabled: true,
        // You may use a package name or absolute path to the file.
        path: '@opentelemetry/plugin-express',
      },
    },
  });

  provider.register();

  provider.addSpanProcessor(
    new BatchSpanProcessor(
    //   new ZipkinExporter({
        // For Jaeger, use the following line instead:
        new JaegerExporter({
        host: 'jaeger',
        port: 6832,
        serviceName: 'backstage',
        // If you are running your tracing backend on another host,
        // you can point to it using the `url` parameter of the
        // exporter config.
      }),
    ),
  );

  console.log('tracing initialized');
}

What did you do?

Send spans from express to jaeger

What did you expect to see?

Because of this ops finished successfully error tag must be false.

What did you see instead?

Get tag 'error' is true in Jaeger from @opentelemetry/plugin-express spans:
Jaeger_bug

Additional context

I think the bug is here:

// Ensure that if Status.Code is not OK, that we set the "error" tag on the

If status code is UNSET its set error flag. But from api spec UNSET is normal.

When the status is set to ERROR by Instrumentation Libraries, the status codes SHOULD be documented and predictable. The status code should only be set to ERROR according to the rules defined within the semantic conventions. For operations not covered by the semantic conventions, Instrumentation Libraries SHOULD publish their own conventions, including status codes.

Generally, Instrumentation Libraries SHOULD NOT set the status code to Ok, unless explicitly configured to do so. Instrumention libraries SHOULD leave the status code as Unset unless there is an error, as described above.

Application developers and Operators may set the status code to Ok.

https://github.com/open-telemetry/opentelemetry-specification/blob/master/specification/trace/api.md

@debagger debagger added the bug Something isn't working label Dec 17, 2020
debagger added a commit to debagger/opentelemetry-js that referenced this issue Dec 17, 2020
obecny added a commit to debagger/opentelemetry-js that referenced this issue Dec 17, 2020
dyladan pushed a commit that referenced this issue Dec 17, 2020
Co-authored-by: Bartlomiej Obecny <bobecny@gmail.com>
@debagger
Copy link
Contributor Author

Issue fixed in v0.14.0 Release

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant