Skip to content

Commit

Permalink
chore: add default origin enrichment configuration (#472)
Browse files Browse the repository at this point in the history
## Summary
<!-- Please provide a brief summary about what this PR does.
This should help the reviewers give feedback faster and with higher
quality. -->
Adds `#[serde(default)]` to `origin_enrichment` 
## Change Type
- [ ] Bug fix
- [ ] New feature
- [x] Non-functional (chore, refactoring, docs)
- [ ] Performance


## How did you test this PR?
<!-- Please how you tested these changes here -->
N/A
## References
N/A
<!-- Please list any issues closed by this PR. -->

<!--
- Closes: <issue link>
-->

<!-- Any other issues or PRs relevant to this PR? Feel free to list them
here. -->
  • Loading branch information
rayz authored Feb 3, 2025
1 parent 6683843 commit 0843c37
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 0 deletions.
1 change: 1 addition & 0 deletions lib/saluki-components/src/sources/dogstatsd/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -224,6 +224,7 @@ pub struct DogStatsDConfiguration {
enable_payloads_sketches: bool,

/// Configuration related to origin detection and enrichment.
#[serde(flatten, default)]
origin_enrichment: OriginEnrichmentConfiguration,

/// Workload provider to utilize for origin detection/enrichment.
Expand Down
11 changes: 11 additions & 0 deletions lib/saluki-components/src/sources/dogstatsd/origin.rs
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,17 @@ pub struct OriginEnrichmentConfiguration {
origin_detection_optout: bool,
}

impl Default for OriginEnrichmentConfiguration {
fn default() -> Self {
Self {
entity_id_precedence: false,
tag_cardinality: default_tag_cardinality(),
origin_detection_unified: false,
origin_detection_optout: default_origin_detection_optout(),
}
}
}

pub(super) struct DogStatsDOriginTagResolver {
config: OriginEnrichmentConfiguration,
workload_provider: Arc<dyn WorkloadProvider + Send + Sync>,
Expand Down

0 comments on commit 0843c37

Please sign in to comment.