OpenTelemetry Metrics over HTTP Exporter
Project description
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
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
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file sb-opentelemetry-extension-exporter-otlp-proto-http-1.12.2.tar.gz.
File metadata
- Download URL: sb-opentelemetry-extension-exporter-otlp-proto-http-1.12.2.tar.gz
- Upload date:
- Size: 18.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.1 CPython/3.10.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
38d30fd77cf17932e0066553356167b9efb8c24a570a677b8c0ef6484398bab4
|
|
| MD5 |
f8933b07e5096b754e3787b9bc5c80be
|
|
| BLAKE2b-256 |
463103307c6c3f0837d58c47fd5073d1dd80e1e8139e402ef199e93db51dd052
|
File details
Details for the file sb_opentelemetry_extension_exporter_otlp_proto_http-1.12.2-py3-none-any.whl.
File metadata
- Download URL: sb_opentelemetry_extension_exporter_otlp_proto_http-1.12.2-py3-none-any.whl
- Upload date:
- Size: 17.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.1 CPython/3.10.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
b1ba8648a59c68586e16050bdb99697a55e3adab26cabfb70abc2c74890ea50a
|
|
| MD5 |
31a15a559b74d4aa27f827ffde19dc40
|
|
| BLAKE2b-256 |
cd762451c91a66a82de5e9237e6816fb48164f88c8194c5c29ecbead974bdf60
|