OpenTelemetry Integration
Lumberjack is built on OpenTelemetry and supports custom exporters for complete compatibility with the OpenTelemetry ecosystem.
Using Custom Exporters
Section titled “Using Custom Exporters”Use any OpenTelemetry exporter directly:
from opentelemetry.exporter.jaeger.thrift import JaegerExporterfrom opentelemetry.exporter.prometheus import PrometheusMetricReaderfrom opentelemetry.exporter.otlp.proto.grpc.trace_exporter import OTLPSpanExporterfrom lumberjack_sdk import Lumberjack
# Custom exportersjaeger_exporter = JaegerExporter( agent_host_name="jaeger", agent_port=6831,)
otlp_exporter = OTLPSpanExporter( endpoint="http://otel-collector:4317", insecure=True)
prometheus_reader = PrometheusMetricReader()
Lumberjack.init( project_name="my-app", custom_span_exporter=jaeger_exporter, # or otlp_exporter custom_metrics_exporter=prometheus_reader,)
OTLP Integration
Section titled “OTLP Integration”from opentelemetry.exporter.otlp.proto.grpc.trace_exporter import OTLPSpanExporterfrom opentelemetry.exporter.otlp.proto.grpc._log_exporter import OTLPLogExporterfrom lumberjack_sdk import Lumberjack
# Send to any OTLP-compatible collectorotlp_span_exporter = OTLPSpanExporter( endpoint="http://otel-collector:4317", insecure=True)
otlp_log_exporter = OTLPLogExporter( endpoint="http://otel-collector:4317", insecure=True)
Lumberjack.init( project_name="my-app", custom_span_exporter=otlp_span_exporter, custom_log_exporter=otlp_log_exporter,)