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

Incorrect Express Timings #166

Closed
ngauthier opened this issue Sep 12, 2019 · 3 comments
Closed

Incorrect Express Timings #166

ngauthier opened this issue Sep 12, 2019 · 3 comments
Labels
type: bug Something isn't working

Comments

@ngauthier
Copy link

I mentioned this in #164 but it's a separate issue so splitting it out here.

The automatic express middleware finishes the trace when headers are sent:

https://github.com/honeycombio/beeline-nodejs/blob/master/lib/instrumentation/express.js#L149-L151

This means the timed duration is how long it takes the handler to send headers, not to send the entire response.

In our case, we have some streaming endpoints that send data from the database in chunks. These report a duration of a few ms, when in reality they are hundreds of ms to complete. By measuring at our router (and simply console.logging in development) it's clear that they take longer than a few ms.

An alternative implementation to bind to the finish event on the response would look like this:

  res.on("finish", function() {
    boundFinisher(this, tracker.getTracked());
  });

Was this behavior a mistake, or is it the intention to track duration as being when headers are first sent?

@toshok
Copy link
Contributor

toshok commented Mar 6, 2020

huh. mistake. two options here:

  1. increase the existing span duration to include sending the response.
  2. add another span for sending the response.

any strong preference for one over the other?

@toshok toshok added the type: bug Something isn't working label Mar 6, 2020
@ngauthier
Copy link
Author

I would prefer (1), as long as it's guaranteed to send when there are errors as well. I wouldn't want extra spans if I can help it. If I wanted more spans, I would make them in my application code for the data sending phase. Thank you!

@vreynolds
Copy link
Contributor

Hello,

We will be closing this issue as it is a low priority for us. It is unlikely that we'll ever get to it, and so we'd like to set expectations accordingly.

As we enter 2022 Q1, we are trimming our OSS backlog. This is so that we can focus better on areas that are more aligned with the OpenTelemetry-focused direction of telemetry ingest for Honeycomb.

If this issue is important to you, please feel free to ping here and we can discuss/re-open.

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

No branches or pull requests

3 participants