Skip to content

Commit 829e93d

Browse files
ajgajg1134bwoebihoolioh
authored
Health Metrics for data-pipeline + Dogstatsd-Client Crate (#638)
* move dogstatsd-client to separate crate so it can be shared * adding some initial stats and tests * make traceexporter mut * miri can ignore unit test * refactor dogstatsd-client to not need mutability * use vec default to avoid unneeded allocation * fmt * add dogstatsd-client to docker build tool * clean up cargo.toml * remove unneeded dep * use AsRef for metric strings, improve perf and simplify usage * simplify emitting stats in data-pipeline * fix lint * Remove copy of tags and pass to dogstatsd client by reference * Update licenses * Allow IntoIterator tags to support static and dynamic tags: WIP * Fix lifetimes of DogstatsDAction Signed-off-by: Bob Weinand <[email protected]> * Actually also allow &Vec<Tag> and &[Tag] Signed-off-by: Bob Weinand <[email protected]> * cargo fmt * disable cargo bench in dogstatd-client, we use criterion * Try using iterators in data-pipeline for metrics * bump ver * more metrics * Split dogstatsdaction type to simplify code * move to owned type for sidecar-ffi * remove unused import * more unused * Add variant check * add test that fails when dogstatsdAction is updated * fix tests * use either to simplify emit_metric code * resolve todo * Add docs and initial PR review comments * more docs and readme * add ticket for todo * PR comments * remove unused import * license header * rename flusher to client * fix names * Add dogstatd-client. * add more anyhow errors for easier debugging building dogstatsd client --------- Signed-off-by: Bob Weinand <[email protected]> Co-authored-by: Bob Weinand <[email protected]> Co-authored-by: Julio Gonzalez <[email protected]>
1 parent 59aacd2 commit 829e93d

21 files changed

+659
-292
lines changed

.codecov.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,10 @@ component_management:
3131
name: ddtelemetry # this is a display name, and can be changed freely
3232
paths:
3333
- ddtelemetry
34+
- component_id: dogstatsd-client # this is an identifier that should not be changed
35+
name: dogstatsd-client # this is a display name, and can be changed freely
36+
paths:
37+
- dogstatsd-client
3438
- component_id: ipc # this is an identifier that should not be changed
3539
name: ipc # this is a display name, and can be changed freely
3640
paths:

Cargo.lock

Lines changed: 22 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@ members = [
3434
"data-pipeline-ffi",
3535
"ddsketch",
3636
"tinybytes",
37+
"dogstatsd-client",
3738
]
3839

3940
# https://doc.rust-lang.org/cargo/reference/resolver.html#feature-resolver-version-2

LICENSE-3rdparty.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
root_name: datadog-alloc, builder, build_common, datadog-profiling-ffi, data-pipeline-ffi, data-pipeline, datadog-ddsketch, datadog-trace-normalization, datadog-trace-protobuf, datadog-trace-obfuscation, datadog-trace-utils, ddcommon, tinybytes, ddcommon-ffi, datadog-crashtracker-ffi, datadog-crashtracker, ddtelemetry, datadog-profiling, ddtelemetry-ffi, symbolizer-ffi, tools, datadog-profiling-replayer, dogstatsd, datadog-ipc, datadog-ipc-macros, tarpc, tarpc-plugins, spawn_worker, cc_utils, datadog-sidecar, datadog-remote-config, datadog-dynamic-configuration, datadog-sidecar-macros, datadog-sidecar-ffi, sidecar_mockgen, test_spawn_from_lib, datadog-serverless-trace-mini-agent, datadog-trace-mini-agent
1+
root_name: datadog-alloc, builder, build_common, datadog-profiling-ffi, data-pipeline-ffi, data-pipeline, datadog-ddsketch, datadog-trace-normalization, datadog-trace-protobuf, datadog-trace-obfuscation, datadog-trace-utils, ddcommon, tinybytes, dogstatsd-client, ddcommon-ffi, datadog-crashtracker-ffi, datadog-crashtracker, ddtelemetry, datadog-profiling, ddtelemetry-ffi, symbolizer-ffi, tools, datadog-profiling-replayer, dogstatsd, datadog-ipc, datadog-ipc-macros, tarpc, tarpc-plugins, spawn_worker, cc_utils, datadog-sidecar, datadog-remote-config, datadog-dynamic-configuration, datadog-sidecar-macros, datadog-sidecar-ffi, sidecar_mockgen, test_spawn_from_lib, datadog-serverless-trace-mini-agent, datadog-trace-mini-agent
22
third_party_libraries:
33
- package_name: addr2line
44
package_version: 0.21.0
@@ -10338,7 +10338,7 @@ third_party_libraries:
1033810338
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
1033910339
SOFTWARE.
1034010340
- package_name: either
10341-
package_version: 1.10.0
10341+
package_version: 1.13.0
1034210342
repository: https://github.com/rayon-rs/either
1034310343
license: MIT OR Apache-2.0
1034410344
licenses:

data-pipeline/Cargo.toml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,14 +16,16 @@ hyper = {version = "0.14", features = ["client"], default-features = false}
1616
log = "0.4"
1717
rmp-serde = "1.1.1"
1818
bytes = "1.4"
19+
either = "1.13.0"
1920
tokio = { version = "1.23", features = ["rt", "test-util", "time"], default-features = false }
2021

2122
ddcommon = { path = "../ddcommon" }
2223
datadog-trace-protobuf = { path = "../trace-protobuf" }
2324
datadog-trace-utils = { path = "../trace-utils" }
2425
datadog-trace-normalization = { path = "../trace-normalization" }
26+
datadog-ddsketch = { path = "../ddsketch"}
27+
dogstatsd-client = { path = "../dogstatsd-client"}
2528
datadog-trace-obfuscation = { path = "../trace-obfuscation" }
26-
datadog-ddsketch = { path = "../ddsketch" }
2729
uuid = { version = "1.10.0", features = ["v4"] }
2830
tokio-util = "0.7.11"
2931

data-pipeline/src/health_metrics.rs

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
// Copyright 2024-Present Datadog, Inc. https://www.datadoghq.com/
2+
// SPDX-License-Identifier: Apache-2.0
3+
4+
/// health_metrics holds data to emit info about the health of the data-pipeline
5+
6+
pub(crate) const STAT_SEND_TRACES: &str = "datadog.libdatadog.send.traces";
7+
pub(crate) const STAT_SEND_TRACES_ERRORS: &str = "datadog.libdatadog.send.traces.errors";
8+
pub(crate) const STAT_DESER_TRACES: &str = "datadog.libdatadog.deser_traces";
9+
pub(crate) const STAT_DESER_TRACES_ERRORS: &str = "datadog.libdatadog.deser_traces.errors";
10+
pub(crate) const STAT_SER_TRACES_ERRORS: &str = "datadog.libdatadog.ser_traces.errors";
11+
12+
pub(crate) enum HealthMetric {
13+
Count(&'static str, i64),
14+
}

data-pipeline/src/lib.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
//! project at this state is to provide a basic API in order to test its viability and integration
77
//! in different languages.
88
9+
mod health_metrics;
910
#[allow(missing_docs)]
1011
pub mod span_concentrator;
1112
#[allow(missing_docs)]

0 commit comments

Comments
 (0)