Skip to content

Commit

Permalink
Add PairExpansion Error
Browse files Browse the repository at this point in the history
  • Loading branch information
titaneric committed Dec 23, 2024
1 parent f12e9e2 commit 057456d
Showing 1 changed file with 2 additions and 7 deletions.
9 changes: 2 additions & 7 deletions src/transforms/log_to_metric.rs
Original file line number Diff line number Diff line change
Expand Up @@ -266,6 +266,7 @@ enum TransformError {
error: ParseFloatError,
},
TemplateRenderingError(TemplateRenderingError),
PairExpansionError,
}

fn render_template(template: &Template, event: &Event) -> Result<String, TransformError> {
Expand Down Expand Up @@ -351,13 +352,7 @@ fn render_tag_into(
Some(template) => match render_template(template, event) {
Ok(value_s) => {
let expanded_pairs = pair_expansion(key_s, value_s, static_tags, dynamic_tags)
.map_err(|_| {
TransformError::TemplateRenderingError(
TemplateRenderingError::MissingKeys {
missing_keys: vec![],
},
)
})?;
.map_err(|_| TransformError::PairExpansionError)?;

for (key, value) in expanded_pairs {
result.insert(key, TagValue::Value(value));
Expand Down

0 comments on commit 057456d

Please sign in to comment.