Skip to main content

saluki_components/config_registry/datadog/
dogstatsd_mapper.rs

1//! Annotations for DogStatsD mapper transform configuration keys.
2use crate::config_registry::{
3    generated::schema, structs, Pipeline, PipelineAffinity, SalukiAnnotation, Schema, SchemaEntry, SupportLevel,
4    ValueType,
5};
6
7// ADP-specific keys not present in the vendored Agent schema.
8static DOGSTATSD_MAPPER_STRING_INTERNER_SIZE_SCHEMA: SchemaEntry = SchemaEntry {
9    schema: Schema::Saluki,
10    yaml_path: "dogstatsd_mapper_string_interner_size",
11    env_vars: &[],
12    value_type: ValueType::Integer,
13    default: None,
14};
15
16crate::declare_annotations! {
17    /// `dogstatsd_mapper_cache_size`—per-name result cache capacity for the mapper transform.
18    /// Schema Float; field usize.
19    DOGSTATSD_MAPPER_CACHE_SIZE = SalukiAnnotation {
20        schema: &schema::DOGSTATSD_MAPPER_CACHE_SIZE,
21        support_level: SupportLevel::Full,
22        additional_yaml_paths: &[],
23        env_var_override: None,
24        used_by: &[structs::DOGSTATSD_MAPPER_CONFIGURATION],
25        value_type_override: Some(ValueType::Integer),
26        test_json: None,
27        pipeline_affinity: PipelineAffinity::Pipelines(&[Pipeline::DogStatsD]),
28    };
29
30    /// `dogstatsd_mapper_profiles`—JSON-encoded list of DogStatsD metric mapping profiles.
31    /// Uses a custom test value since the generic String test value isn't valid mapper JSON.
32    DOGSTATSD_MAPPER_PROFILES = SalukiAnnotation {
33        schema: &schema::DOGSTATSD_MAPPER_PROFILES,
34        support_level: SupportLevel::Full,
35        additional_yaml_paths: &[],
36        env_var_override: None,
37        used_by: &[structs::DOGSTATSD_MAPPER_CONFIGURATION],
38        value_type_override: None,
39        test_json: Some(r#"[{"name":"test","prefix":"test.","mappings":[]}]"#),
40        pipeline_affinity: PipelineAffinity::Pipelines(&[Pipeline::DogStatsD]),
41    };
42
43    /// `dogstatsd_mapper_string_interner_size`—interner byte budget for the mapper transform.
44    /// ADP-specific key, not in the Agent schema.
45    DOGSTATSD_MAPPER_STRING_INTERNER_SIZE = SalukiAnnotation {
46        schema: &DOGSTATSD_MAPPER_STRING_INTERNER_SIZE_SCHEMA,
47        support_level: SupportLevel::Full,
48        additional_yaml_paths: &[],
49        env_var_override: None,
50        used_by: &[structs::DOGSTATSD_MAPPER_CONFIGURATION],
51        value_type_override: None,
52        test_json: None,
53        pipeline_affinity: PipelineAffinity::Pipelines(&[Pipeline::DogStatsD]),
54    };
55}