OpenTelemetry Collector Rust Exporter
OTLP
integration for applications instrumented with OpenTelemetry
.
Overview
OpenTelemetry
is a collection of tools, APIs, and SDKs used to instrument,
generate, collect, and export telemetry data (metrics, logs, and traces) for
analysis in order to understand your software's performance and behavior.
This crate provides an exporter for sending trace and metric data in the OTLP format to the OpenTelemetry collector. The OpenTelemetry Collector offers a vendor-agnostic implementation on how to receive, process, and export telemetry data. In addition, it removes the need to run, operate, and maintain multiple agents/collectors in order to support open-source telemetry data formats (e.g. Jaeger, Prometheus, etc.) sending to multiple open-source or commercial back-ends.
Quickstart
First make sure you have a running version of the opentelemetry collector you want to send data to:
$ docker run -p 4317:4317 otel/opentelemetry-collector-dev:latest
Then install a new pipeline with the recommended defaults to start exporting telemetry:
use tracer;
Options
Multiple gRPC transport layers are available. tonic
is the default gRPC transport
layer and is enabled by default. grpcio
is optional.
gRPC transport layer | hyperium/tonic | tikv/grpc-rs |
---|---|---|
Feature | --features=default | --features=grpc-sys |
gRPC library | tonic |
grpcio |
Transport | hyperium/hyper (Rust) | grpc/grpc (C++ binding) |
TLS support | yes | yes |
TLS library | rustls | OpenSSL |
TLS optional | yes | yes |
Supported .proto generator | prost |
prost , protobuf |
Performance
For optimal performance, a batch exporter is recommended as the simple exporter will export each span synchronously on drop. Enable a runtime to have a batch exporter configured automatically for either executor when using the pipeline.
[]
= { = "*", = ["async-std"] }
= { = "*", = ["grpc-sys"] }
Kitchen Sink Full Configuration
Example showing how to override all configuration options. See the
OtlpPipelineBuilder
docs for details of each option.
use ;
use ;
use ;
use Duration;
use ;