Skip to main content

Uptrace exporter for OpenTelemetry

Project description

Uptrace Python exporter for OpenTelemetry

Introduction

uptrace-python is an exporter for OpenTelemetry that sends your traces and metrics to Uptrace.dev.

Installation

pip install uptrace

Trace exporter

Trace exporter can be configured with the following code:

from opentelemetry import trace
from opentelemetry.sdk.trace import TracerProvider
from opentelemetry.sdk.trace.export import BatchExportSpanProcessor
import uptrace

# The preferred tracer implementation must be set, as the opentelemetry-api
# defines the interface with a no-op implementation.
trace.set_tracer_provider(TracerProvider())

# Exporter receives the spans and sends them to Uptrace.dev.
exporter = uptrace.trace.Exporter(
    dsn="" # copy your project DSN here or use UPTRACE_DSN env var
)

span_processor = BatchExportSpanProcessor(
    exporter, max_queue_size=10000, max_export_batch_size=10000
)
trace.get_tracer_provider().add_span_processor(span_processor)

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

uptrace-0.1.0b2.tar.gz (2.1 kB view hashes)

Uploaded Source

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