-
Notifications
You must be signed in to change notification settings - Fork 10
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
Convert local root span id to u64, fix clippy lints #80
Merged
Merged
Changes from 7 commits
Commits
Show all changes
10 commits
Select commit
Hold shift + click to select a range
4990cc4
Convert local root span id to u64, fix clippy lints
morrisonlevi 85cdec2
Fix path
morrisonlevi e391261
add test for root_span_id label as `str` or `i64`
realFlowControl 3eb917a
Test trace endpoint labels too
morrisonlevi 0a83855
Ensure local root span id uses .num label value
morrisonlevi d6ab0bd
Fix clippy::manual-map lint
morrisonlevi 344b3e3
Fix clippy::needless_question_mark lint
morrisonlevi e131455
Eagerly store certain strings
morrisonlevi 2d662d4
Merge branch 'main' into levi/endpoint-num
morrisonlevi 1d3096e
Test span ids larger than i64::MAX
morrisonlevi File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -353,22 +353,20 @@ pub extern "C" fn ddog_prof_Profile_add( | |
/// | ||
/// # Arguments | ||
/// * `profile` - a reference to the profile that will contain the samples. | ||
/// * `local_root_span_id` - the value of the local root span id label to look for. | ||
/// * `local_root_span_id` | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Minor: This is a weird change -- was it intentional? |
||
/// * `endpoint` - the value of the endpoint label to add for matching samples. | ||
/// | ||
/// # Safety | ||
/// The `profile` ptr must point to a valid Profile object created by this | ||
/// module. | ||
/// This call is _NOT_ thread-safe. | ||
#[no_mangle] | ||
pub unsafe extern "C" fn ddog_prof_Profile_set_endpoint<'a>( | ||
pub unsafe extern "C" fn ddog_prof_Profile_set_endpoint( | ||
profile: &mut datadog_profiling::profile::Profile, | ||
local_root_span_id: CharSlice<'a>, | ||
endpoint: CharSlice<'a>, | ||
local_root_span_id: u64, | ||
endpoint: CharSlice, | ||
) { | ||
let local_root_span_id = local_root_span_id.to_utf8_lossy(); | ||
let endpoint = endpoint.to_utf8_lossy(); | ||
|
||
profile.add_endpoint(local_root_span_id, endpoint); | ||
} | ||
|
||
|
@@ -451,9 +449,7 @@ pub unsafe extern "C" fn ddog_prof_Profile_serialize( | |
Some(x) if *x < 0 => None, | ||
Some(x) => Some(Duration::from_nanos((*x) as u64)), | ||
}; | ||
match || -> anyhow::Result<datadog_profiling::profile::EncodedProfile> { | ||
Ok(profile.serialize(end_time, duration)?) | ||
}() { | ||
match profile.serialize(end_time, duration) { | ||
Ok(ok) => SerializeResult::Ok(ok.into()), | ||
Err(err) => SerializeResult::Err(err.into()), | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
Interesting -- is there no extended way for
format!
that can embed&agent_url
directly?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.
No, the inline format values can only contain simple identifiers https://rust-lang.github.io/rfcs/2795-format-args-implicit-identifiers.html
For the sake of uniformity, maybe named arguments would be better