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

Express spans showing impossible duration_ms #1193

Closed
DAlperin opened this issue Sep 21, 2022 · 9 comments · Fixed by #1210
Closed

Express spans showing impossible duration_ms #1193

DAlperin opened this issue Sep 21, 2022 · 9 comments · Fixed by #1210
Assignees
Labels
bug Something isn't working pkg:instrumentation-express priority:p2 Bugs and spec inconsistencies which cause telemetry to be incomplete or incorrect

Comments

@DAlperin
Copy link

What version of OpenTelemetry are you using?

0.33.0

What version of Node are you using?

16 lts

What did you do?

Instrumented node. I use the following to set up my tracing:

import { getNodeAutoInstrumentations } from "@opentelemetry/auto-instrumentations-node";
import { OTLPTraceExporter } from "@opentelemetry/exporter-trace-otlp-proto";
import { NodeSDK } from "@opentelemetry/sdk-node";
import { PrismaInstrumentation } from "@prisma/instrumentation";

const traceExporter = new OTLPTraceExporter();

const sdk = new NodeSDK({
    traceExporter,
    instrumentations: [
        getNodeAutoInstrumentations(),
        new PrismaInstrumentation(),
    ],
});

// eslint-disable-next-line @typescript-eslint/no-floating-promises
sdk.start().then(() => {
    // eslint-disable-next-line no-console
    console.log(`✅ OTLP ready`);
});

What did you expect to see?

Reasonable tracing

What did you see instead?

Screenshot from 2022-09-21 12-45-04

@DAlperin DAlperin added the bug Something isn't working label Sep 21, 2022
@rauno56
Copy link
Member

rauno56 commented Sep 22, 2022

@prisma/instrumentation is not hosted here. Have you tried to let them know at https://github.com/prisma/prisma_

@DAlperin
Copy link
Author

The issue appears to be in express instrumentation. The issue persists even without the prisma instrumentation enabled.

@vmarchaud
Copy link
Member

Could you share the code of the middleware in question ? There can be edge cases that make it hard to track exactly when each middleware is ended

@DAlperin
Copy link
Author

Here is where I set up all my middlewares: https://github.com/DAlperin/dov.dev-remix/blob/main/server.ts

@dyladan dyladan changed the title Express spans showing insane impossible duration_ms Express spans showing impossible duration_ms Sep 27, 2022
@beeme1mr
Copy link

I also ran into the same issue. Downgrading to "@opentelemetry/auto-instrumentations-node": "^0.31.2" resolved the issue. It seems like the only noteworthy change for express was requestHook support.

@DAlperin
Copy link
Author

@beeme1mr out of curiosity what tool were you using to visualize your traces?

@beeme1mr
Copy link

I was using the latest version of Jaeger.

@Flarna
Copy link
Member

Flarna commented Sep 28, 2022

see also #1209

@dyladan
Copy link
Member

dyladan commented Sep 28, 2022

#1210

@dyladan dyladan self-assigned this Sep 28, 2022
@dyladan dyladan added the priority:p2 Bugs and spec inconsistencies which cause telemetry to be incomplete or incorrect label Sep 28, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working pkg:instrumentation-express priority:p2 Bugs and spec inconsistencies which cause telemetry to be incomplete or incorrect
Projects
None yet
6 participants