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

Zipkin expected a long #4056

Closed
n0cloud opened this issue Aug 11, 2023 · 1 comment · Fixed by #4064
Closed

Zipkin expected a long #4056

n0cloud opened this issue Aug 11, 2023 · 1 comment · Fixed by #4064
Labels
bug Something isn't working priority:p2 Bugs and spec inconsistencies which cause telemetry to be incomplete or incorrect

Comments

@n0cloud
Copy link
Contributor

n0cloud commented Aug 11, 2023

What happened?

When using exporter-zipkin, I'm not getting any trace in zipkin.

Steps to Reproduce

  1. Start Zipkin with --logging.level.zipkin=DEBUG --logging.level.zipkin2=DEBUG
  2. Export any trace with @opentelemetry/exporter-zipkin.

Expected Result

Trace should be accepted by Zipkin.

Actual Result

Zipkin throwing an exception when receiving the trace:

2023-08-11 16:18:00.097 DEBUG [/] 1 --- [rker-epoll-2-19] z.s.i.ZipkinHttpCollector                : Cannot decode spans due to IllegalArgumentException(Expected a long but was 51920.504 at line 1 column 151 path $[0].duration reading List<Span> from json)

Additional Details

I think rounding the duration in the exporter should fix the issue.

I'm using Zipkin version 2.24.3

OpenTelemetry Setup Code

import { ZipkinExporter } from '@opentelemetry/exporter-zipkin';
import { registerInstrumentations } from '@opentelemetry/instrumentation';
import { NestInstrumentation } from '@opentelemetry/instrumentation-nestjs-core';
import { Resource } from '@opentelemetry/resources';
import { ConsoleSpanExporter, SimpleSpanProcessor } from '@opentelemetry/sdk-trace-base';
import { NodeTracerProvider } from '@opentelemetry/sdk-trace-node';
import { SemanticResourceAttributes } from '@opentelemetry/semantic-conventions';

const provider = new NodeTracerProvider({
  resource: new Resource({
    [SemanticResourceAttributes.SERVICE_NAME]: 'myServiceName',
  }),
});

const zipkinExporter = new ZipkinExporter();

provider.addSpanProcessor(new SimpleSpanProcessor(zipkinExporter));

provider.addSpanProcessor(new SimpleSpanProcessor(new ConsoleSpanExporter()));

provider.register();

registerInstrumentations({
  instrumentations: [
    new NestInstrumentation(),
  ],
  tracerProvider: provider,
});

package.json

...
    "@opentelemetry/api": "^1.4.1",
    "@opentelemetry/auto-instrumentations-node": "^0.38.0",
    "@opentelemetry/exporter-zipkin": "^1.15.2",
    "@opentelemetry/sdk-metrics": "^1.15.2",
    "@opentelemetry/sdk-node": "^0.41.2",
...

Relevant log output

No response

@n0cloud n0cloud added bug Something isn't working triage labels Aug 11, 2023
@dyladan
Copy link
Member

dyladan commented Aug 11, 2023

@aabmass I believe this was likely caused by #4014

@dyladan dyladan added priority:p2 Bugs and spec inconsistencies which cause telemetry to be incomplete or incorrect and removed triage labels Aug 11, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working priority:p2 Bugs and spec inconsistencies which cause telemetry to be incomplete or incorrect
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants