Fix use of built-in samplers in SDK configuration#3176
Merged
ocelotl merged 7 commits intoopen-telemetry:mainfrom Mar 15, 2023
Merged
Fix use of built-in samplers in SDK configuration#3176ocelotl merged 7 commits intoopen-telemetry:mainfrom
ocelotl merged 7 commits intoopen-telemetry:mainfrom
Conversation
ca645d4 to
1be89a8
Compare
lzchen
approved these changes
Feb 21, 2023
srikanthccv
reviewed
Feb 23, 2023
51fe90d to
7f0909d
Compare
ocelotl
reviewed
Mar 1, 2023
Signed-off-by: Matej Gera <matej.gera@coralogix.com>
Signed-off-by: Matej Gera <matej.gera@coralogix.com>
c9d923f to
1aaad26
Compare
Signed-off-by: Matej Gera <matej.gera@coralogix.com>
1aaad26 to
f5b308f
Compare
Contributor
Author
|
Hi @srikanthccv, sorry for the back and forth, I implemented it with your suggestion and cleaned up the PR. Hopefully now all is as should be. |
srikanthccv
reviewed
Mar 11, 2023
Member
srikanthccv
left a comment
There was a problem hiding this comment.
Thanks @matej-g , but the type conversion is also missing here
It should be changed to
sampler_factory = _import_sampler_factory(sampler_name)
kwargs = {}
if sampler_name in ("traceidratio", "parentbased_traceidratio"):
try:
rate = float(os.getenv(OTEL_TRACES_SAMPLER_ARG))
except ValueError:
_logger.warning("Could not convert TRACES_SAMPLER_ARG to float.")
rate = 1.0
kwargs["rate"] = rate
sampler = sampler_factory(**kwargs)
ocelotl
reviewed
Mar 13, 2023
Signed-off-by: Matej Gera <matej.gera@coralogix.com>
Signed-off-by: Matej Gera <matej.gera@coralogix.com>
b408173 to
fffc0b4
Compare
Contributor
Author
|
@srikanthccv you're right, that part was still missing. I added your suggestion. Hopefully now everything is fixed as expected. |
|
Hi. Thanks for this fix. Do you know when this fix will be available on PyPI? |
Member
|
most probably (early) next week based on our monthly release schedule. |
Thanks @srikanthccv 🙌🏽 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Fixes a configuration bug which causes the instrumentation to fall back on the default sampler when a built-in sampler is specified, due to the samplers missing from entry points. For details see description of #3175.
P.S. I'm not a Python developer, so feedback on if this should be done other way is welcome.
Fixes #3175
Type of change
Please delete options that are not relevant.
How Has This Been Tested?
Failed to initialize custom samplerdue to it missing from entry points #3175 with expected behaviorDoes This PR Require a Contrib Repo Change?
Checklist: