Skip to main content

StatsD client support for OpenTelemetry

Project description

This library provides components necessary to send OpenTelemetry metrics to a StatsD backend.

Installation

pip install sb-opentelemetry-sdk-extension-statsd

Usage

Install the OpenTelemetry SDK package.

pip install opentelemetry-sdk

Next, use the provided StatsdMeterProvider instead of the default MeterProvider.

from statsd import StatsdClient

from opentelemetry import metrics
from opentelemetry.sdk.resources import Resource
from opentelemetry.sdk.extension.statsd.metrics import StatsdMeterProvider

statsd = StatsdClient(max_buffer_size=0)
provider = StatsdMeterProvider(statsd=statsd, resource=Resource(attributes={
    "service.name": "service-Name",
}))
metrics.set_meter_provider(provider)

References

Project details


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

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page