{"id":28589613,"url":"https://github.com/fast/fastrace-reqwest","last_synced_at":"2025-07-30T21:34:41.729Z","repository":{"id":283063030,"uuid":"950560826","full_name":"fast/fastrace-reqwest","owner":"fast","description":"A reqwest util for propagating trace context for fastrace.","archived":false,"fork":false,"pushed_at":"2025-05-13T15:01:18.000Z","size":62,"stargazers_count":2,"open_issues_count":0,"forks_count":2,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-06-22T20:44:36.700Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","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/fast.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2025-03-18T10:56:00.000Z","updated_at":"2025-05-13T15:01:22.000Z","dependencies_parsed_at":"2025-03-18T11:41:12.454Z","dependency_job_id":"e437cf3d-564b-4c26-8653-d216cd2472ef","html_url":"https://github.com/fast/fastrace-reqwest","commit_stats":null,"previous_names":["fast/fastrace-reqwest"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/fast/fastrace-reqwest","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fast%2Ffastrace-reqwest","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fast%2Ffastrace-reqwest/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fast%2Ffastrace-reqwest/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fast%2Ffastrace-reqwest/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/fast","download_url":"https://codeload.github.com/fast/fastrace-reqwest/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fast%2Ffastrace-reqwest/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":266814491,"owners_count":23988552,"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","status":"online","status_checked_at":"2025-07-24T02:00:09.469Z","response_time":99,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":"2025-06-11T08:10:38.557Z","updated_at":"2025-07-30T21:34:41.707Z","avatar_url":"https://github.com/fast.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"# fastrace-reqwest\n\n[![Crates.io](https://img.shields.io/crates/v/fastrace-reqwest.svg?style=flat-square\u0026logo=rust)](https://crates.io/crates/fastrace-reqwest)\n[![Documentation](https://img.shields.io/docsrs/fastrace-reqwest?style=flat-square\u0026logo=rust)](https://docs.rs/fastrace-reqwest/)\n[![MSRV 1.82.0](https://img.shields.io/badge/MSRV-1.82.0-green?style=flat-square\u0026logo=rust)](https://www.whatrustisit.com)\n[![CI Status](https://img.shields.io/github/actions/workflow/status/fast/fastrace-reqwest/ci.yml?style=flat-square\u0026logo=github)](https://github.com/fast/fastrace-reqwest/actions)\n[![License](https://img.shields.io/crates/l/fastrace-reqwest?style=flat-square)](https://github.com/fast/fastrace-reqwest/blob/main/LICENSE)\n\nDistributed tracing integration for [reqwest](https://crates.io/crates/reqwest) HTTP client requests with [fastrace](https://crates.io/crates/fastrace).\n\n## Overview\n\n`fastrace-reqwest` provides automatic trace context propagation for HTTP requests made with the `reqwest` client. It works seamlessly with the `fastrace` library to extract and inject trace context into outgoing requests.\n\n## What is Context Propagation?\n\nContext propagation is a fundamental concept in distributed tracing that enables the correlation of operations spanning multiple services. When a request moves from one service to another, trace context information needs to be passed along, ensuring that all operations are recorded as part of the same trace.\n\n`fastrace-reqwest` implements the [W3C Trace Context](https://www.w3.org/TR/trace-context/) standard for propagating trace information between services. This ensures compatibility with other tracing systems that follow the same standard.\n\n## Features\n\n- 🔄 **Automatic Context Propagation**: Automatically inject trace context into outgoing HTTP requests.\n- 🌉 **Seamless Integration**: Works seamlessly with the `fastrace` library for complete distributed tracing.\n- 📊 **Full Compatibility**: Works with fastrace's collection and reporting capabilities.\n\n## Installation\n\nAdd to your `Cargo.toml`:\n\n```toml\n[dependencies]\nfastrace = \"0.7\"\nfastrace-reqwest = \"0.2\"\n```\n\n## Usage\n\n### HTTP Client\n\n```rust\nuse fastrace::prelude::*;\nuse fastrace_reqwest::traceparent_headers;\nuse reqwest::Client;\n\n#[fastrace::trace]\nasync fn send_request() {\n    let client = Client::new();\n    \n    // Add trace context headers to your request.\n    let response = client\n        .get(\"https://api.example.com/data\")\n        .headers(traceparent_headers())\n        .send()\n        .await\n        .unwrap();\n        \n    // Process response...\n}\n```\n\n## How It Works\n\n`fastrace-reqwest` enables automatic propagation of trace context between services by:\n\n1. **Extracting** the current trace context from the calling function.\n2. **Formatting** it according to the W3C Trace Context specification.\n3. **Injecting** it into outgoing HTTP requests as headers\n4. Working seamlessly with the companion `fastrace-poem` library (or other compatible frameworks) to extract the context on the receiving end.\n\n### Complete Example\n\nCheck out the [examples directory](https://github.com/fast/fastrace-reqwest/tree/main/examples) for complete working examples showing:\n\n- `client.rs` - How to send requests with trace context.\n- `server.rs` - How to receive and process trace context using `fastrace-poem`.\n\nTo run the examples:\n\n```bash\n# First start the server\ncargo run --example server\n\n# Then in another terminal, run the client\ncargo run --example client\n```\n\n## How It Works\n\n1. When making an HTTP request, `traceparent_headers()` checks for a current span context.\n2. If found, it encodes the context as a `traceparent` HTTP header following the W3C standard.\n3. The receiving service extracts this header and continues the trace.\n\n## License\n\nThis project is licensed under the [Apache-2.0](./LICENSE) license.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffast%2Ffastrace-reqwest","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ffast%2Ffastrace-reqwest","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffast%2Ffastrace-reqwest/lists"}