Skip to content
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

Support property #17

Merged
merged 16 commits into from
Jul 22, 2020
Merged

Support property #17

merged 16 commits into from
Jul 22, 2020

Conversation

zhongzc
Copy link
Collaborator

@zhongzc zhongzc commented Jul 22, 2020

In some cases, an event is not enough for developers to get what they want during tracing. They may want to record some other information, e.g. host of the request, CPU usage.

For that, a mechanism is implemented to achieve that goal. Developers can attach information to the current span in bytes format:

let _guard = minitrace::new_span(event_id);
minitrace::property(info_bytes_0);
minitrace::property(info_bytes_1);

The property is in bytes format, so it is not limited to be a key-value pair but anything developers intend. However, the downside of flexibility is that encoding and decoding should be handled handly.

Signed-off-by: zhongzc <zhongzc_arch@outlook.com>
Signed-off-by: zhongzc <zhongzc_arch@outlook.com>
Signed-off-by: zhongzc <zhongzc_arch@outlook.com>
Signed-off-by: zhongzc <zhongzc_arch@outlook.com>
@zhongzc zhongzc requested a review from Renkai July 22, 2020 04:49
Signed-off-by: zhongzc <zhongzc_arch@outlook.com>
Signed-off-by: zhongzc <zhongzc_arch@outlook.com>
Signed-off-by: zhongzc <zhongzc_arch@outlook.com>
Signed-off-by: zhongzc <zhongzc_arch@outlook.com>
Signed-off-by: zhongzc <zhongzc_arch@outlook.com>
Signed-off-by: zhongzc <zhongzc_arch@outlook.com>
Signed-off-by: zhongzc <zhongzc_arch@outlook.com>
@Renkai
Copy link
Contributor

Renkai commented Jul 22, 2020

Is there any design document for property?

Signed-off-by: zhongzc <zhongzc_arch@outlook.com>
Signed-off-by: zhongzc <zhongzc_arch@outlook.com>
Signed-off-by: zhongzc <zhongzc_arch@outlook.com>
Signed-off-by: zhongzc <zhongzc_arch@outlook.com>
@@ -55,7 +55,23 @@ pub enum Link {
Continue { id: u64 },
}

#[derive(Debug, Clone, Eq, PartialEq)]
/// span id -> property
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Content in this PR description can put here

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

Signed-off-by: zhongzc <zhongzc_arch@outlook.com>
@zhongzc zhongzc merged commit 3d6a645 into master Jul 22, 2020
@zhongzc zhongzc deleted the property branch July 22, 2020 09:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants