All Projects → asaaki → opentelemetry-tide

asaaki / opentelemetry-tide

Licence: Apache-2.0, MIT licenses found Licenses found Apache-2.0 LICENSE-APACHE MIT LICENSE-MIT
🔭🌊 OpenTelemetry integration for Tide

Programming Languages

rust
11053 projects

Projects that are alternatives of or similar to opentelemetry-tide

opentelemetry-js-api
OpenTelemetry Javascript API
Stars: ✭ 75 (+316.67%)
Mutual labels:  tracing, opentelemetry
javaagent
Hypertrace OpenTelemetry Java agent with payload/body and headers data capture.
Stars: ✭ 13 (-27.78%)
Mutual labels:  tracing, opentelemetry
open-telemetry-java-guides
Java OpenTelemetry 测试指南 :Open-Telemetry-Java-Guides 案例,用于测试常用中间件支持及 Otel 相关组件的使用情况。 可观察性Sig: https://i.cloudnative.to/observability/
Stars: ✭ 67 (+272.22%)
Mutual labels:  otel, opentelemetry
opentelemetry-swift
OpenTelemetry Tracer built for Swift Distributed Tracing
Stars: ✭ 22 (+22.22%)
Mutual labels:  tracing, opentelemetry
splunk-otel-java
Splunk Distribution of OpenTelemetry Java
Stars: ✭ 39 (+116.67%)
Mutual labels:  tracing, opentelemetry
opentelemetry-ext-js
js extensions for the open-telemetry project
Stars: ✭ 122 (+577.78%)
Mutual labels:  tracing, opentelemetry
uptrace
Open source APM: OpenTelemetry traces, metrics, and logs
Stars: ✭ 1,187 (+6494.44%)
Mutual labels:  tracing, opentelemetry
gateway
A proxy to buffer and forward metrics, events, and traces.
Stars: ✭ 94 (+422.22%)
Mutual labels:  tracing, opentelemetry
hubble-otel
Hubble adaptor for OpenTelemetry
Stars: ✭ 29 (+61.11%)
Mutual labels:  tracing, opentelemetry
Gf
GoFrame is a modular, powerful, high-performance and enterprise-class application development framework of Golang.
Stars: ✭ 6,501 (+36016.67%)
Mutual labels:  tracing, opentelemetry
iopipe-js
Build and run serverless apps with confidence on AWS Lambda with Tracing, Profiling, Metrics, Monitoring, and more.
Stars: ✭ 33 (+83.33%)
Mutual labels:  tracing
aws-o11y-recipes
recipes for observability solutions at AWS
Stars: ✭ 110 (+511.11%)
Mutual labels:  opentelemetry
elixir plug server timing
Bring Elixir/Phoenix server-side performance metrics 📈 to Chrome's Developer Tools via the Server Timing API. Production Safe™.
Stars: ✭ 49 (+172.22%)
Mutual labels:  tracing
loggie
A lightweight, cloud-native data transfer agent and aggregator
Stars: ✭ 844 (+4588.89%)
Mutual labels:  opentelemetry
rbbcc
BCC port for MRI - this is unofficial bonsai project.
Stars: ✭ 45 (+150%)
Mutual labels:  tracing
mltrace
Coarse-grained lineage and tracing for machine learning pipelines.
Stars: ✭ 449 (+2394.44%)
Mutual labels:  tracing
aws-otel-lambda
AWS Distro for OpenTelemetry - AWS Lambda
Stars: ✭ 94 (+422.22%)
Mutual labels:  opentelemetry
java-concurrent
OpenTracing-aware helpers related to java.util.concurrent
Stars: ✭ 36 (+100%)
Mutual labels:  tracing
batiscaph
Currently inactive. Erlang trace visualizer.
Stars: ✭ 37 (+105.56%)
Mutual labels:  tracing
nodejs
Node.js in-process collectors for Instana
Stars: ✭ 66 (+266.67%)
Mutual labels:  tracing


opentelemetry-tide

OpenTelemetry integration for Tide


Add OpenTelemetry tracing and metrics support to your tide application. Be part of the new observability movement!

Notes

  • It only implements very basic request tracing on the middleware layer. If you need spans for your executed code, you need to add them yourself.
  • It provides basic prometheus metrics, based on the RED method.
  • This project got inspired by https://github.com/OutThereLabs/actix-web-opentelemetry.
  • You probably do not want to use it in production. 🤷

How to use

# Run jaeger in background
docker run -d \
  -p6831:6831/udp -p6832:6832/udp -p16686:16686 -p14268:14268 \
  jaegertracing/all-in-one:latest

# Run server example with tracing middleware
cargo run --example server

# Make a request or two ...
curl http://localhost:3000/

# Open browser and view the traces
firefox http://localhost:16686/

# Check the prometheus metrics endpoint
curl http://localhost:3000/metrics

Example

Cargo.toml

# ...

[dependencies]
async-std = { version = "1.10", features = ["attributes"] }
opentelemetry = { version = "0.17.0", features = ["rt-async-std"] }
opentelemetry-jaeger = { version = "0.16.0", features = ["rt-async-std"] }
opentelemetry-tide = "0.12"
tide = "0.16"

server.rs

use opentelemetry::{global, KeyValue, runtime};
use opentelemetry_semantic_conventions::resource;
use opentelemetry_tide::TideExt; // import trait

const VERSION: &'static str = env!("CARGO_PKG_VERSION");

#[async_std::main]
async fn main() -> Result<(), Box<dyn std::error::Error>> {
    tide::log::with_level(tide::log::LevelFilter::Warn);

    let tags = [resource::SERVICE_VERSION.string(VERSION)];

    let _tracer = opentelemetry_jaeger::new_pipeline()
        .with_tags(tags.iter().map(ToOwned::to_owned))
        .install_batch(runtime::AsyncStd)
        .expect("pipeline install failure");
    let tracer = global::tracer("example-server");

    let metrics_kvs = vec![KeyValue::new("K", "V")];

    let mut app = tide::new();

    // use the trait
    app.with_middlewares(tracer, Some(metrics_kvs));

    app.at("/").get(|_| async move {
        Ok("Hello, OpenTelemetry!")
    });

    app.listen("0.0.0.0:3000").await?;

    global::shutdown_tracer_provider();

    Ok(())
}

Cargo Features

flag description
trace enables tracing middleware; enabled by default
metrics enables metrics middleware; enabled by default

Safety

This crate uses #![forbid(unsafe_code)] to ensure everything is implemented in 100% Safe Rust.

License

Licensed under either of Apache License, Version 2.0 or MIT license at your option.
Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in this crate by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].