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
feat(jaeger-remote-sampler): Implement jaeger remote sampler #4589
base: main
Are you sure you want to change the base?
feat(jaeger-remote-sampler): Implement jaeger remote sampler #4589
Conversation
…legalimpurity/opentelemetry-js into feature/implement_jaeger_remote_sampler
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #4589 +/- ##
==========================================
+ Coverage 90.77% 92.86% +2.08%
==========================================
Files 90 331 +241
Lines 1930 9571 +7641
Branches 417 2054 +1637
==========================================
+ Hits 1752 8888 +7136
- Misses 178 683 +505
|
…ger_remote_sampler
Good morning guys? did anyone had a chance to review this? |
Hello Guys any update here? @pichlermarc |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah sorry, I must've not posted my review yesterday 😞 - a few comments, mostly around testing/imports.
Once addressed, I'll do another pass to look more closely into the actual implementation 👍
@@ -0,0 +1,69 @@ | |||
{ | |||
"name": "@opentelemetry/sampler-jaeger-remote", | |||
"version": "0.0.1", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"version": "0.0.1", | |
"version": "0.50.0", |
experimental/CHANGELOG.md
Outdated
@@ -9,6 +9,7 @@ All notable changes to experimental packages in this project will be documented | |||
### :rocket: (Enhancement) | |||
|
|||
* feat(otlp-transformer): consolidate scope/resource creation in transformer [#4600](https://github.com/open-telemetry/opentelemetry-js/pull/4600) | |||
* feat(jaeger-remote-samper): added support of jaeger-remote-samper [#4534](https://github.com/open-telemetry/opentelemetry-js/pull/4589) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
* feat(jaeger-remote-samper): added support of jaeger-remote-samper [#4534](https://github.com/open-telemetry/opentelemetry-js/pull/4589) | |
* feat(jaeger-remote-sampler): added support of jaeger-remote-sampler [#4534](https://github.com/open-telemetry/opentelemetry-js/pull/4589) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
please also add a link to the spec in a sub-list item below.
The commit scope we use is usually the package name which is sampler-jaeger-remote
(different order of words) - so we may want to use this here.
@@ -0,0 +1 @@ | |||
# Sample Jaeger Remote Sampler |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This needs a lot more details (usage examples, etc.)
Please also add the same disclaimer as is found on the other packages (the one about the package being experimental and possible breaking changes).
"typescript": "4.4.4" | ||
}, | ||
"peerDependencies": { | ||
"@opentelemetry/api": "1.8.0", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
API dependencies are usually a range of the earliest API version that it can be used with up until the most recent version. To find the exact supported versions please check which features from the API you're using and in which version they were introduced.
* limitations under the License. | ||
*/ | ||
|
||
import { Context } from '@opentelemetry/api/src/context/types'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Avoid deep imports.
import { Context } from '@opentelemetry/api/src/context/types'; | |
import { Context } from '@opentelemetry/api'; |
TraceIdRatioBasedSampler, | ||
} from '@opentelemetry/sdk-trace-base'; | ||
import { SpanKind } from '@opentelemetry/api/src/trace/span_kind'; | ||
import { Link } from '@opentelemetry/api/src/trace/link'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
import { Link } from '@opentelemetry/api/src/trace/link'; | |
import { Link } from '@opentelemetry/api'; |
} | ||
|
||
toString(): string { | ||
return `JaegerRemoteSampler{endpoint=${this._endpoint},${ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
would there ever be any sensitive data (token and things like this) in this._endpoint
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nope. just get endpoint with maybe service name.
} from '@opentelemetry/sdk-trace-base'; | ||
import { SpanKind } from '@opentelemetry/api/src/trace/span_kind'; | ||
import { Link } from '@opentelemetry/api/src/trace/link'; | ||
import { SpanAttributes } from '@opentelemetry/api/src/trace/attributes'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
import { SpanAttributes } from '@opentelemetry/api/src/trace/attributes'; | |
import { SpanAttributes } from '@opentelemetry/api'; |
// Required for testing | ||
getRootSampler(): Sampler { | ||
return this._root; | ||
} | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd also like to avoid this if possible. This will actually add to the public API of the stable package. If exported it should serve a purpose other than testing.
// Required for testing | ||
getRatio(): number { | ||
return this._ratio; | ||
} | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd also like to avoid this if possible. This will actually add to the public API of the package. If exported it should serve a purpose other than testing.
…pen-telemetry#4605) * feat(sdk-trace-base): log resoruce attributes in ConsoleSpanExporter * fixup! feat(sdk-trace-base): log resoruce attributes in ConsoleSpanExporter
…metry#4624) Now that instrumentation-undici exists, point to it for users that want instrumentation of Node.js' fetch().
…lemetry#4627) This package accidentally got a dep and devDep on api-logs, at different versions. The result was it being pinned at the older version in package-lock. Co-authored-by: Marc Pichler <marc.pichler@dynatrace.com>
…pen-telemetry#4612) * fix(otlp-grpc-exporter-base): avoid TypeError on exporter shutdown * chore: update changelog * fix: use gRPC Client type over any * fixup! fix: use gRPC Client type over any * fix: use ts-lint/ts-ignore
…ger_remote_sampler
Which problem is this PR solving?
This is an implementation of JaegerRemoteSampler. This follows the specification mentioned here.
Fixes #4534
Short description of the changes
Add a new samper implementation in experimental packages.
Type of change
Please delete options that are not relevant.
How Has This Been Tested?
Please describe the tests that you ran to verify your changes. Provide instructions so we can reproduce. Please also list any relevant details for your test configuration
Have added full coverage for entire code.
Checklist: