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

Support for Jaeger Remote Sampling addition to contrib repo #3852

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

sconover
Copy link

Description

I'm attempting to port the jaeger remote sampling support from the jaeger-client-python project.

Per @srikanthccv 's feedback here, it really makes more sense for the bulk of the port to go into the contrib repo. However there are elements of the core sampler code that need to change to accommodate these contrib samplers.

I'm opening this in draft mode to seek initial feedback+guidance. There's a series of TODO's that raise questions about approach.

Type of change

  • New feature (non-breaking change which adds functionality)

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

  • Unit tests, in test_sampling.py

Does This PR Require a Contrib Repo Change?

It doesn't require one, but there will be a companion PR that depends on this change.

  • Yes. - Link to PR:
  • No.

Checklist:

  • Followed the style guidelines of this project
  • Changelogs have been updated
  • Unit tests have been added
  • Documentation has been updated

@sconover sconover force-pushed the sconover/support-for-jaeger-remote-sampling-contrib branch from 12f597f to 3b9b109 Compare April 16, 2024 04:01
@@ -413,7 +456,7 @@ class _ParentBasedAlwaysOn(ParentBased):
def __init__(self, _):
super().__init__(ALWAYS_ON)


# TODO(sconover): Something must be done to allow samplers from the contrib repo to be specified
Copy link
Author

Choose a reason for hiding this comment

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

The most immediate issue is what to do about _KNOWN_SAMPLERS - verification of sampler choice based on this dict excludes the possibility of contrib-repo samplers, I would appreciate advice about what to do about this.

@srikanthccv
Copy link
Member

srikanthccv commented Apr 16, 2024

The sampler loading mechanism should be changed to entrypoint based. We already do this for several components. For example, we have exporters that users can configure with OTEL_{TRACES/LOGS/METRICS}_EXPORTER to otlp to load the OTELP exporters

[project.entry-points.opentelemetry_logs_exporter]
otlp = "opentelemetry.exporter.otlp.proto.grpc._log_exporter:OTLPLogExporter"
[project.entry-points.opentelemetry_metrics_exporter]
otlp = "opentelemetry.exporter.otlp.proto.grpc.metric_exporter:OTLPMetricExporter"
[project.entry-points.opentelemetry_traces_exporter]
otlp = "opentelemetry.exporter.otlp.proto.grpc.trace_exporter:OTLPSpanExporter"

sconover added a commit to chronosphereio/opentelemetry-python-contrib that referenced this pull request Apr 16, 2024
Depends on proposed changes to opentelementry python:
  open-telemetry/opentelemetry-python#3852
@sconover
Copy link
Author

@srikanthccv Ok, upon a second look at this, it would appear that the library has the ability to load an arbitrary sampler from an env var, and that this validation is only used if the sampler selection falls back to default, explanation here. So I think there's nothing to do.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants