|
| 1 | +![OpenTelemetry — An observability framework for cloud-native software.][splash] |
| 2 | + |
| 3 | +[splash]: https://raw.githubusercontent.com/open-telemetry/opentelemetry-rust/master/assets/logo-text.png |
| 4 | + |
| 5 | +# OpenTelemetry Rust |
| 6 | + |
| 7 | +The Rust [OpenTelemetry](https://opentelemetry.io/) implementation. |
| 8 | + |
| 9 | +[](https://crates.io/crates/opentelemetry) |
| 10 | +[](https://docs.rs/opentelemetry) |
| 11 | +[](./LICENSE) |
| 12 | +[](https://github.com/open-telemetry/opentelemetry-rust/actions?query=workflow%3ACI+branch%3Amaster) |
| 13 | +[](https://gitter.im/open-telemetry/opentelemetry-rust) |
| 14 | + |
| 15 | +[Website](https://opentelemetry.io/) | |
| 16 | +[Chat](https://gitter.im/open-telemetry/opentelemetry-rust) | |
| 17 | +[Documentation](https://docs.rs/opentelemetry) |
| 18 | + |
| 19 | +## Overview |
| 20 | + |
| 21 | +OpenTelemetry is a collection of tools, APIs, and SDKs used to instrument, |
| 22 | +generate, collect, and export telemetry data (metrics, logs, and traces) for |
| 23 | +analysis in order to understand your software's performance and behavior. You |
| 24 | +can export and analyze them using [Prometheus], [Jaeger], and other |
| 25 | +observability tools. |
| 26 | + |
| 27 | +*Compiler support: [requires `rustc` 1.42+][msrv]* |
| 28 | + |
| 29 | +[Prometheus]: https://prometheus.io |
| 30 | +[Jaeger]: https://www.jaegertracing.io |
| 31 | +[msrv]: #supported-rust-versions |
| 32 | + |
| 33 | +## Getting Started |
| 34 | + |
| 35 | +```rust |
| 36 | +use opentelemetry::{exporter::trace::stdout, trace::Tracer}; |
| 37 | + |
| 38 | +fn main() -> Result<(), Box<dyn std::error::Error + Send + Sync + 'static>> { |
| 39 | + // Create a new instrumentation pipeline |
| 40 | + let (tracer, _uninstall) = stdout::new_pipeline().install(); |
| 41 | + |
| 42 | + tracer.in_span("doing_work", |cx| { |
| 43 | + // Traced app logic here... |
| 44 | + }); |
| 45 | + |
| 46 | + Ok(()) |
| 47 | +} |
| 48 | +``` |
| 49 | + |
| 50 | +See the [examples](./examples) directory for different integration patterns. |
| 51 | + |
| 52 | +## Ecosystem |
| 53 | + |
| 54 | +### Related Crates |
| 55 | + |
| 56 | +In addition to `opentelemetry`, the [`open-telemetry/opentelemetry-rust`] |
| 57 | +repository contains several additional crates designed to be used with the |
| 58 | +`opentelemetry` ecosystem. This includes a collection of trace `SpanExporter` |
| 59 | +and metrics pull and push controller implementations, as well as utility and |
| 60 | +adapter crates to assist in propagating state and instrumenting applications. |
| 61 | + |
| 62 | +In particular, the following crates are likely to be of interest: |
| 63 | + |
| 64 | +- [`opentelemetry-jaeger`] provides a pipeline and exporter for sending trace |
| 65 | + information to [`Jaeger`]. |
| 66 | +- [`opentelemetry-otlp`] exporter for sending trace and metric data in the OTLP |
| 67 | + format to the OpenTelemetry collector. |
| 68 | +- [`opentelemetry-prometheus`] provides a pipeline and exporter for sending |
| 69 | + metrics information to [`Prometheus`]. |
| 70 | +- [`opentelemetry-zipkin`] provides a pipeline and exporter for sending trace |
| 71 | + information to [`Zipkin`]. |
| 72 | +- [`opentelemetry-contrib`] provides additional exporters to vendors like |
| 73 | + [`Datadog`]. |
| 74 | +- [`opentelemetry-semantic-conventions`] provides standard names and semantic |
| 75 | + otel conventions. |
| 76 | + |
| 77 | +Additionally, there are also several third-party crates which are not |
| 78 | +maintained by the `opentelemetry` project. These include: |
| 79 | + |
| 80 | +- [`tracing-opentelemetry`] provides integration for applications instrumented |
| 81 | + using the [`tracing`] API and ecosystem. |
| 82 | +- [`actix-web-opentelemetry`] provides integration for the [`actix-web`] web |
| 83 | + server and ecosystem. |
| 84 | +- [`opentelemetry-application-insights`] provides an unofficial [Azure |
| 85 | + Application Insights] exporter. |
| 86 | +- [`opentelemetry-tide`] provides integration for the [`Tide`] web server and |
| 87 | + ecosystem. |
| 88 | + |
| 89 | +If you're the maintainer of an `opentelemetry` ecosystem crate not listed |
| 90 | +above, please let us know! We'd love to add your project to the list! |
| 91 | + |
| 92 | +[`open-telemetry/opentelemetry-rust`]: https://github.com/open-telemetry/opentelemetry-rust |
| 93 | +[`opentelemetry-jaeger`]: https://crates.io/crates/opentelemetry-jaeger |
| 94 | +[`Jaeger`]: https://www.jaegertracing.io |
| 95 | +[`opentelemetry-otlp`]: https://crates.io/crates/opentelemetry-otlp |
| 96 | +[`opentelemetry-prometheus`]: https://crates.io/crates/opentelemetry-prometheus |
| 97 | +[`Prometheus`]: https://prometheus.io |
| 98 | +[`opentelemetry-zipkin`]: https://crates.io/crates/opentelemetry-zipkin |
| 99 | +[`Zipkin`]: https://zipkin.io |
| 100 | +[`opentelemetry-contrib`]: https://crates.io/crates/opentelemetry-contrib |
| 101 | +[`Datadog`]: https://www.datadoghq.com |
| 102 | +[`opentelemetry-semantic-conventions`]: https://crates.io/crates/opentelemetry-semantic-conventions |
| 103 | + |
| 104 | +[`tracing-opentelemetry`]: https://crates.io/crates/tracing-opentelemetry |
| 105 | +[`tracing`]: https://crates.io/crates/tracing |
| 106 | +[`actix-web-opentelemetry`]: https://crates.io/crates/actix-web-opentelemetry |
| 107 | +[`actix-web`]: https://crates.io/crates/actix-web |
| 108 | +[`opentelemetry-application-insights`]: https://crates.io/crates/opentelemetry-application-insights |
| 109 | +[Azure Application Insights]: https://docs.microsoft.com/en-us/azure/azure-monitor/app/app-insights-overview |
| 110 | +[`opentelemetry-tide`]: https://crates.io/crates/opentelemetry-tide |
| 111 | +[`Tide`]: https://crates.io/crates/tide |
| 112 | + |
| 113 | +## Supported Rust Versions |
| 114 | + |
| 115 | +OpenTelemetry is built against the latest stable release. The minimum supported |
| 116 | +version is 1.42. The current OpenTelemetry version is not guaranteed to build |
| 117 | +on Rust versions earlier than the minimum supported version. |
| 118 | + |
| 119 | +The current stable Rust compiler and the three most recent minor versions |
| 120 | +before it will always be supported. For example, if the current stable compiler |
| 121 | +version is 1.45, the minimum supported version will not be increased past 1.42, |
| 122 | +three minor versions prior. Increasing the minimum supported compiler version |
| 123 | +is not considered a semver breaking change as long as doing so complies with |
| 124 | +this policy. |
| 125 | + |
| 126 | +## Contributing |
| 127 | + |
| 128 | +See the [contributing file](CONTRIBUTING.md). |
0 commit comments