Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
76 changes: 45 additions & 31 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

14 changes: 13 additions & 1 deletion pulse-metrics/src/pipeline/processor/mutate/mod_test.rs
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,9 @@ async fn pulse_inc_counter() {
let mut helper = Helper::new(
r#"
if .name == "kube_job_status_failed" {
pulse_inc_counter("hello", 1)
pulse_inc_counter!("hello", 1)
pulse_inc_counter!("hello_with_tags", 1, ["tag1"], ["value1"])
pulse_inc_counter!("hello_with_tags", 1, ["tag1"], ["value2"])
}
"#,
);
Expand All @@ -101,6 +103,16 @@ if .name == "kube_job_status_failed" {
.helper
.stats_helper
.assert_counter_eq(1, "processor:hello", &labels! {});
helper.helper.stats_helper.assert_counter_eq(
1,
"processor:hello_with_tags",
&labels! { "tag1" => "value1" },
);
helper.helper.stats_helper.assert_counter_eq(
1,
"processor:hello_with_tags",
&labels! { "tag1" => "value2" },
);
}

#[tokio::test(start_paused = true)]
Expand Down
4 changes: 4 additions & 0 deletions pulse-metrics/src/vrl/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -328,6 +328,10 @@ impl ProgramWrapper {

let mut compile_config = CompileConfig::default();
compile_config.set_custom(dynamic_state);
// TODO(mattklein123): This yields false positives on the functions that we added as the
// unused checker operates on the raw AST and does not use the underlying typedef info. This
// is not easy to fix so just disable this for now.
compile_config.disable_unused_expression_check();

let result = compile_with_external(program, &functions, &external, compile_config)
.map_err(|e| anyhow!("VRL compile error: {}", Formatter::new(program, e)))?;
Expand Down
Loading
Loading