Skip to main content

OpenTelemetry Metrics over HTTP Exporter

Project description

pypi

This library allows to export data to the OpenTelemetry Collector using the OpenTelemetry Protocol using HTTP.

Installation

pip install sb-opentelemetry-extension-exporter-otlp-proto-http
from opentelemetry import metrics
from opentelemetry.sdk.resources import SERVICE_NAME, Resource
from opentelemetry.sdk.metrics import MeterProvider
from opentelemetry.sdk.metrics.export import PeriodicExportingMetricReader
from opentelemetry.extension.exporter.otlp.proto.http.metric_exporter import OTLPMetricExporter

resource = Resource(attributes={
    SERVICE_NAME: "service",
})

metric_reader = PeriodicExportingMetricReader(OTLPMetricExporter())
provider = MeterProvider(resource=resource, metric_readers=[metric_reader])

# Sets the global default meter provider
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