Skip to content

Commit

Permalink
Bump openmetrics parser
Browse files Browse the repository at this point in the history
This brings in the fix for sinkingpoint/openmetrics-parser#2

Signed-off-by: sinkingpoint <[email protected]>
  • Loading branch information
sinkingpoint committed Nov 16, 2023
1 parent e0c7104 commit a942629
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 3 deletions.
4 changes: 2 additions & 2 deletions Cargo.lock

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

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ keywords = ["openmetrics", "prometheus", "pushgateway"]
[dependencies]
tokio = { version = "1", features = ["full"] }
warp = "0.3"
openmetrics-parser = "0.4.2"
openmetrics-parser = "0.4.4"
serde = { version = "1.0", features = ["derive"] }
serde_json = "1.0"
clap = "2.33.3"
Expand Down
16 changes: 16 additions & 0 deletions src/aggregator_test.rs
Original file line number Diff line number Diff line change
Expand Up @@ -228,3 +228,19 @@ number_of_transactions_total{label=\"value\"} 1

assert!(result.is_ok(), "failed to parse valid metric: {:?}", result.err());
}

#[tokio::test]
async fn test_openmetrics_parser_2() {
// https://github.com/sinkingpoint/openmetrics-parser/issues/2

let mut agg = Aggregator::new();
let result = agg.parse_and_merge("example_test_counter_total{foo=\"bar\"} 0
", &HashMap::new()).await;

assert!(result.is_ok(), "failed to parse valid metric: {:?}", result.err());

let result = agg.parse_and_merge("example_test_counter_total{foo=\"bar\"} 0.01
", &HashMap::new()).await;

assert!(result.is_ok(), "failed to parse valid metric: {:?}", result.err());
}

0 comments on commit a942629

Please sign in to comment.