From 3f505b47d8154e72b70dbf3fafa76f48dc2faaf1 Mon Sep 17 00:00:00 2001 From: jerbly Date: Sun, 10 Nov 2024 21:25:09 -0500 Subject: [PATCH] 0.5.2 --- CHANGELOG.md | 4 ++++ Cargo.lock | 2 +- Cargo.toml | 2 +- src/main.rs | 26 +++++++------------------- src/octo.rs | 8 +++----- src/semconv.rs | 5 ++++- 6 files changed, 20 insertions(+), 27 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 3213be4..51d3f88 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,7 @@ +# 0.5.2 + +- The `allow_custom_values` setting for enums has been removed from the semantic conventions spec. Removed all related code. This field will now just be ignored. + # 0.5.1 - Fixed: Groups were not loading if the `prefix` was missing. diff --git a/Cargo.lock b/Cargo.lock index c8af802..8d60bdc 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -528,7 +528,7 @@ checksum = "d231dfb89cfffdbc30e7fc41579ed6066ad03abda9e567ccafae602b97ec5024" [[package]] name = "honey-health" -version = "0.5.1" +version = "0.5.2" dependencies = [ "anyhow", "clap", diff --git a/Cargo.toml b/Cargo.toml index b7d2509..51adb70 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "honey-health" -version = "0.5.1" +version = "0.5.2" edition = "2021" authors = ["Jeremy Blythe "] repository = "https://github.com/jerbly/honey-health" diff --git a/src/main.rs b/src/main.rs index 51d2558..93a4360 100644 --- a/src/main.rs +++ b/src/main.rs @@ -343,7 +343,7 @@ impl ColumnUsageMap { fn print_enum_report( &self, - enum_report_rows: &Vec<(String, bool, Vec)>, + enum_report_rows: &Vec<(String, Vec)>, ) -> anyhow::Result<()> { // If there's only one dataset, print the enum comparisons if self.datasets.len() != 1 { @@ -358,16 +358,9 @@ impl ColumnUsageMap { width = longest ); - for (c, allow_custom_values, found_variants) in enum_report_rows { + for (c, found_variants) in enum_report_rows { if found_variants.is_empty() { println!("{:>width$}", c.green(), width = longest); - } else if *allow_custom_values { - println!( - "{:>width$} {}", - c.yellow(), - found_variants.join(", "), - width = longest - ); } else { println!( "{:>width$} {}", @@ -383,7 +376,7 @@ impl ColumnUsageMap { fn markdown_enum_report( &self, - enum_report_rows: Vec<(String, bool, Vec)>, + enum_report_rows: Vec<(String, Vec)>, ) -> anyhow::Result<(String, Vec)> { let dataset_slug = &self.datasets[0]; let markdown_header = format!("## Dataset: {}\n\n", dataset_slug); @@ -392,18 +385,13 @@ impl ColumnUsageMap { let mut row_strings = vec![]; let mut c_len = "Column".len(); let mut v_len = "Undefined-variants".len(); - for (c, allow_custom_values, found_variants) in enum_report_rows { + for (c, found_variants) in enum_report_rows { if !found_variants.is_empty() { let c_name = format!("`{}`", c); c_len = c_len.max(c_name.len()); let variants = format!("`{}`", found_variants.join("`, `")); v_len = v_len.max(variants.len()); - let kind = if allow_custom_values { - "Warning".to_owned() - } else { - "Error".to_owned() - }; - row_strings.push((c_name, kind, variants)); + row_strings.push((c_name, "Error".to_owned(), variants)); } } @@ -439,7 +427,7 @@ impl ColumnUsageMap { Ok((markdown_header, markdown)) } - async fn enum_report(&self) -> anyhow::Result)>> { + async fn enum_report(&self) -> anyhow::Result)>> { let mut v_results = Vec::new(); // If there's only one dataset, print the enum comparisons @@ -483,7 +471,7 @@ impl ColumnUsageMap { let defined_variants = atype.get_simple_variants(); // remove all defined enums from found_enums found_variants.retain(|e| !defined_variants.contains(e)); - v_results.push((c, atype.allow_custom_values, found_variants)); + v_results.push((c, found_variants)); } } } diff --git a/src/octo.rs b/src/octo.rs index cb8ba07..78e8ed2 100644 --- a/src/octo.rs +++ b/src/octo.rs @@ -16,7 +16,7 @@ pub async fn create_dataset_report_issue( Suggestions are given to help improve these attributes.\n\n \ [\"Effective trace instrumentation with semantic conventions\"](https://www.honeycomb.io/blog/effective-trace-instrumentation-semantic-conventions) \ may help you improve your instrumentation.\n\n \ - _Note: If the report is too large, it will been split into multiple comments._\n\n", + _Note: If the report is too large, it will be split into multiple comments._\n\n", ); create_table_issue( @@ -40,10 +40,8 @@ pub async fn create_enum_report_issue( markdown_header.push_str( "This report was generated by [honey-health](https://github.com/jerbly/honey-health). \ The table shows enum columns found in the dataset with variants undefined in semantic conventions. \ - This _could_ be an indication of data quality issues.\n\n\ - Enums defined with `allow_custom_values` are reported as warnings. These warnings should be checked - mistakes with \ - casing or typos can lead to incorrect variants.\n\n\ - _Note: If the report is too large, it will been split into multiple comments._\n\n"); + This _could_ be an indication of data quality issues. Mistakes with casing or typos can lead to incorrect variants.\n\n\ + _Note: If the report is too large, it will be split into multiple comments._\n\n"); create_table_issue( repo_owner, diff --git a/src/semconv.rs b/src/semconv.rs index 0d073e0..051a202 100644 --- a/src/semconv.rs +++ b/src/semconv.rs @@ -113,7 +113,6 @@ pub struct Member { #[derive(Debug, Deserialize, Clone)] pub struct ComplexType { #[serde(default)] - pub allow_custom_values: bool, pub members: Vec, } @@ -202,7 +201,11 @@ impl SemanticConventions { "meta.annotation_type", "parent_name", "status_code", + "status_message", "error", + "meta.time_since_span_start_ms", + "trace.link.trace_id", + "trace.link.span_id", ]; for builtin in builtins { self.attribute_map.insert(builtin.to_owned(), None);