{"id":19147862,"url":"https://github.com/refcell/ddog","last_synced_at":"2025-05-07T03:04:14.444Z","repository":{"id":55524640,"uuid":"523040500","full_name":"refcell/ddog","owner":"refcell","description":"Minimal Datadog SDK Built in Pure Rust","archived":false,"fork":false,"pushed_at":"2023-08-11T15:26:03.000Z","size":774,"stargazers_count":7,"open_issues_count":0,"forks_count":2,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-05-05T15:54:38.295Z","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":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/refcell.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}},"created_at":"2022-08-09T17:08:51.000Z","updated_at":"2023-07-25T15:00:19.000Z","dependencies_parsed_at":"2024-11-09T07:52:40.042Z","dependency_job_id":"131b5144-ff2a-4dd2-aa9b-69ac816f62bd","html_url":"https://github.com/refcell/ddog","commit_stats":{"total_commits":26,"total_committers":1,"mean_commits":26.0,"dds":0.0,"last_synced_commit":"cec1bca915d927537421afdfeb91a358ad93cbf4"},"previous_names":["abigger87/ddog"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/refcell%2Fddog","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/refcell%2Fddog/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/refcell%2Fddog/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/refcell%2Fddog/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/refcell","download_url":"https://codeload.github.com/refcell/ddog/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":252544183,"owners_count":21765302,"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-09T07:52:35.287Z","updated_at":"2025-05-07T03:04:14.390Z","avatar_url":"https://github.com/refcell.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003cimg align=\"right\" width=\"150\" height=\"150\" top=\"100\" src=\"./assets/ddog.png\"\u003e\n\n# ddog • [![ci](https://github.com/abigger87/ddog/actions/workflows/ci.yaml/badge.svg)](https://github.com/abigger87/ddog/actions/workflows/ci.yaml) ![license](https://img.shields.io/github/license/abigger87/ddog?label=license) [![crates.io](https://img.shields.io/crates/v/ddog.svg)](https://crates.io/crates/ddog)\n\n\nA **Minimal** Datadog SDK Built in _Pure_ Rust.\n\n## Getting Started\n\nAdd the `ddog` crate to your project:\n\n```toml\nddog = \"0.1.0\"\n```\n\n\n## Usage\n\nThe simplest way to use the Datadog SDK is by using the [Builder](ddog::prelude::Builder).\n\nTo create a new builder, you can instantiate one with the [new](ddog::prelude::Builder::new) method: `let mut builder = ddog::prelude::Builder::new();`.\n\nThen, to create a new query with a given endpoint, the Builder has explicit methods exposed for the specified endpoint.\nFor example, to post metrics series data to datadog, call the [post_series](ddog::prelude::Builder::post_series) method which returns a [Route](ddog::prelude::tr::Route) trait.\n\n\n## Examples\n\nBelow we show how to use [ddog](https://github.com/abigger87/ddog) to post metric series data to the Datadog API.\n\nNote: This request will not succeed since the `DD_API_KEY` environment variable is set to an invalid value in the request headers section.\n\n```rust\nuse ddog::prelude::*;\n\nasync {\n    let mut builder = builder::Builder::new();\n    let (status, res) = builder.v2()\n        .post_series()\n        .headers(vec![\n            (\"Accept\", \"application/json\"),\n            (\"Content-Type\", \"application/json\"),\n            (\"DD-API-KEY\", \"\u003capi_key\u003e\"),\n            (\"DD-APPLICATION-KEY\", \"\u003capplication_key\u003e\"),\n        ])\n        .body(\n            r#\"{\n                \"series\": [{\n                    \"metric\": \"my.metric.name\",\n                    \"type\": 1,\n                    \"interval\": 100000,\n                    \"unit\": \"count\",\n                    \"tags\": [ \"my_tag:\" ],\n                    \"source_type_name\": \"my_source_type\",\n                    \"resources\": [{\n                        \"name\": \"length\",\n                        \"type\": \"time\"\n                    }],\n                    \"points\": [\n                        { \"timestamp\": 1660157680, \"value\": 10.0 },\n                    ],\n                    \"metadata\": {\n                        \"origin\": {\n                            \"metric_type\": 1,\n                            \"product\": 1,\n                            \"service\": 1\n                        }\n                    }\n                }]\n            }\"#\n        )\n        .execute().await;\n    // This should return a 403 status code now since the above API key is invalid.\n    println!(\"Status Code: {:?}\", status);\n    println!(\"Response: {:?}\", res);\n};\n```\n\n\n## License\n\n[AGPL-3.0-only](https://github.com/abigger87/ddog/blob/master/LICENSE)\n\n\n## Acknowledgements\n\n- [datadog-apm-rust-sync](https://github.com/kitsuneninetails/datadog-apm-rust-sync)\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frefcell%2Fddog","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frefcell%2Fddog","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frefcell%2Fddog/lists"}