{"id":15439460,"url":"https://github.com/asaaki/opentelemetry-tide","last_synced_at":"2025-06-12T05:35:14.754Z","repository":{"id":43860947,"uuid":"284043118","full_name":"asaaki/opentelemetry-tide","owner":"asaaki","description":"🔭🌊 OpenTelemetry integration for Tide","archived":false,"fork":false,"pushed_at":"2023-03-27T22:00:25.000Z","size":248,"stargazers_count":19,"open_issues_count":4,"forks_count":4,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-04-11T16:07:17.711Z","etag":null,"topics":["metrics","opentelemetry","opentelemetry-rust","opentelemetry-tide","otel","rust","tracing"],"latest_commit_sha":null,"homepage":"https://crates.io/crates/opentelemetry-tide","language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/asaaki.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":".github/CONTRIBUTING.md","funding":null,"license":"LICENSE-APACHE","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2020-07-31T13:28:52.000Z","updated_at":"2023-09-01T19:44:07.000Z","dependencies_parsed_at":"2024-11-08T16:01:24.654Z","dependency_job_id":"80d3acad-5512-460e-b399-539a7f059715","html_url":"https://github.com/asaaki/opentelemetry-tide","commit_stats":{"total_commits":144,"total_committers":6,"mean_commits":24.0,"dds":"0.14583333333333337","last_synced_commit":"da4988145ca5eb1ddf05fff3e2ebf495da6044ba"},"previous_names":[],"tags_count":16,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/asaaki%2Fopentelemetry-tide","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/asaaki%2Fopentelemetry-tide/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/asaaki%2Fopentelemetry-tide/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/asaaki%2Fopentelemetry-tide/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/asaaki","download_url":"https://codeload.github.com/asaaki/opentelemetry-tide/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":249239233,"owners_count":21235820,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["metrics","opentelemetry","opentelemetry-rust","opentelemetry-tide","otel","rust","tracing"],"created_at":"2024-10-01T19:06:33.913Z","updated_at":"2025-04-16T12:30:37.250Z","avatar_url":"https://github.com/asaaki.png","language":"Rust","funding_links":[],"categories":["Rust"],"sub_categories":[],"readme":"\u003ch1 align=\"center\"\u003e\u003cimg src=\"https://raw.githubusercontent.com/asaaki/opentelemetry-tide/main/.assets/opentelemetry-tide-logo.svg\" width=128 height=128\u003e\u003cbr\u003eopentelemetry-tide\u003c/h1\u003e\n\u003cdiv align=\"center\"\u003e\u003cstrong\u003e\n\n[OpenTelemetry] integration for [Tide]\n\n\u003c/strong\u003e\u003c/div\u003e\u003cbr /\u003e\n\n\u003cdiv align=\"center\"\u003e\n  \u003c!-- Crates version --\u003e\n  \u003ca href=\"https://crates.io/crates/opentelemetry-tide\"\u003e\n    \u003cimg src=\"https://img.shields.io/crates/v/opentelemetry-tide.svg?style=flat-square\"\n    alt=\"Crates.io version\" /\u003e\n  \u003c/a\u003e\n  \u003c!-- docs.rs --\u003e\n  \u003ca href=\"https://docs.rs/opentelemetry-tide\"\u003e\n    \u003cimg src=\"https://img.shields.io/badge/docs.rs-latest-blue.svg?style=flat-square\"\n      alt=\"docs.rs docs\" /\u003e\n    \u003c!-- \u003cimg src=\"https://docs.rs/opentelemetry-tide/badge.svg\"\n      alt=\"docs.rs docs\" /\u003e --\u003e\n  \u003c/a\u003e\n  \u003c!-- CI --\u003e\n  \u003ca href=\"https://crates.io/crates/opentelemetry-tide\"\u003e\n    \u003cimg src=\"https://img.shields.io/github/workflow/status/asaaki/opentelemetry-tide/CI/main?style=flat-square\"\n      alt=\"CI status\" /\u003e\n  \u003c/a\u003e\n  \u003c!-- Downloads --\u003e\n  \u003ca href=\"https://crates.io/crates/opentelemetry-tide\"\u003e\n    \u003cimg src=\"https://img.shields.io/crates/d/opentelemetry-tide.svg?style=flat-square\"\n      alt=\"Download\" /\u003e\n  \u003c/a\u003e\n\u003c/div\u003e\n\nAdd OpenTelemetry tracing and metrics support to your tide application.\nBe part of the new observability movement!\n\n## Notes\n\n* It only implements very basic request tracing on the middleware layer.\n  If you need spans for your executed code, you need to add them yourself.\n* It provides basic prometheus metrics, based on the [RED method].\n* This project got inspired by \u003chttps://github.com/OutThereLabs/actix-web-opentelemetry\u003e.\n* You probably do not want to use it in production. 🤷\n\n## How to use\n\n```sh\n# Run jaeger in background\ndocker run -d \\\n  -p6831:6831/udp -p6832:6832/udp -p16686:16686 -p14268:14268 \\\n  jaegertracing/all-in-one:latest\n\n# Run server example with tracing middleware\ncargo run --example server\n\n# Make a request or two ...\ncurl http://localhost:3000/\n\n# Open browser and view the traces\nfirefox http://localhost:16686/\n\n# Check the prometheus metrics endpoint\ncurl http://localhost:3000/metrics\n```\n\n## Example\n\n### `Cargo.toml`\n\n```toml\n# ...\n\n[dependencies]\nasync-std = { version = \"1.10\", features = [\"attributes\"] }\nopentelemetry = { version = \"0.17.0\", features = [\"rt-async-std\"] }\nopentelemetry-jaeger = { version = \"0.16.0\", features = [\"rt-async-std\"] }\nopentelemetry-tide = \"0.12\"\ntide = \"0.16\"\n```\n\n### `server.rs`\n\n```rust\nuse opentelemetry::{global, KeyValue, runtime};\nuse opentelemetry_semantic_conventions::resource;\nuse opentelemetry_tide::TideExt; // import trait\n\nconst VERSION: \u0026'static str = env!(\"CARGO_PKG_VERSION\");\n\n#[async_std::main]\nasync fn main() -\u003e Result\u003c(), Box\u003cdyn std::error::Error\u003e\u003e {\n    tide::log::with_level(tide::log::LevelFilter::Warn);\n\n    let tags = [resource::SERVICE_VERSION.string(VERSION)];\n\n    let _tracer = opentelemetry_jaeger::new_pipeline()\n        .with_tags(tags.iter().map(ToOwned::to_owned))\n        .install_batch(runtime::AsyncStd)\n        .expect(\"pipeline install failure\");\n    let tracer = global::tracer(\"example-server\");\n\n    let metrics_kvs = vec![KeyValue::new(\"K\", \"V\")];\n\n    let mut app = tide::new();\n\n    // use the trait\n    app.with_middlewares(tracer, Some(metrics_kvs));\n\n    app.at(\"/\").get(|_| async move {\n        Ok(\"Hello, OpenTelemetry!\")\n    });\n\n    app.listen(\"0.0.0.0:3000\").await?;\n\n    global::shutdown_tracer_provider();\n\n    Ok(())\n}\n```\n\n## Cargo Features\n\n|      flag | description |\n| --------: | :---------- |\n|   `trace` | enables **tracing** middleware; enabled by default\n| `metrics` | enables **metrics** middleware; enabled by default\n\n## Safety\n\nThis crate uses ``#![forbid(unsafe_code)]`` to ensure everything is implemented in 100% Safe Rust.\n\n## License\n\n\u003csup\u003e\nLicensed under either of\n  \u003ca href=\"https://raw.githubusercontent.com/asaaki/opentelemetry-tide/main/LICENSE-APACHE\"\u003eApache License, Version 2.0\u003c/a\u003e or\n  \u003ca href=\"https://raw.githubusercontent.com/asaaki/opentelemetry-tide/main/LICENSE-MIT\"\u003eMIT license\u003c/a\u003e\nat your option.\n\u003c/sup\u003e\n\n\u003cbr/\u003e\n\n\u003csub\u003e\nUnless you explicitly state otherwise, any contribution intentionally submitted\nfor inclusion in this crate by you, as defined in the Apache-2.0 license, shall\nbe dual licensed as above, without any additional terms or conditions.\n\u003c/sub\u003e\n\n\u003c!-- links --\u003e\n[OpenTelemetry]: https://crates.io/crates/opentelemetry\n[Tide]: https://crates.io/crates/tide\n[RED method]: https://www.weave.works/blog/the-red-method-key-metrics-for-microservices-architecture/\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fasaaki%2Fopentelemetry-tide","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fasaaki%2Fopentelemetry-tide","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fasaaki%2Fopentelemetry-tide/lists"}