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 import DeterministicSampler
sampler = DeterministicSampler(5)
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.2b0.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 12490498747ed42916670bbd9a3546d6e74d3e51ce8b84ba46d9150bc1602a89 |
|
MD5 | 651f9437ac4ec030b7f66bd431faa37a |
|
BLAKE2b-256 | 7e44536d16a0635a9c7a748b429ce135609de5ce2d279e170f170a426b868112 |
Close
Hashes for opentelemetry_ext_honeycomb_samplers-0.2b0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | e6e3013ff8af72e17d98c6e7bdc4497bf7a6c6205bebf0cb4f2cf91360859397 |
|
MD5 | 8b01dee39d4b382fad659345715fa06c |
|
BLAKE2b-256 | ef0ac2da77a725aa714c2b7f8b1f3b2d1fb32a0157f2d2b6df3237c823683022 |