{"id":20045593,"url":"https://github.com/pepabo/dd-trace-layer","last_synced_at":"2025-05-05T09:30:53.133Z","repository":{"id":60951420,"uuid":"547006019","full_name":"pepabo/dd-trace-layer","owner":"pepabo","description":null,"archived":false,"fork":false,"pushed_at":"2025-03-12T00:47:05.000Z","size":22,"stargazers_count":5,"open_issues_count":5,"forks_count":0,"subscribers_count":7,"default_branch":"main","last_synced_at":"2025-04-08T20:45:43.153Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/pepabo.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2022-10-07T01:58:25.000Z","updated_at":"2024-12-12T10:23:28.000Z","dependencies_parsed_at":"2022-10-07T06:55:32.054Z","dependency_job_id":null,"html_url":"https://github.com/pepabo/dd-trace-layer","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pepabo%2Fdd-trace-layer","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pepabo%2Fdd-trace-layer/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pepabo%2Fdd-trace-layer/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pepabo%2Fdd-trace-layer/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/pepabo","download_url":"https://codeload.github.com/pepabo/dd-trace-layer/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":252471333,"owners_count":21753150,"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":[],"created_at":"2024-11-13T11:18:07.018Z","updated_at":"2025-05-05T09:30:52.754Z","avatar_url":"https://github.com/pepabo.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"# dd-trace-layer\n`dd-trace-layer` is a middleware for sending Datadog's trace. It's based on [Tower](https://github.com/tower-rs/tower) and [OpenTelemetry Rust](https://github.com/open-telemetry/opentelemetry-rust).\n\n## Usage\nThis can be used in [`hyper`](https://github.com/hyperium/hyper) or [`axum`](https://github.com/tokio-rs/axum), etc. See [examples](./examples).\n\n```rust\nuse dd_trace_layer::{init, ApiVersion, DDTraceLayer};\nuse hyper::{server::Server, Body, Error, Request, Response};\nuse std::net::SocketAddr;\nuse tower::{make::Shared, ServiceBuilder};\n\n#[tokio::main]\nasync fn main() {\n    init(\"service_name\", \"http://localhost:8126\", ApiVersion::Version05);\n\n    let service = ServiceBuilder::new()\n        .layer(DDTraceLayer::new(\"operation_name\".to_string()))\n        .service_fn(hello_world);\n\n    let addr = SocketAddr::from(([127, 0, 0, 1], 8080));\n    Server::bind(\u0026addr)\n        .serve(Shared::new(service))\n        .await\n        .expect(\"server error\");\n}\n\nasync fn hello_world(_: Request\u003cBody\u003e) -\u003e Result\u003cResponse\u003cBody\u003e, Error\u003e {\n    Ok(Response::new(Body::from(\"Hello, World!\")))\n}\n```\n\n## Contributing\n1. Fork\n2. Create a feature branch\n3. Commit your changes\n4. Rebase your local changes against the main branch\n5. Run test suite with the `cargo test` command and confirm that it passes\n6. Run `cargo fmt` and pass `cargo clippy`\n7. Create new Pull Request","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpepabo%2Fdd-trace-layer","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpepabo%2Fdd-trace-layer","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpepabo%2Fdd-trace-layer/lists"}