-
Notifications
You must be signed in to change notification settings - Fork 18
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
Add tracer. #26
Add tracer. #26
Conversation
Codecov Report
@@ Coverage Diff @@
## master #26 +/- ##
===========================================
- Coverage 86.91% 75.29% -11.63%
===========================================
Files 9 10 +1
Lines 298 344 +46
===========================================
Hits 259 259
- Misses 39 85 +46
Continue to review full report at Codecov.
|
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.
Usually, this concept in SDK should be called TRACER
, rather than ContextManager.
I used ContextManager in Java as we have a tracer manual API, so I don't want to create a duplicated one.
go2sky(golang SDK) is using this concept, https://github.com/SkyAPM/go2sky#quickstart.
README.md
Outdated
@@ -38,7 +38,7 @@ use skywalking::context::trace_context::TracingContext; | |||
use skywalking::reporter::grpc::Reporter; | |||
use tokio; | |||
|
|||
async fn handle_request(reporter: ContextReporter) { | |||
async fn handle_request(reporter: Reporter) { |
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.
I think we should add a new API's doc here.
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.
Maybe we can integrate Tracer
and Reporter
, like in go.
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.
Yes, agree.
And whether they should be const, most likely user's choice, right?
We don't have to require that.
Is this API OK? If yes, I continue to modify e2e. |
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.
Mostly good, one thing to be uncertain.
README.md
Outdated
|
||
// Start server... | ||
// Block to report. |
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.
What does block to report work for?
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.
What does block to report work for?
Because dead loop to receive segment to collect, and wait a shutdown signal, will block.
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.
How about changing this to
Open reporter as daemon thread(or something more precious in rust) to run.
Block seems a negative word.
WDYT?
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.
Already collect as daemon, the block is waiting shutdown signal, otherwise the graceful shutdown cannot be done.
The latest one is clear and more elegant. Thanks. Let's fix e2e. |
E2e fixed. |
futures-core = "0.3.21" | ||
futures-util = "0.3.21" | ||
prost = "0.10.4" | ||
prost-derive = "0.10.1" | ||
thiserror = "1.0.31" | ||
tokio = { version = "1.18.2", features = ["full"] } | ||
tonic = "0.7.2" | ||
tonic = { version = "0.7.2", features = ["codegen"] } | ||
tracing = "0.1.35" |
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.
Why aren't these new dependencies detected by skywalking eyes? I think these are new dependencies, no?
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.
These dependencies actually already exist (required by the dependencies explicitly declared in Cargo.toml
), I just re-import the crate name to use, run Cargo tree
can see the dependencies tree.
Line 23 in 4339384
We forgot to update this to 2022 in the last release. |
No, the edition is three-year period, such as 2015, 2018, 2021. |
Is this a rust specific edition rule? |
Edition is a big concept of rust, used for syntax breaking compatible, ref: https://doc.rust-lang.org/edition-guide/editions/index.html. |
Add the
Tracer
, integrate withReporter
, like in go.