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

ioredis: connect instrumentation does not report correct duration and does not report failure #289

Open
blumamir opened this issue Dec 21, 2020 · 3 comments
Assignees
Labels
bug Something isn't working never-stale priority:p2 Bugs and spec inconsistencies which cause telemetry to be incomplete or incorrect

Comments

@blumamir
Copy link
Member

What version of OpenTelemetry are you using?

v0.13.0

What version of Node are you using?

12

What did you do?

If possible, provide a recipe for reproducing the error.
While there is no redis server on localhost, I run the following code:

const Redis = require("ioredis");
const redis = new Redis();

What did you expect to see?

Expected to see spans of connect with an error indication (as the connect failed), and expected the duration to contain the full length of the operation.

What did you see instead?

Spans are reported with CanonicalCode.OK (StatusCode.UNSET in master), and the duration only tracks the connect function call, and not including the time until the callback is called.

@blumamir blumamir added the bug Something isn't working label Dec 21, 2020
@obecny
Copy link
Member

obecny commented Dec 21, 2020

current version of ioredis plugin is 0.11 it is not compatible with core version > 0.12 - the same as any other plugins. Contrib repo needs to be released first, there is an opened PR for new release I created last week which needs approves first.

@blumamir
Copy link
Member Author

current version of ioredis plugin is 0.11 it is not compatible with core version > 0.12 - the same as any other plugins. Contrib repo needs to be released first, there is an opened PR for new release I created last week which needs approves first.

This bug is not related to your changes.

Look at ioredis plugin code here:

    try {
      const client = original.apply(this, arguments); // original here is `redis.connect` and returns a promise.
      endSpan(span, null);
      return client;
    } catch (error) {
      endSpan(span, error);
      throw error;
    }

If the original callback or promise returns with error, nothing is setting the span to error in the plugin.

@github-actions
Copy link
Contributor

This issue is stale because it has been open 60 days with no activity. Remove stale label or comment or this will be closed in 14 days.

@github-actions github-actions bot added the stale label Jan 24, 2022
@dyladan dyladan added the priority:p2 Bugs and spec inconsistencies which cause telemetry to be incomplete or incorrect label Sep 21, 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 never-stale priority:p2 Bugs and spec inconsistencies which cause telemetry to be incomplete or incorrect
Projects
None yet
Development

No branches or pull requests

3 participants