-
Notifications
You must be signed in to change notification settings - Fork 313
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix(otlp): replace otlp trace attr type from string to jsonb #4918
base: main
Are you sure you want to change the base?
Conversation
Important Review skippedAuto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the You can disable this status message by setting the Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
Documentation and Community
|
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #4918 +/- ##
==========================================
- Coverage 84.14% 83.79% -0.36%
==========================================
Files 1141 1143 +2
Lines 211063 211679 +616
==========================================
- Hits 177606 177374 -232
- Misses 33457 34305 +848 |
we need to add a test case for trace table name customization |
chore: adjust traces schema order
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Rest LGTM
fn parse_header_value_to_string(header: &HeaderValue) -> Result<String> { | ||
String::from_utf8(header.as_bytes().to_vec()).context(InvalidUtf8ValueSnafu) | ||
} | ||
|
||
fn parse_pipeline_header_value_to_string( | ||
header: &HeaderValue, | ||
key: &str, | ||
) -> StdResult<String, (http::StatusCode, String)> { | ||
let header_utf8 = str::from_utf8(header.as_bytes()); | ||
match header_utf8 { | ||
Ok(s) => Ok(s.to_string()), | ||
Err(_) => Err(( | ||
header_name: &str, | ||
) -> StdResult<String, (StatusCode, String)> { | ||
parse_header_value_to_string(header).map_err(|_| { | ||
( | ||
StatusCode::BAD_REQUEST, | ||
format!("`{}` header is not valid UTF-8 string type.", key), | ||
)), | ||
format!("`{}` header is not valid UTF-8 string type.", header_name), | ||
) | ||
}) | ||
} | ||
|
||
fn extract_table_name_from_header( | ||
headers: &HeaderMap, | ||
header: &str, | ||
default_table_name: &str, | ||
) -> Result<String> { | ||
let table_name = headers.get(header); | ||
match table_name { | ||
Some(name) => parse_header_value_to_string(name), | ||
None => Ok(default_table_name.to_string()), | ||
} | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It looks like we can merge all these three functions.
@@ -23,7 +23,7 @@ use crate::error::Result; | |||
use crate::row_writer::{self, MultiTableData, TableData}; | |||
|
|||
const APPROXIMATE_COLUMN_COUNT: usize = 24; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Change this value accordingly.
Also is this a breaking change? |
Currently trace is not open to the public. So these changes are fine. |
I hereby agree to the terms of the GreptimeDB CLA.
Refer to a related PR or issue link (optional)
#4873
What's changed and what's your intention?
Checklist