OpenTelemetry Collector Protobuf over gRPC Exporter

1.40.0 · active · verified Thu Oct 05

This library provides an exporter for sending telemetry data to the OpenTelemetry Collector using Protobuf over gRPC. The current version is 1.40.0, and releases are made regularly with updates and fixes.

Warnings

Install

Imports

Quickstart

A simple example of using the OTLP exporter to start a span.

import os
from opentelemetry import trace
from opentelemetry.exporter.otlp.proto.grpc import OTLPExporter

exporter = OTLPExporter(endpoint=os.environ.get('OTLP_ENDPOINT', 'localhost:4317'))

tracer = trace.get_tracer(__name__)
with tracer.start_as_current_span('example-span'):
    print('This is a traced span')

view raw JSON →