Skip to main content
Pre-release

This release is a pre-release and may not be stable for production use.

OpenTelemetry Collector JSON over HTTP Exporter

pypi

This library exports OpenTelemetry traces, metrics and logs using the OpenTelemetry Protocol (OTLP) JSON encoding over HTTP. It can be used to send data to any backend that accepts OTLP JSON such as the OpenTelemetry Collector.

Installation

pip install opentelemetry-exporter-otlp-json-http

Usage

from opentelemetry import trace
from opentelemetry.exporter.otlp.json.http import OTLPSpanExporter
from opentelemetry.sdk.resources import Resource
from opentelemetry.sdk.trace import TracerProvider
from opentelemetry.sdk.trace.export import BatchSpanProcessor

resource = Resource.create({
    "service.name": "service"
})

trace.set_tracer_provider(TracerProvider(resource=resource))
tracer = trace.get_tracer(__name__)

otlp_exporter = OTLPSpanExporter()

span_processor = BatchSpanProcessor(otlp_exporter)

trace.get_tracer_provider().add_span_processor(span_processor)

with tracer.start_as_current_span("foo"):
    print("Hello world!")

References

Release files for opentelemetry-exporter-otlp-json-http 0.66b0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for opentelemetry-exporter-otlp-json-http 0.66b0
File Size Uploaded
opentelemetry_exporter_otlp_json_http-0.66b0.tar.gz 17.6 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for opentelemetry-exporter-otlp-json-http 0.66b0
File Interpreter ABI Platform
opentelemetry_exporter_otlp_json_http-0.66b0-py3-none-any.whl Python 3 none any Details

Total release size: 32.1 kB

Release files / opentelemetry_exporter_otlp_json_http-0.66b0.tar.gz

Download URL opentelemetry_exporter_otlp_json_http-0.66b0.tar.gz
Size 17.6 kB
Tags Source
SHA-256 checksum
How to use checksums
eae9bb220c9b3e1da91fb9b9a0e92661fdd62b2e1939184001b7dfc0d6170492
BLAKE2b-256 checksum
How to use checksums
06782497a7808e7d0e8bb2d6df08a1d00940d054ae2f45253897a8225be19269
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.10.21

Release files / opentelemetry_exporter_otlp_json_http-0.66b0-py3-none-any.whl

Download URL opentelemetry_exporter_otlp_json_http-0.66b0-py3-none-any.whl
Size 14.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
eda616e19eceaff18c8762475107601c56528a9c6194601129a8291960661bd5
BLAKE2b-256 checksum
How to use checksums
6c265a9b85bd4b9de5b6004e6876ac327c274c803149ec8c80b97b65b747c091
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.10.21

Release history Release notifications | RSS feed

This release

0.66b0 This release

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page