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

docs: Add ioredis to instrumentation list #558

Merged
merged 91 commits into from
Dec 24, 2019

Conversation

naseemkullah
Copy link
Member

@naseemkullah naseemkullah commented Nov 21, 2019

Which problem is this PR solving?

Short description of the changes

  • Mostly copy pasted from opencensus ioredis plugin and opentelemetry redis plugin.

@dyladan
Copy link
Member

dyladan commented Nov 21, 2019

@naseemkullah I will take a look at this. Typically that particular failure is a sign that the span is not properly created. Often it is because it is not yet ended.

@naseemkullah
Copy link
Member Author

Much appreciated @dyladan

@naseemkullah
Copy link
Member Author

I'm going to take this to Gitter probably, but does one run npm run docs-test locally? I installed yarn and lerna but still get

% npm run docs-test
internal/modules/cjs/loader.js:797
    throw err;
    ^

Error: Cannot find module '../lib/utils/unsupported.js'
Require stack:
- /usr/local/lib/node_modules/npm/bin/npm-cli.js

@dyladan
Copy link
Member

dyladan commented Nov 21, 2019

@naseemkullah no docs-test is typically only run in CI. It just makes sure there are no broken links before it is published. That said, they should be able to run locally so I'll take a look.

@naseemkullah
Copy link
Member Author

naseemkullah commented Nov 21, 2019

@dyladan
Copy link
Member

dyladan commented Nov 21, 2019

@naseemkullah please try to avoid changing history on branches you've already pushed. it makes tracking changes harder

@naseemkullah
Copy link
Member Author

My apologies @dyladan

@naseemkullah
Copy link
Member Author

@naseemkullah no docs-test is typically only run in CI. It just makes sure there are no broken links before it is published. That said, they should be able to run locally so I'll take a look.

Pleas disregard this. My mistake, it works locally.

@codecov-io
Copy link

codecov-io commented Nov 22, 2019

Codecov Report

Merging #558 into master will decrease coverage by <.01%.
The diff coverage is 94.1%.

@@            Coverage Diff             @@
##           master     #558      +/-   ##
==========================================
- Coverage   91.38%   91.37%   -0.01%     
==========================================
  Files         190      192       +2     
  Lines        9655     9905     +250     
  Branches      879      892      +13     
==========================================
+ Hits         8823     9051     +228     
- Misses        832      854      +22
Impacted Files Coverage Δ
packages/opentelemetry-plugin-ioredis/src/enums.ts 100% <100%> (ø)
...ckages/opentelemetry-plugin-ioredis/src/ioredis.ts 100% <100%> (ø)
packages/opentelemetry-plugin-ioredis/src/utils.ts 84.21% <84.21%> (ø)
.../opentelemetry-plugin-ioredis/test/ioredis.test.ts 94.63% <94.63%> (ø)
...kages/opentelemetry-plugin-dns/test/utils/utils.ts 33.33% <0%> (-26.67%) ⬇️
...ages/opentelemetry-plugin-http/test/utils/utils.ts 33.33% <0%> (-26.67%) ⬇️
...ges/opentelemetry-tracing/src/NoopSpanProcessor.ts 66.66% <0%> (-8.34%) ⬇️
...entelemetry-exporter-jaeger/test/transform.test.ts 100% <0%> (ø) ⬆️
...opentelemetry-base/test/resources/resource.test.ts 100% <0%> (ø) ⬆️
packages/opentelemetry-tracing/src/config.ts 100% <0%> (ø) ⬆️
... and 21 more

@mayurkale22
Copy link
Member

/cc @vmarchaud (who wrote the original module), it would be awesome if you can review this.

@mayurkale22
Copy link
Member

I think this is probably good to go. Tracing connections is not all that important and pub/sub is its own can of worms.

At least we should document (README) this behavior/limitations instead of throwing it up in the air. WDYT?

@vmarchaud
Copy link
Member

@dyladan I personally prefer having a quite simple first implementation and then iterate on it with feedback from users

@dyladan
Copy link
Member

dyladan commented Dec 18, 2019

I think this is probably good to go. Tracing connections is not all that important and pub/sub is its own can of worms.

At least we should document (README) this behavior/limitations instead of throwing it up in the air. WDYT?

Didn't mean to sound flippant about it. Definitely limitations should be documented. I just meant that this is to the point where I think it is mergeable and we can iterate on it as we go. The pub/sub thing is a little different since it isn't a typical request/response rpc model so decisions need to be made about how we should trace it in a general case, not just redis.

@naseemkullah if tracing connect is relatively straightforward I would definitely prefer that we did that, but @mayurkale22 is right we should at least document limitations in the README.

@naseemkullah
Copy link
Member Author

@dyladan As it stands, creating a client traces an info command somehow but not a connect command as one would hope. Further more client.quit() is traced as it is a redis command like any other but client.disconnect() is not

assert.strictEqual(endedSpans.length, 1);
assert.strictEqual(endedSpans[0].name, `info`);
assertionUtils.assertPropagation(endedSpans[0], span);
assertionUtils.assertSpan(
endedSpans[0],
SpanKind.CLIENT,
attributes,
[],
okStatus
);
span.end();
assert.strictEqual(endedSpans.length, 2);
assert.strictEqual(endedSpans[1].name, `test span`);
client.quit(done);
assert.strictEqual(endedSpans.length, 3);
assert.strictEqual(endedSpans[2].name, `quit`);

I will look into getting a proper span for connect !

@naseemkullah
Copy link
Member Author

naseemkullah commented Dec 19, 2019

Tracing connect has been added via 3b47e26

But there is a lot of duplicated code between traceSendCommand and traceConnection that could potentially be refactored.

@dyladan
Copy link
Member

dyladan commented Dec 19, 2019

I don't see any issue with this minor duplication

@dyladan
Copy link
Member

dyladan commented Dec 19, 2019

@naseemkullah what currently happens when you call subscribe? Does it create a short span just for the time it takes to set up the subscription? I assume for publish the span works as you would expect.

Copy link
Member

@OlivierAlbertini OlivierAlbertini left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@naseemkullah
Copy link
Member Author

@dyladan pubsub test added, please see it for more info on behaviour 7b3a94e

@naseemkullah
Copy link
Member Author

@mayurkale22 I think this is ready for merging now.

@dyladan dyladan merged commit 3ca2df4 into open-telemetry:master Dec 24, 2019
@naseemkullah naseemkullah deleted the ioredis branch December 24, 2019 14:12
@dyladan dyladan changed the title Add ioredis docs: Add ioredis to instrumentation list Aug 17, 2021
@dyladan dyladan added the document Documentation-related label Aug 17, 2021
pichlermarc pushed a commit to dynatrace-oss-contrib/opentelemetry-js that referenced this pull request Dec 15, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
document Documentation-related Merge:LGTM This PR is ready to be merged by a Maintainer (has enough valid approvals, successful build, etc.)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

8 participants