Honeycomb Samplers for OpenTelemetry
Project description
opentelemetry-samplers-python
NOTE: This is experimental and is subject to change a lot or go away entirely. Use with caution.
Honeycomb Samplers for use with the OpenTelemetry Python SDK
Samplers
Deterministic Sampler
This is a port of the deterministic sampler included in our Python Beeline. To use it, just instantiate it with a sample rate:
from opentelemetry import trace
from opentelemetry.sdk.trace import TracerProvider
from opentelemetry.sdk.trace.export import (
ConsoleSpanExporter,
SimpleExportSpanProcessor,
)
from opentelemetry.ext.honeycomb.sampling import DeterministicSampler
sampler = DeterministicSampler(5) # every trace has a 20% chance of being sampled
trace.set_tracer_provider(TracerProvider(sampler=sampler))
trace.get_tracer_provider().add_span_processor(
SimpleExportSpanProcessor(ConsoleSpanExporter())
)
tracer = trace.get_tracer(__name__)
with tracer.start_as_current_span("Test span"):
with tracer.start_as_current_span("bar"):
with tracer.start_as_current_span("baz"):
print("Hello world from OpenTelemetry Python!")
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Close
Hashes for opentelemetry-ext-honeycomb-samplers-0.3b0.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 80077df508934a137b0f2372982b0aa0f3bd5d5ed93545babd13f6a3fc1271e1 |
|
MD5 | daefe31786c1f5a441f3248038a4673b |
|
BLAKE2b-256 | f46ca1fc6943def36172ea38877dac0119604db14aa063b4962b8fd7db225545 |
Close
Hashes for opentelemetry_ext_honeycomb_samplers-0.3b0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 7e185ee13f24cb4b6590d91d766df768b78e8d0b4761bf56b88fc36247460f32 |
|
MD5 | fb9eea302a8c3d7fdbd6dd2c8ebff633 |
|
BLAKE2b-256 | 7f517bcf63806c41c683b1d5704054204892bcb25d3c075212f2a0969615f054 |