You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@skywalking.apache.org by "mufiye (via GitHub)" <gi...@apache.org> on 2023/01/21 04:56:04 UTC
[GitHub] [skywalking-java] mufiye opened a new pull request, #442: Expose complete Tracing APIs in the tracing toolkit
mufiye opened a new pull request, #442:
URL: https://github.com/apache/skywalking-java/pull/442
<!--
⚠️ Please make sure to read this template first, pull requests that don't accord with this template
maybe closed without notice.
Texts surrounded by `<` and `>` are meant to be replaced by you, e.g. <framework name>, <issue number>.
Put an `x` in the `[ ]` to mark the item as CHECKED. `[x]`
-->
<!-- ==== 🐛 Remove this line WHEN AND ONLY WHEN you're fixing a bug, follow the checklist 👇 ====
### Fix <bug description or the bug issue number or bug issue link>
- [ ] Add a unit test to verify that the fix works.
- [ ] Explain briefly why the bug exists and how to fix it.
==== 🐛 Remove this line WHEN AND ONLY WHEN you're fixing a bug, follow the checklist 👆 ==== -->
<!-- ==== 🔌 Remove this line WHEN AND ONLY WHEN you're adding a new plugin, follow the checklist 👇 ====
### Add an agent plugin to support <framework name>
- [ ] Add a test case for the new plugin, refer to [the doc](https://github.com/apache/skywalking-java/blob/main/docs/en/setup/service-agent/java-agent/Plugin-test.md)
- [ ] Add a component id in [the component-libraries.yml](https://github.com/apache/skywalking/blob/master/oap-server/server-starter/src/main/resources/component-libraries.yml)
- [ ] Add a logo in [the UI repo](https://github.com/apache/skywalking-rocketbot-ui/tree/master/src/views/components/topology/assets)
==== 🔌 Remove this line WHEN AND ONLY WHEN you're adding a new plugin, follow the checklist 👆 ==== -->
<!-- ==== 📈 Remove this line WHEN AND ONLY WHEN you're improving the performance, follow the checklist 👇 ====
### Improve the performance of <class or module or ...>
- [ ] Add a benchmark for the improvement, refer to [the existing ones](https://github.com/apache/skywalking-java/blob/main/apm-commons/apm-datacarrier/src/test/java/org/apache/skywalking/apm/commons/datacarrier/LinkedArrayBenchmark.java)
- [ ] The benchmark result.
```text
<Paste the benchmark results here>
```
- [ ] Links/URLs to the theory proof or discussion articles/blogs. <links/URLs here>
==== 📈 Remove this line WHEN AND ONLY WHEN you're improving the performance, follow the checklist 👆 ==== -->
### <This feature is about to exposing complete Tracing APIs in the tracing toolkit.>
- [ ] If this is non-trivial feature, paste the links/URLs to the design doc.
- [ ] Update the documentation to include this new feature.
- [x] Tests(including UT, IT, E2E) are added to verify the new feature.
- [ ] If it's UI related, attach the screenshots below.
- [ ] If this pull request closes/resolves/fixes an existing issue, replace the issue number. Closes #<9999>.
- [ ] Update the [`CHANGES` log](https://github.com/apache/skywalking-java/blob/main/CHANGES.md).
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@skywalking.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [skywalking-java] wu-sheng commented on pull request #442: Expose complete Tracing APIs in the tracing toolkit
Posted by "wu-sheng (via GitHub)" <gi...@apache.org>.
wu-sheng commented on PR #442:
URL: https://github.com/apache/skywalking-java/pull/442#issuecomment-1399189986
OK, I see.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@skywalking.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [skywalking-java] wu-sheng commented on pull request #442: Expose complete Tracing APIs in the tracing toolkit
Posted by "wu-sheng (via GitHub)" <gi...@apache.org>.
wu-sheng commented on PR #442:
URL: https://github.com/apache/skywalking-java/pull/442#issuecomment-1399528962
https://skywalking.apache.org/docs/skywalking-java/next/en/setup/service-agent/java-agent/application-toolkit-trace/
This doc should be split as several docs and listed on the menu
1. Add trace toolkit dependencies
2. Use native tracer
3. Read tracing context
4. Annotations
5. Use correlation context
2 should include ActiveSpan APIs
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@skywalking.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [skywalking-java] wu-sheng commented on pull request #442: Expose complete Tracing APIs in the tracing toolkit
Posted by "wu-sheng (via GitHub)" <gi...@apache.org>.
wu-sheng commented on PR #442:
URL: https://github.com/apache/skywalking-java/pull/442#issuecomment-1399525718
What do you mean how? Do you mean update the existing toolkit doc or create a new one?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@skywalking.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [skywalking-java] mufiye commented on a diff in pull request #442: Expose complete Tracing APIs in the tracing toolkit
Posted by "mufiye (via GitHub)" <gi...@apache.org>.
mufiye commented on code in PR #442:
URL: https://github.com/apache/skywalking-java/pull/442#discussion_r1084082465
##########
docs/en/setup/service-agent/java-agent/Application-toolkit-tracer.md:
##########
@@ -0,0 +1,213 @@
+# Span creating
+
+* Use `Tracer.createEntrySpan()` API to create entry span, and then use `SpanRef` to contain the reference of created span in agent kernel. The first parameter is operation name of span and the second parameter is the `ContextCarrierRef` instance which is the reference of contextcarrier in agent kernel. If the second parameter is not null, the process of creating entry span will do the extract operation which will be introduced in **inject/extract** scenario.
+
+ ```java
+ import Tracer;
+ ...
+
+ SpanRef spanRef = Tracer.createEnteySpan("${operationName}", null);
+ ```
+
+* Use `Tracer.createLocalSpan()` API to create local span, the only parameter is the operation name of span.
+
+ ```java
+ import Tracer;
+ ...
+
+ SpanRef spanRef = Tracer.createLocalSpan("${operationName}");
+ ```
+
+* Use `Tracer.createExitSpan()` API to create exit span
+
+ * **two parameters case**: the first parameter is the operation name of span, the second parameter is the remote peer which means the peer address of exit operation.
+
+ ```java
+ import Tracer;
+ ...
+
+ SpanRef spanRef = Tracer.createExitSpan("${operationName}", "${remotePeer}");
+ ```
+
+ * **three parameters case**: the first parameter is the operation name of span, the second parameter is the `ContextCarrierRef` instance and the third parameter is the remote peer. This case will be introduced in **inject/extract** scenario.
+
+* Use `Tracer.stopSpan()` API to stop current span
+
+ ```java
+ import Tracer;
+ ...
+
+ Tracer.stopSpan();
+ ```
+
+# Inject/extract
+
+The Inject/extract is to pass context information between different process. The `ContextCarrierRef` contains the reference of `ContextCarrier` and the `CarrierItemRef` contains the reference of CarrierItem. The `CarrierItem` instances compose a linked list.
+
+* Use `Tracer.inject()` to inject information of current context into carrier
+* Use `Tracer.extract()` to extract info from contextCarrier.
+* Use `items()` of `ContextCarrierRef` instance to get head `CarrierItemRef` instance.
+* Use `hasNext()` of `CarrierItemRef` instance to judge if the `CarrierItemRef` has next item.
+* Use `next()` of `CarrierItemRef` instance to get next item
+* Use `getHeadKey` of `CarrierItemRef` instance to get key of current item
+* Use `getHeadValue` of `CarrierItemRef` instance to get value of current item
+* Use `setHeadValue` of `CarrierItemRef` instance to set value of current item
+
+```java
+/*
+ You can consider map as the message body, such as Http, MQ and RPC.
+ This code block do the inject operation in one process and then pass the map message.
+*/
+ContextCarrierRef contextCarrierRef = new ContextCarrierRef();
+Tracer.inject(contextCarrierRef);
+Map<String, String> map = new HashMap<>();
+CarrierItemRef next = contextCarrierRef.items();
+while (next.hasNext()) {
+ next = next.next();
+ map.put(next.getHeadKey(), next.getHeadValue());
+}
+...
+
+```
+
+```java
+// This code block receive the map message and do the extract operation in another process.
Review Comment:
Ok, I will remove the "code block", and the "message" has been changed to "header/metadata".
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@skywalking.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [skywalking-java] wu-sheng commented on pull request #442: Expose complete Tracing APIs in the tracing toolkit
Posted by "wu-sheng (via GitHub)" <gi...@apache.org>.
wu-sheng commented on PR #442:
URL: https://github.com/apache/skywalking-java/pull/442#issuecomment-1399503391
One more suggest, please rename test name from apm-newtoolkit-trace-scenario to apm-tracer-toolkit-scenario
New is not a proper word as this test would exist for years.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@skywalking.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [skywalking-java] wu-sheng commented on a diff in pull request #442: Expose complete Tracing APIs in the tracing toolkit
Posted by "wu-sheng (via GitHub)" <gi...@apache.org>.
wu-sheng commented on code in PR #442:
URL: https://github.com/apache/skywalking-java/pull/442#discussion_r1084183174
##########
docs/en/setup/service-agent/java-agent/Application-toolkit-tracer.md:
##########
@@ -0,0 +1,213 @@
+# Create Span
+
+* Use `Tracer.createEntrySpan()` API to create entry span, and then use `SpanRef` to contain the reference of created span in agent kernel. The first parameter is operation name of span and the second parameter is the `ContextCarrierRef` instance which is the reference of contextcarrier in agent kernel. If the second parameter is not null, the process of creating entry span will do the extract operation which will be introduced in **inject/extract** scenario.
+
+ ```java
+ import Tracer;
Review Comment:
This import seems wrong? Why here without package name?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@skywalking.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [skywalking-java] mufiye commented on a diff in pull request #442: Expose complete Tracing APIs in the tracing toolkit
Posted by "mufiye (via GitHub)" <gi...@apache.org>.
mufiye commented on code in PR #442:
URL: https://github.com/apache/skywalking-java/pull/442#discussion_r1083387763
##########
apm-sniffer/apm-toolkit-activation/apm-toolkit-trace-activation/src/main/resources/skywalking-plugin.def:
##########
@@ -19,4 +19,10 @@ toolkit-trace=org.apache.skywalking.apm.toolkit.activation.trace.TraceAnnotation
toolkit-trace=org.apache.skywalking.apm.toolkit.activation.trace.TraceContextActivation
toolkit-trace=org.apache.skywalking.apm.toolkit.activation.trace.CallableOrRunnableActivation
toolkit-tag=org.apache.skywalking.apm.toolkit.activation.trace.TagAnnotationActivation
-toolkit-exception=org.apache.skywalking.apm.toolkit.activation.trace.IgnoredExceptionAnnotationActivation
\ No newline at end of file
+toolkit-exception=org.apache.skywalking.apm.toolkit.activation.trace.IgnoredExceptionAnnotationActivation
+toolkit-tracer=org.apache.skywalking.apm.toolkit.activation.trace.CarrierItemRefActivation
Review Comment:
Ok, I will add `toolkit-tracer` to the plugin-list.md.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@skywalking.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [skywalking-java] mufiye commented on pull request #442: Expose complete Tracing APIs in the tracing toolkit
Posted by "mufiye (via GitHub)" <gi...@apache.org>.
mufiye commented on PR #442:
URL: https://github.com/apache/skywalking-java/pull/442#issuecomment-1399797979
> > The banned means that I find no one uses heading(in markdown syntax are #, ##, ###, ...) in the markdown docs.
>
> This is supported.
>
> https://skywalking.apache.org/docs/skywalking-java/next/en/setup/service-agent/java-agent/java-plugin-development-guide/
>
> Multiple levels are supported. Check this doc markdown.
>
> > I can't really get what you mean. Do you mean that I should new five markdown files corresponding "Add trace toolkit dependencies", "Use native tracer", "Read tracing context", "Annotations" and "Use correlation context" respectively?
>
> Yes, five docs. The contents include your new write and existing doc(https://skywalking.apache.org/docs/skywalking-java/next/en/setup/service-agent/java-agent/application-toolkit-trace/)
Ok, I get it. One other question, should I consider this doc https://skywalking.apache.org/docs/skywalking-java/next/en/setup/service-agent/java-agent/application-toolkit-trace-cross-thread/ ?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@skywalking.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [skywalking-java] wu-sheng commented on a diff in pull request #442: Expose complete Tracing APIs in the tracing toolkit
Posted by "wu-sheng (via GitHub)" <gi...@apache.org>.
wu-sheng commented on code in PR #442:
URL: https://github.com/apache/skywalking-java/pull/442#discussion_r1084109751
##########
docs/en/setup/service-agent/java-agent/Application-toolkit-tracer.md:
##########
@@ -0,0 +1,213 @@
+# Create Span
+
+* Use `Tracer.createEntrySpan()` API to create entry span, and then use `SpanRef` to contain the reference of created span in agent kernel. The first parameter is operation name of span and the second parameter is the `ContextCarrierRef` instance which is the reference of contextcarrier in agent kernel. If the second parameter is not null, the process of creating entry span will do the extract operation which will be introduced in **inject/extract** scenario.
+
+ ```java
+ import Tracer;
+ ...
+
+ SpanRef spanRef = Tracer.createEnteySpan("${operationName}", null);
+ ```
+
+* Use `Tracer.createLocalSpan()` API to create local span, the only parameter is the operation name of span.
+
+ ```java
+ import Tracer;
+ ...
+
+ SpanRef spanRef = Tracer.createLocalSpan("${operationName}");
+ ```
+
+* Use `Tracer.createExitSpan()` API to create exit span
+
+ * **two parameters case**: the first parameter is the operation name of span, the second parameter is the remote peer which means the peer address of exit operation.
+
+ ```java
+ import Tracer;
+ ...
+
+ SpanRef spanRef = Tracer.createExitSpan("${operationName}", "${remotePeer}");
+ ```
+
+ * **three parameters case**: the first parameter is the operation name of span, the second parameter is the `ContextCarrierRef` instance and the third parameter is the remote peer. This case will be introduced in **inject/extract** scenario.
+
+* Use `Tracer.stopSpan()` API to stop current span
+
+ ```java
+ import Tracer;
+ ...
+
+ Tracer.stopSpan();
+ ```
+
+# Inject/Extract Context Carrier
+
+The Inject/extract is to pass context information between different process. The `ContextCarrierRef` contains the reference of `ContextCarrier` and the `CarrierItemRef` contains the reference of CarrierItem. The `CarrierItem` instances compose a linked list.
+
+* Use `Tracer.inject()` to inject information of current context into carrier
+* Use `Tracer.extract()` to extract info from contextCarrier.
+* Use `items()` of `ContextCarrierRef` instance to get head `CarrierItemRef` instance.
+* Use `hasNext()` of `CarrierItemRef` instance to judge if the `CarrierItemRef` has next item.
+* Use `next()` of `CarrierItemRef` instance to get next item
+* Use `getHeadKey` of `CarrierItemRef` instance to get key of current item
+* Use `getHeadValue` of `CarrierItemRef` instance to get value of current item
+* Use `setHeadValue` of `CarrierItemRef` instance to set value of current item
+
+```java
+/*
+ You can consider map as the message's header/metadata, such as Http, MQ and RPC.
+ Do the inject operation in one process and then pass the map in header/metadata.
+*/
+ContextCarrierRef contextCarrierRef = new ContextCarrierRef();
+Tracer.inject(contextCarrierRef);
+Map<String, String> map = new HashMap<>();
+CarrierItemRef next = contextCarrierRef.items();
+while (next.hasNext()) {
+ next = next.next();
+ map.put(next.getHeadKey(), next.getHeadValue());
+}
+...
+
+```
+
+```java
+// Receive the map in header/metadata and do the extract operation in another process.
Review Comment:
```suggestion
// Receive the map representing a header/metadata and do the extract operation in another process.
```
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@skywalking.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [skywalking-java] mufiye commented on pull request #442: Expose complete Tracing APIs in the tracing toolkit
Posted by "mufiye (via GitHub)" <gi...@apache.org>.
mufiye commented on PR #442:
URL: https://github.com/apache/skywalking-java/pull/442#issuecomment-1399523980
> As tests passed, you should update manual APIs docs about how to use these new APIs.
If I finish the docs about the new API, how should I submit them?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@skywalking.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [skywalking-java] mufiye commented on pull request #442: Expose complete Tracing APIs in the tracing toolkit
Posted by "mufiye (via GitHub)" <gi...@apache.org>.
mufiye commented on PR #442:
URL: https://github.com/apache/skywalking-java/pull/442#issuecomment-1399534540
> > https://skywalking.apache.org/docs/skywalking-java/next/en/setup/service-agent/java-agent/application-toolkit-trace/
> > This doc should be split as several docs and listed on the menu
> >
> > 1. Add trace toolkit dependencies
> > 2. Use native tracer
> > 3. Read tracing context
> > 4. Annotations
> > 5. Use correlation context
> >
> > 2 should include ActiveSpan APIs
>
> Actually, I have completed the docs with the five parts you listed in use cases which are Span creating, inject/extract capture/continue, tag and log for span, async prepare/finish for span crossing threads. So for the current parts you listed, should I also write docs for original trace toolkit? Because I think the new API has no annotations.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@skywalking.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [skywalking-java] wu-sheng commented on pull request #442: Expose complete Tracing APIs in the tracing toolkit
Posted by "wu-sheng (via GitHub)" <gi...@apache.org>.
wu-sheng commented on PR #442:
URL: https://github.com/apache/skywalking-java/pull/442#issuecomment-1399790991
> The banned means that I find no one uses heading(in markdown syntax are #, ##, ###, ...) in the markdown docs.
This is supported.
https://skywalking.apache.org/docs/skywalking-java/next/en/setup/service-agent/java-agent/java-plugin-development-guide/
Multiple levels are supported. Check this doc markdown.
> I can't really get what you mean. Do you mean that I should new five markdown files corresponding "Add trace toolkit dependencies", "Use native tracer", "Read tracing context", "Annotations" and "Use correlation context" respectively?
Yes, five docs. The contents include your new write and existing doc(https://skywalking.apache.org/docs/skywalking-java/next/en/setup/service-agent/java-agent/application-toolkit-trace/)
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@skywalking.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [skywalking-java] mufiye commented on pull request #442: Expose complete Tracing APIs in the tracing toolkit
Posted by "mufiye (via GitHub)" <gi...@apache.org>.
mufiye commented on PR #442:
URL: https://github.com/apache/skywalking-java/pull/442#issuecomment-1400559072
> Changes.md seems not updated.
I update the changes.md now.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@skywalking.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [skywalking-java] wu-sheng commented on a diff in pull request #442: Expose complete Tracing APIs in the tracing toolkit
Posted by "wu-sheng (via GitHub)" <gi...@apache.org>.
wu-sheng commented on code in PR #442:
URL: https://github.com/apache/skywalking-java/pull/442#discussion_r1084717844
##########
docs/en/setup/service-agent/java-agent/Application-toolkit-tracer.md:
##########
@@ -0,0 +1,213 @@
+# Create Span
+
+* Use `Tracer.createEntrySpan()` API to create entry span, and then use `SpanRef` to contain the reference of created span in agent kernel. The first parameter is operation name of span and the second parameter is the `ContextCarrierRef` instance which is the reference of contextcarrier in agent kernel. If the second parameter is not null, the process of creating entry span will do the extract operation which will be introduced in **inject/extract** scenario.
+
+ ```java
+ import Tracer;
Review Comment:
> I find that the old doc of tracing API only imports the class name, so I just write the Tracer class. So it should import the entire package, "org.apache.skywalking.apm.toolkit.trace.Tracer"?
Yes, we should. I missed this before merging. Please feel free to submit a new one to fix these.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@skywalking.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [skywalking-java] wu-sheng commented on a diff in pull request #442: Expose complete Tracing APIs in the tracing toolkit
Posted by "wu-sheng (via GitHub)" <gi...@apache.org>.
wu-sheng commented on code in PR #442:
URL: https://github.com/apache/skywalking-java/pull/442#discussion_r1084107148
##########
docs/en/setup/service-agent/java-agent/Application-toolkit-trace-annotation.md:
##########
@@ -0,0 +1,25 @@
+Also, you can use annotation to mark the method you want to trace.
Review Comment:
```suggestion
# Use annotation to mark the method you want to trace.
```
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@skywalking.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [skywalking-java] wu-sheng commented on pull request #442: Expose complete Tracing APIs in the tracing toolkit
Posted by "wu-sheng (via GitHub)" <gi...@apache.org>.
wu-sheng commented on PR #442:
URL: https://github.com/apache/skywalking-java/pull/442#issuecomment-1399398068
https://github.com/apache/skywalking-java/actions/runs/3973854409/jobs/6812802618#step:5:1
Read this. It reports there is a new plugin. Do you forget to follow the existing key?
BTW, cancelled tasks means pre conditions or parallel tasks had failed.
Focus on the error status ones.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@skywalking.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [skywalking-java] mufiye commented on pull request #442: Expose complete Tracing APIs in the tracing toolkit
Posted by "mufiye (via GitHub)" <gi...@apache.org>.
mufiye commented on PR #442:
URL: https://github.com/apache/skywalking-java/pull/442#issuecomment-1399440509
>
Ok, I will do it.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@skywalking.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [skywalking-java] mufiye commented on pull request #442: Expose complete Tracing APIs in the tracing toolkit
Posted by "mufiye (via GitHub)" <gi...@apache.org>.
mufiye commented on PR #442:
URL: https://github.com/apache/skywalking-java/pull/442#issuecomment-1399755274
I add the tag API, change apm-newtoolkit-trace-scenario to apm-toolkit-tracer-scenario and upload my original doc about new designed API.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@skywalking.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [skywalking-java] mufiye commented on a diff in pull request #442: Expose complete Tracing APIs in the tracing toolkit
Posted by "mufiye (via GitHub)" <gi...@apache.org>.
mufiye commented on code in PR #442:
URL: https://github.com/apache/skywalking-java/pull/442#discussion_r1084046282
##########
docs/en/setup/service-agent/java-agent/Application-toolkit-tracer.md:
##########
@@ -0,0 +1,213 @@
+# Span creating
Review Comment:
how about:
* Create Span
* Inject/Extract Context Carrier
* Capture/Continue Context Snapshot
* Add Span's Tag and Log
* Async Prepare/Finish
* ActiveSpan
I try to make every title as verb-object phrase.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@skywalking.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [skywalking-java] wu-sheng commented on a diff in pull request #442: Expose complete Tracing APIs in the tracing toolkit
Posted by "wu-sheng (via GitHub)" <gi...@apache.org>.
wu-sheng commented on code in PR #442:
URL: https://github.com/apache/skywalking-java/pull/442#discussion_r1084184445
##########
docs/en/setup/service-agent/java-agent/Application-toolkit-tracer.md:
##########
@@ -0,0 +1,213 @@
+# Create Span
+
+* Use `Tracer.createEntrySpan()` API to create entry span, and then use `SpanRef` to contain the reference of created span in agent kernel. The first parameter is operation name of span and the second parameter is the `ContextCarrierRef` instance which is the reference of contextcarrier in agent kernel. If the second parameter is not null, the process of creating entry span will do the extract operation which will be introduced in **inject/extract** scenario.
+
+ ```java
+ import Tracer;
+ ...
+
+ SpanRef spanRef = Tracer.createEnteySpan("${operationName}", null);
+ ```
+
+* Use `Tracer.createLocalSpan()` API to create local span, the only parameter is the operation name of span.
+
+ ```java
+ import Tracer;
+ ...
+
+ SpanRef spanRef = Tracer.createLocalSpan("${operationName}");
+ ```
+
+* Use `Tracer.createExitSpan()` API to create exit span
+
+ * **two parameters case**: the first parameter is the operation name of span, the second parameter is the remote peer which means the peer address of exit operation.
+
+ ```java
+ import Tracer;
+ ...
+
+ SpanRef spanRef = Tracer.createExitSpan("${operationName}", "${remotePeer}");
+ ```
+
+ * **three parameters case**: the first parameter is the operation name of span, the second parameter is the `ContextCarrierRef` instance and the third parameter is the remote peer. This case will be introduced in **inject/extract** scenario.
+
+* Use `Tracer.stopSpan()` API to stop current span
+
+ ```java
+ import Tracer;
+ ...
+
+ Tracer.stopSpan();
+ ```
+
+# Inject/Extract Context Carrier
+
+The Inject/extract is to pass context information between different process. The `ContextCarrierRef` contains the reference of `ContextCarrier` and the `CarrierItemRef` contains the reference of CarrierItem. The `CarrierItem` instances compose a linked list.
+
+* Use `Tracer.inject()` to inject information of current context into carrier
+* Use `Tracer.extract()` to extract info from contextCarrier.
+* Use `items()` of `ContextCarrierRef` instance to get head `CarrierItemRef` instance.
+* Use `hasNext()` of `CarrierItemRef` instance to judge if the `CarrierItemRef` has next item.
+* Use `next()` of `CarrierItemRef` instance to get next item
+* Use `getHeadKey` of `CarrierItemRef` instance to get key of current item
+* Use `getHeadValue` of `CarrierItemRef` instance to get value of current item
+* Use `setHeadValue` of `CarrierItemRef` instance to set value of current item
+
+```java
+/*
+ You can consider map as the message's header/metadata, such as Http, MQ and RPC.
+ Do the inject operation in one process and then pass the map in header/metadata.
+*/
+ContextCarrierRef contextCarrierRef = new ContextCarrierRef();
+Tracer.inject(contextCarrierRef);
+Map<String, String> map = new HashMap<>();
+CarrierItemRef next = contextCarrierRef.items();
+while (next.hasNext()) {
+ next = next.next();
+ map.put(next.getHeadKey(), next.getHeadValue());
+}
+...
+
+```
+
+```java
+// Receive the map representing a header/metadata and do the extract operation in another process.
Review Comment:
```suggestion
// Receive the map representing a header/metadata and do the extract operation in another process.
```
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@skywalking.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [skywalking-java] wu-sheng merged pull request #442: Expose complete Tracing APIs in the tracing toolkit
Posted by "wu-sheng (via GitHub)" <gi...@apache.org>.
wu-sheng merged PR #442:
URL: https://github.com/apache/skywalking-java/pull/442
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@skywalking.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [skywalking-java] wu-sheng commented on pull request #442: Expose complete Tracing APIs in the tracing toolkit
Posted by "wu-sheng (via GitHub)" <gi...@apache.org>.
wu-sheng commented on PR #442:
URL: https://github.com/apache/skywalking-java/pull/442#issuecomment-1399197420
Please fix code style. The style file is in the root.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@skywalking.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [skywalking-java] wu-sheng commented on pull request #442: Expose complete Tracing APIs in the tracing toolkit
Posted by "wu-sheng (via GitHub)" <gi...@apache.org>.
wu-sheng commented on PR #442:
URL: https://github.com/apache/skywalking-java/pull/442#issuecomment-1399828578
> Ok, I get it. One other question, should I consider this doc https://skywalking.apache.org/docs/skywalking-java/next/en/setup/service-agent/java-agent/application-toolkit-trace-cross-thread/ ?
Maybe merge this as 6th?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@skywalking.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [skywalking-java] wu-sheng commented on a diff in pull request #442: Expose complete Tracing APIs in the tracing toolkit
Posted by "wu-sheng (via GitHub)" <gi...@apache.org>.
wu-sheng commented on code in PR #442:
URL: https://github.com/apache/skywalking-java/pull/442#discussion_r1084028141
##########
docs/en/setup/service-agent/java-agent/Application-toolkit-tracer.md:
##########
@@ -0,0 +1,213 @@
+# Span creating
+
+* Use `Tracer.createEntrySpan()` API to create entry span, and then use `SpanRef` to contain the reference of created span in agent kernel. The first parameter is operation name of span and the second parameter is the `ContextCarrierRef` instance which is the reference of contextcarrier in agent kernel. If the second parameter is not null, the process of creating entry span will do the extract operation which will be introduced in **inject/extract** scenario.
+
+ ```java
+ import Tracer;
+ ...
+
+ SpanRef spanRef = Tracer.createEnteySpan("${operationName}", null);
+ ```
+
+* Use `Tracer.createLocalSpan()` API to create local span, the only parameter is the operation name of span.
+
+ ```java
+ import Tracer;
+ ...
+
+ SpanRef spanRef = Tracer.createLocalSpan("${operationName}");
+ ```
+
+* Use `Tracer.createExitSpan()` API to create exit span
+
+ * **two parameters case**: the first parameter is the operation name of span, the second parameter is the remote peer which means the peer address of exit operation.
+
+ ```java
+ import Tracer;
+ ...
+
+ SpanRef spanRef = Tracer.createExitSpan("${operationName}", "${remotePeer}");
+ ```
+
+ * **three parameters case**: the first parameter is the operation name of span, the second parameter is the `ContextCarrierRef` instance and the third parameter is the remote peer. This case will be introduced in **inject/extract** scenario.
+
+* Use `Tracer.stopSpan()` API to stop current span
+
+ ```java
+ import Tracer;
+ ...
+
+ Tracer.stopSpan();
+ ```
+
+# Inject/extract
+
+The Inject/extract is to pass context information between different process. The `ContextCarrierRef` contains the reference of `ContextCarrier` and the `CarrierItemRef` contains the reference of CarrierItem. The `CarrierItem` instances compose a linked list.
+
+* Use `Tracer.inject()` to inject information of current context into carrier
+* Use `Tracer.extract()` to extract info from contextCarrier.
+* Use `items()` of `ContextCarrierRef` instance to get head `CarrierItemRef` instance.
+* Use `hasNext()` of `CarrierItemRef` instance to judge if the `CarrierItemRef` has next item.
+* Use `next()` of `CarrierItemRef` instance to get next item
+* Use `getHeadKey` of `CarrierItemRef` instance to get key of current item
+* Use `getHeadValue` of `CarrierItemRef` instance to get value of current item
+* Use `setHeadValue` of `CarrierItemRef` instance to set value of current item
+
+```java
+/*
+ You can consider map as the message body, such as Http, MQ and RPC.
Review Comment:
```suggestion
You can consider map as the message header/metadata, such as Http, MQ and RPC.
```
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@skywalking.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [skywalking-java] wu-sheng commented on pull request #442: Expose complete Tracing APIs in the tracing toolkit
Posted by "wu-sheng (via GitHub)" <gi...@apache.org>.
wu-sheng commented on PR #442:
URL: https://github.com/apache/skywalking-java/pull/442#issuecomment-1399829332
> I have completed these five docs.
You need to update menu.yml to add this as sub menu items.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@skywalking.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [skywalking-java] mufiye commented on a diff in pull request #442: Expose complete Tracing APIs in the tracing toolkit
Posted by "mufiye (via GitHub)" <gi...@apache.org>.
mufiye commented on code in PR #442:
URL: https://github.com/apache/skywalking-java/pull/442#discussion_r1084194312
##########
docs/en/setup/service-agent/java-agent/Application-toolkit-tracer.md:
##########
@@ -0,0 +1,213 @@
+# Create Span
+
+* Use `Tracer.createEntrySpan()` API to create entry span, and then use `SpanRef` to contain the reference of created span in agent kernel. The first parameter is operation name of span and the second parameter is the `ContextCarrierRef` instance which is the reference of contextcarrier in agent kernel. If the second parameter is not null, the process of creating entry span will do the extract operation which will be introduced in **inject/extract** scenario.
+
+ ```java
+ import Tracer;
Review Comment:
I find that the old doc of tracing API only imports the class name, so I just write the Tracer class. So it should import the entire package, "org.apache.skywalking.apm.toolkit.trace.Tracer"?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@skywalking.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [skywalking-java] wu-sheng commented on pull request #442: Expose complete Tracing APIs in the tracing toolkit
Posted by "wu-sheng (via GitHub)" <gi...@apache.org>.
wu-sheng commented on PR #442:
URL: https://github.com/apache/skywalking-java/pull/442#issuecomment-1400523324
Changes.md seems not updated.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@skywalking.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [skywalking-java] mufiye commented on a diff in pull request #442: Expose complete Tracing APIs in the tracing toolkit
Posted by "mufiye (via GitHub)" <gi...@apache.org>.
mufiye commented on code in PR #442:
URL: https://github.com/apache/skywalking-java/pull/442#discussion_r1083739699
##########
docs/menu.yml:
##########
@@ -36,14 +36,22 @@ catalog:
path: "/en/setup/service-agent/java-agent/token-auth"
- name: "Manual APIs"
catalog:
- - name: "Tracing APIs"
Review Comment:
Ok
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@skywalking.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [skywalking-java] wu-sheng commented on pull request #442: Expose complete Tracing APIs in the tracing toolkit
Posted by "wu-sheng (via GitHub)" <gi...@apache.org>.
wu-sheng commented on PR #442:
URL: https://github.com/apache/skywalking-java/pull/442#issuecomment-1399180234
A question, how do you make toolkit works in the test scenario?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@skywalking.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [skywalking-java] wu-sheng commented on pull request #442: Expose complete Tracing APIs in the tracing toolkit
Posted by "wu-sheng (via GitHub)" <gi...@apache.org>.
wu-sheng commented on PR #442:
URL: https://github.com/apache/skywalking-java/pull/442#issuecomment-1399534982
The parts are for you to reorganize your new one and existing docs into one list.
Yours are good, they should be in my (2)
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@skywalking.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [skywalking-java] wu-sheng commented on a diff in pull request #442: Expose complete Tracing APIs in the tracing toolkit
Posted by "wu-sheng (via GitHub)" <gi...@apache.org>.
wu-sheng commented on code in PR #442:
URL: https://github.com/apache/skywalking-java/pull/442#discussion_r1084074105
##########
docs/en/setup/service-agent/java-agent/Application-toolkit-tracer.md:
##########
@@ -0,0 +1,213 @@
+# Span creating
+
+* Use `Tracer.createEntrySpan()` API to create entry span, and then use `SpanRef` to contain the reference of created span in agent kernel. The first parameter is operation name of span and the second parameter is the `ContextCarrierRef` instance which is the reference of contextcarrier in agent kernel. If the second parameter is not null, the process of creating entry span will do the extract operation which will be introduced in **inject/extract** scenario.
+
+ ```java
+ import Tracer;
+ ...
+
+ SpanRef spanRef = Tracer.createEnteySpan("${operationName}", null);
+ ```
+
+* Use `Tracer.createLocalSpan()` API to create local span, the only parameter is the operation name of span.
+
+ ```java
+ import Tracer;
+ ...
+
+ SpanRef spanRef = Tracer.createLocalSpan("${operationName}");
+ ```
+
+* Use `Tracer.createExitSpan()` API to create exit span
+
+ * **two parameters case**: the first parameter is the operation name of span, the second parameter is the remote peer which means the peer address of exit operation.
+
+ ```java
+ import Tracer;
+ ...
+
+ SpanRef spanRef = Tracer.createExitSpan("${operationName}", "${remotePeer}");
+ ```
+
+ * **three parameters case**: the first parameter is the operation name of span, the second parameter is the `ContextCarrierRef` instance and the third parameter is the remote peer. This case will be introduced in **inject/extract** scenario.
+
+* Use `Tracer.stopSpan()` API to stop current span
+
+ ```java
+ import Tracer;
+ ...
+
+ Tracer.stopSpan();
+ ```
+
+# Inject/extract
+
+The Inject/extract is to pass context information between different process. The `ContextCarrierRef` contains the reference of `ContextCarrier` and the `CarrierItemRef` contains the reference of CarrierItem. The `CarrierItem` instances compose a linked list.
+
+* Use `Tracer.inject()` to inject information of current context into carrier
+* Use `Tracer.extract()` to extract info from contextCarrier.
+* Use `items()` of `ContextCarrierRef` instance to get head `CarrierItemRef` instance.
+* Use `hasNext()` of `CarrierItemRef` instance to judge if the `CarrierItemRef` has next item.
+* Use `next()` of `CarrierItemRef` instance to get next item
+* Use `getHeadKey` of `CarrierItemRef` instance to get key of current item
+* Use `getHeadValue` of `CarrierItemRef` instance to get value of current item
+* Use `setHeadValue` of `CarrierItemRef` instance to set value of current item
+
+```java
+/*
+ You can consider map as the message body, such as Http, MQ and RPC.
+ This code block do the inject operation in one process and then pass the map message.
+*/
+ContextCarrierRef contextCarrierRef = new ContextCarrierRef();
+Tracer.inject(contextCarrierRef);
+Map<String, String> map = new HashMap<>();
+CarrierItemRef next = contextCarrierRef.items();
+while (next.hasNext()) {
+ next = next.next();
+ map.put(next.getHeadKey(), next.getHeadValue());
+}
+...
+
+```
+
+```java
+// This code block receive the map message and do the extract operation in another process.
Review Comment:
Please remove, block usually means it is a time cost operation.
And notice map should be header/metadata, not the message itself.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@skywalking.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [skywalking-java] wu-sheng commented on a diff in pull request #442: Expose complete Tracing APIs in the tracing toolkit
Posted by "wu-sheng (via GitHub)" <gi...@apache.org>.
wu-sheng commented on code in PR #442:
URL: https://github.com/apache/skywalking-java/pull/442#discussion_r1083387608
##########
apm-sniffer/apm-toolkit-activation/apm-toolkit-trace-activation/src/main/resources/skywalking-plugin.def:
##########
@@ -19,4 +19,10 @@ toolkit-trace=org.apache.skywalking.apm.toolkit.activation.trace.TraceAnnotation
toolkit-trace=org.apache.skywalking.apm.toolkit.activation.trace.TraceContextActivation
toolkit-trace=org.apache.skywalking.apm.toolkit.activation.trace.CallableOrRunnableActivation
toolkit-tag=org.apache.skywalking.apm.toolkit.activation.trace.TagAnnotationActivation
-toolkit-exception=org.apache.skywalking.apm.toolkit.activation.trace.IgnoredExceptionAnnotationActivation
\ No newline at end of file
+toolkit-exception=org.apache.skywalking.apm.toolkit.activation.trace.IgnoredExceptionAnnotationActivation
+toolkit-tracer=org.apache.skywalking.apm.toolkit.activation.trace.CarrierItemRefActivation
Review Comment:
This should be added into plugin-list.md, as a new name means these instrumentations could be disabled through this name.
So we check consistent with docs to keep updated.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@skywalking.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [skywalking-java] mufiye commented on pull request #442: Expose complete Tracing APIs in the tracing toolkit
Posted by "mufiye (via GitHub)" <gi...@apache.org>.
mufiye commented on PR #442:
URL: https://github.com/apache/skywalking-java/pull/442#issuecomment-1399528337
> What do you mean how? Do you mean update the existing toolkit doc or create a new one?
I think I ask a stupid question, I have found there is a docs directory. Just ignore this question, haha.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@skywalking.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [skywalking-java] wu-sheng commented on pull request #442: Expose complete Tracing APIs in the tracing toolkit
Posted by "wu-sheng (via GitHub)" <gi...@apache.org>.
wu-sheng commented on PR #442:
URL: https://github.com/apache/skywalking-java/pull/442#issuecomment-1399562067
You could keep one if you want. Each menu needs a new file .
What do you mean banned? Which markdown format actually?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@skywalking.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [skywalking-java] wu-sheng commented on a diff in pull request #442: Expose complete Tracing APIs in the tracing toolkit
Posted by "wu-sheng (via GitHub)" <gi...@apache.org>.
wu-sheng commented on code in PR #442:
URL: https://github.com/apache/skywalking-java/pull/442#discussion_r1083738066
##########
docs/menu.yml:
##########
@@ -36,14 +36,22 @@ catalog:
path: "/en/setup/service-agent/java-agent/token-auth"
- name: "Manual APIs"
catalog:
- - name: "Tracing APIs"
Review Comment:
This should be kept, and all following news as a catalog(sub level)
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@skywalking.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [skywalking-java] mufiye commented on pull request #442: Expose complete Tracing APIs in the tracing toolkit
Posted by "mufiye (via GitHub)" <gi...@apache.org>.
mufiye commented on PR #442:
URL: https://github.com/apache/skywalking-java/pull/442#issuecomment-1399189467
>
I simulate the original toolkit scenario that add the toolkit java file into the test scenario.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@skywalking.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [skywalking-java] wu-sheng commented on pull request #442: Expose complete Tracing APIs in the tracing toolkit
Posted by "wu-sheng (via GitHub)" <gi...@apache.org>.
wu-sheng commented on PR #442:
URL: https://github.com/apache/skywalking-java/pull/442#issuecomment-1399429437
Yes, I think we should provide complete APIs in spanRef.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@skywalking.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [skywalking-java] mufiye commented on pull request #442: Expose complete Tracing APIs in the tracing toolkit
Posted by "mufiye (via GitHub)" <gi...@apache.org>.
mufiye commented on PR #442:
URL: https://github.com/apache/skywalking-java/pull/442#issuecomment-1399185060
> A question, how do you make toolkit works in the test scenario?
I just call the every toolkit method in specific condition, such as new HTTP request, new thread. I see the CI shows the build failure. I cannot get what the failure means. All scenarios are ok in my local.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@skywalking.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [skywalking-java] mufiye commented on pull request #442: Expose complete Tracing APIs in the tracing toolkit
Posted by "mufiye (via GitHub)" <gi...@apache.org>.
mufiye commented on PR #442:
URL: https://github.com/apache/skywalking-java/pull/442#issuecomment-1399394691
Happy Chinese New Year @wu-sheng . I see that there are two errors and many jobs cancelled when do the CI test and plugins-test.3.yaml test, but I am confused about the error hint. Could you give me some suggestions?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@skywalking.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [skywalking-java] mufiye commented on pull request #442: Expose complete Tracing APIs in the tracing toolkit
Posted by "mufiye (via GitHub)" <gi...@apache.org>.
mufiye commented on PR #442:
URL: https://github.com/apache/skywalking-java/pull/442#issuecomment-1399759315
> You could keep one if you want. Each menu needs a new file . What do you mean banned? Which markdown format actually?
I can't really get what you mean. Do you mean that I should new five markdown files corresponding "Add trace toolkit dependencies", "Use native tracer", "Read tracing context", "Annotations" and "Use correlation context" respectively? And my newly designed API should be in the "Use native tracer" file. Other files should contain the docs of the old API.
The banned means that I find no one uses heading(in markdown syntax are #, ##, ###, ...) in the markdown docs.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@skywalking.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [skywalking-java] wu-sheng commented on a diff in pull request #442: Expose complete Tracing APIs in the tracing toolkit
Posted by "wu-sheng (via GitHub)" <gi...@apache.org>.
wu-sheng commented on code in PR #442:
URL: https://github.com/apache/skywalking-java/pull/442#discussion_r1084030360
##########
docs/en/setup/service-agent/java-agent/Application-toolkit-tracer.md:
##########
@@ -0,0 +1,213 @@
+# Span creating
+
+* Use `Tracer.createEntrySpan()` API to create entry span, and then use `SpanRef` to contain the reference of created span in agent kernel. The first parameter is operation name of span and the second parameter is the `ContextCarrierRef` instance which is the reference of contextcarrier in agent kernel. If the second parameter is not null, the process of creating entry span will do the extract operation which will be introduced in **inject/extract** scenario.
+
+ ```java
+ import Tracer;
+ ...
+
+ SpanRef spanRef = Tracer.createEnteySpan("${operationName}", null);
+ ```
+
+* Use `Tracer.createLocalSpan()` API to create local span, the only parameter is the operation name of span.
+
+ ```java
+ import Tracer;
+ ...
+
+ SpanRef spanRef = Tracer.createLocalSpan("${operationName}");
+ ```
+
+* Use `Tracer.createExitSpan()` API to create exit span
+
+ * **two parameters case**: the first parameter is the operation name of span, the second parameter is the remote peer which means the peer address of exit operation.
+
+ ```java
+ import Tracer;
+ ...
+
+ SpanRef spanRef = Tracer.createExitSpan("${operationName}", "${remotePeer}");
+ ```
+
+ * **three parameters case**: the first parameter is the operation name of span, the second parameter is the `ContextCarrierRef` instance and the third parameter is the remote peer. This case will be introduced in **inject/extract** scenario.
+
+* Use `Tracer.stopSpan()` API to stop current span
+
+ ```java
+ import Tracer;
+ ...
+
+ Tracer.stopSpan();
+ ```
+
+# Inject/extract
+
+The Inject/extract is to pass context information between different process. The `ContextCarrierRef` contains the reference of `ContextCarrier` and the `CarrierItemRef` contains the reference of CarrierItem. The `CarrierItem` instances compose a linked list.
+
+* Use `Tracer.inject()` to inject information of current context into carrier
+* Use `Tracer.extract()` to extract info from contextCarrier.
+* Use `items()` of `ContextCarrierRef` instance to get head `CarrierItemRef` instance.
+* Use `hasNext()` of `CarrierItemRef` instance to judge if the `CarrierItemRef` has next item.
+* Use `next()` of `CarrierItemRef` instance to get next item
+* Use `getHeadKey` of `CarrierItemRef` instance to get key of current item
+* Use `getHeadValue` of `CarrierItemRef` instance to get value of current item
+* Use `setHeadValue` of `CarrierItemRef` instance to set value of current item
+
+```java
+/*
+ You can consider map as the message body, such as Http, MQ and RPC.
+ This code block do the inject operation in one process and then pass the map message.
+*/
+ContextCarrierRef contextCarrierRef = new ContextCarrierRef();
+Tracer.inject(contextCarrierRef);
+Map<String, String> map = new HashMap<>();
+CarrierItemRef next = contextCarrierRef.items();
+while (next.hasNext()) {
+ next = next.next();
+ map.put(next.getHeadKey(), next.getHeadValue());
+}
+...
+
+```
+
+```java
+// This code block receive the map message and do the extract operation in another process.
Review Comment:
Why do we mention blocking?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@skywalking.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [skywalking-java] wu-sheng commented on pull request #442: Expose complete Tracing APIs in the tracing toolkit
Posted by "wu-sheng (via GitHub)" <gi...@apache.org>.
wu-sheng commented on PR #442:
URL: https://github.com/apache/skywalking-java/pull/442#issuecomment-1399188962
> > A question, how do you make toolkit works in the test scenario?
>
>
>
> I just call the every toolkit method in specific condition, such as new HTTP request, new thread. I see the CI shows the build failure. I cannot get what the failure means. All scenarios are ok in my local.
I mean we don't have released new toolkit, how does your maven dependency work?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@skywalking.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [skywalking-java] mufiye commented on a diff in pull request #442: Expose complete Tracing APIs in the tracing toolkit
Posted by "mufiye (via GitHub)" <gi...@apache.org>.
mufiye commented on code in PR #442:
URL: https://github.com/apache/skywalking-java/pull/442#discussion_r1084048323
##########
docs/en/setup/service-agent/java-agent/Application-toolkit-tracer.md:
##########
@@ -0,0 +1,213 @@
+# Span creating
+
+* Use `Tracer.createEntrySpan()` API to create entry span, and then use `SpanRef` to contain the reference of created span in agent kernel. The first parameter is operation name of span and the second parameter is the `ContextCarrierRef` instance which is the reference of contextcarrier in agent kernel. If the second parameter is not null, the process of creating entry span will do the extract operation which will be introduced in **inject/extract** scenario.
+
+ ```java
+ import Tracer;
+ ...
+
+ SpanRef spanRef = Tracer.createEnteySpan("${operationName}", null);
+ ```
+
+* Use `Tracer.createLocalSpan()` API to create local span, the only parameter is the operation name of span.
+
+ ```java
+ import Tracer;
+ ...
+
+ SpanRef spanRef = Tracer.createLocalSpan("${operationName}");
+ ```
+
+* Use `Tracer.createExitSpan()` API to create exit span
+
+ * **two parameters case**: the first parameter is the operation name of span, the second parameter is the remote peer which means the peer address of exit operation.
+
+ ```java
+ import Tracer;
+ ...
+
+ SpanRef spanRef = Tracer.createExitSpan("${operationName}", "${remotePeer}");
+ ```
+
+ * **three parameters case**: the first parameter is the operation name of span, the second parameter is the `ContextCarrierRef` instance and the third parameter is the remote peer. This case will be introduced in **inject/extract** scenario.
+
+* Use `Tracer.stopSpan()` API to stop current span
+
+ ```java
+ import Tracer;
+ ...
+
+ Tracer.stopSpan();
+ ```
+
+# Inject/extract
+
+The Inject/extract is to pass context information between different process. The `ContextCarrierRef` contains the reference of `ContextCarrier` and the `CarrierItemRef` contains the reference of CarrierItem. The `CarrierItem` instances compose a linked list.
+
+* Use `Tracer.inject()` to inject information of current context into carrier
+* Use `Tracer.extract()` to extract info from contextCarrier.
+* Use `items()` of `ContextCarrierRef` instance to get head `CarrierItemRef` instance.
+* Use `hasNext()` of `CarrierItemRef` instance to judge if the `CarrierItemRef` has next item.
+* Use `next()` of `CarrierItemRef` instance to get next item
+* Use `getHeadKey` of `CarrierItemRef` instance to get key of current item
+* Use `getHeadValue` of `CarrierItemRef` instance to get value of current item
+* Use `setHeadValue` of `CarrierItemRef` instance to set value of current item
+
+```java
+/*
+ You can consider map as the message body, such as Http, MQ and RPC.
+ This code block do the inject operation in one process and then pass the map message.
+*/
+ContextCarrierRef contextCarrierRef = new ContextCarrierRef();
+Tracer.inject(contextCarrierRef);
+Map<String, String> map = new HashMap<>();
+CarrierItemRef next = contextCarrierRef.items();
+while (next.hasNext()) {
+ next = next.next();
+ map.put(next.getHeadKey(), next.getHeadValue());
+}
+...
+
+```
+
+```java
+// This code block receive the map message and do the extract operation in another process.
Review Comment:
So should I remove the "code block" pharse?
##########
docs/en/setup/service-agent/java-agent/Application-toolkit-tracer.md:
##########
@@ -0,0 +1,213 @@
+# Span creating
+
+* Use `Tracer.createEntrySpan()` API to create entry span, and then use `SpanRef` to contain the reference of created span in agent kernel. The first parameter is operation name of span and the second parameter is the `ContextCarrierRef` instance which is the reference of contextcarrier in agent kernel. If the second parameter is not null, the process of creating entry span will do the extract operation which will be introduced in **inject/extract** scenario.
+
+ ```java
+ import Tracer;
+ ...
+
+ SpanRef spanRef = Tracer.createEnteySpan("${operationName}", null);
+ ```
+
+* Use `Tracer.createLocalSpan()` API to create local span, the only parameter is the operation name of span.
+
+ ```java
+ import Tracer;
+ ...
+
+ SpanRef spanRef = Tracer.createLocalSpan("${operationName}");
+ ```
+
+* Use `Tracer.createExitSpan()` API to create exit span
+
+ * **two parameters case**: the first parameter is the operation name of span, the second parameter is the remote peer which means the peer address of exit operation.
+
+ ```java
+ import Tracer;
+ ...
+
+ SpanRef spanRef = Tracer.createExitSpan("${operationName}", "${remotePeer}");
+ ```
+
+ * **three parameters case**: the first parameter is the operation name of span, the second parameter is the `ContextCarrierRef` instance and the third parameter is the remote peer. This case will be introduced in **inject/extract** scenario.
+
+* Use `Tracer.stopSpan()` API to stop current span
+
+ ```java
+ import Tracer;
+ ...
+
+ Tracer.stopSpan();
+ ```
+
+# Inject/extract
+
+The Inject/extract is to pass context information between different process. The `ContextCarrierRef` contains the reference of `ContextCarrier` and the `CarrierItemRef` contains the reference of CarrierItem. The `CarrierItem` instances compose a linked list.
+
+* Use `Tracer.inject()` to inject information of current context into carrier
+* Use `Tracer.extract()` to extract info from contextCarrier.
+* Use `items()` of `ContextCarrierRef` instance to get head `CarrierItemRef` instance.
+* Use `hasNext()` of `CarrierItemRef` instance to judge if the `CarrierItemRef` has next item.
+* Use `next()` of `CarrierItemRef` instance to get next item
+* Use `getHeadKey` of `CarrierItemRef` instance to get key of current item
+* Use `getHeadValue` of `CarrierItemRef` instance to get value of current item
+* Use `setHeadValue` of `CarrierItemRef` instance to set value of current item
+
+```java
+/*
+ You can consider map as the message body, such as Http, MQ and RPC.
+ This code block do the inject operation in one process and then pass the map message.
+*/
+ContextCarrierRef contextCarrierRef = new ContextCarrierRef();
+Tracer.inject(contextCarrierRef);
+Map<String, String> map = new HashMap<>();
+CarrierItemRef next = contextCarrierRef.items();
+while (next.hasNext()) {
+ next = next.next();
+ map.put(next.getHeadKey(), next.getHeadValue());
+}
+...
+
+```
+
+```java
+// This code block receive the map message and do the extract operation in another process.
Review Comment:
So should I remove the "code block" phrase?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@skywalking.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [skywalking-java] wu-sheng commented on pull request #442: Expose complete Tracing APIs in the tracing toolkit
Posted by "wu-sheng (via GitHub)" <gi...@apache.org>.
wu-sheng commented on PR #442:
URL: https://github.com/apache/skywalking-java/pull/442#issuecomment-1399403293
As tests passed, you should update manual APIs docs about how to use these new APIs.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@skywalking.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [skywalking-java] mufiye commented on pull request #442: Expose complete Tracing APIs in the tracing toolkit
Posted by "mufiye (via GitHub)" <gi...@apache.org>.
mufiye commented on PR #442:
URL: https://github.com/apache/skywalking-java/pull/442#issuecomment-1401224390
> lgtm. Thanks for your contributions.
Ok, it is a wonderful first-issue experience for me. I'm sorry for the doc is still for more polish including the titles and import things which I want to do more changes today.
I hope to do more contributions to the skywalking community, see you next time.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@skywalking.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [skywalking-java] mufiye commented on a diff in pull request #442: Expose complete Tracing APIs in the tracing toolkit
Posted by "mufiye (via GitHub)" <gi...@apache.org>.
mufiye commented on code in PR #442:
URL: https://github.com/apache/skywalking-java/pull/442#discussion_r1084223330
##########
docs/en/setup/service-agent/java-agent/Application-toolkit-tracer.md:
##########
@@ -0,0 +1,213 @@
+# Create Span
+
+* Use `Tracer.createEntrySpan()` API to create entry span, and then use `SpanRef` to contain the reference of created span in agent kernel. The first parameter is operation name of span and the second parameter is the `ContextCarrierRef` instance which is the reference of contextcarrier in agent kernel. If the second parameter is not null, the process of creating entry span will do the extract operation which will be introduced in **inject/extract** scenario.
+
+ ```java
+ import Tracer;
Review Comment:
But actually, I find lots of package importing are lost in the Application-toolkit-tracer.md .
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@skywalking.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [skywalking-java] mufiye commented on a diff in pull request #442: Expose complete Tracing APIs in the tracing toolkit
Posted by "mufiye (via GitHub)" <gi...@apache.org>.
mufiye commented on code in PR #442:
URL: https://github.com/apache/skywalking-java/pull/442#discussion_r1084223330
##########
docs/en/setup/service-agent/java-agent/Application-toolkit-tracer.md:
##########
@@ -0,0 +1,213 @@
+# Create Span
+
+* Use `Tracer.createEntrySpan()` API to create entry span, and then use `SpanRef` to contain the reference of created span in agent kernel. The first parameter is operation name of span and the second parameter is the `ContextCarrierRef` instance which is the reference of contextcarrier in agent kernel. If the second parameter is not null, the process of creating entry span will do the extract operation which will be introduced in **inject/extract** scenario.
+
+ ```java
+ import Tracer;
Review Comment:
Actually, I find lots of package importing are lost in the Application-toolkit-tracer.md .
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@skywalking.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [skywalking-java] mufiye commented on pull request #442: Expose complete Tracing APIs in the tracing toolkit
Posted by "mufiye (via GitHub)" <gi...@apache.org>.
mufiye commented on PR #442:
URL: https://github.com/apache/skywalking-java/pull/442#issuecomment-1399187819
I think I should add license header to the TestService file.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@skywalking.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [skywalking-java] mufiye commented on pull request #442: Expose complete Tracing APIs in the tracing toolkit
Posted by "mufiye (via GitHub)" <gi...@apache.org>.
mufiye commented on PR #442:
URL: https://github.com/apache/skywalking-java/pull/442#issuecomment-1399399328
> https://github.com/apache/skywalking-java/actions/runs/3973854409/jobs/6812802618#step:5:1
>
> Read this. It reports there is a new plugin. Do you forget to follow the existing key?
>
> BTW, cancelled tasks means pre conditions or parallel tasks had failed. Focus on the error status ones.
I get why errors happen. I add new key `toolkit-tracer` in the skywalking-plugin.def but not change the Plugin-list.md. So in should I just follow the old key `toolkit-trace` or add new key into the Plugin-list.md.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@skywalking.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [skywalking-java] mufiye commented on pull request #442: Expose complete Tracing APIs in the tracing toolkit
Posted by "mufiye (via GitHub)" <gi...@apache.org>.
mufiye commented on PR #442:
URL: https://github.com/apache/skywalking-java/pull/442#issuecomment-1399403440
> As tests passed, you should update manual APIs docs about how to use these new APIs.
Ok, I will do it.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@skywalking.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [skywalking-java] mufiye commented on pull request #442: Expose complete Tracing APIs in the tracing toolkit
Posted by "mufiye (via GitHub)" <gi...@apache.org>.
mufiye commented on PR #442:
URL: https://github.com/apache/skywalking-java/pull/442#issuecomment-1399534471
> https://skywalking.apache.org/docs/skywalking-java/next/en/setup/service-agent/java-agent/application-toolkit-trace/
>
> This doc should be split as several docs and listed on the menu
>
> 1. Add trace toolkit dependencies
> 2. Use native tracer
> 3. Read tracing context
> 4. Annotations
> 5. Use correlation context
>
> 2 should include ActiveSpan APIs
Actually, I have completed the docs with the five parts you listed in use cases which are Span creating, inject/extract capture/continue, tag and log for span, async prepare/finish for span crossing threads. So for the current parts you listed, should I also write docs for original trace toolkit? Because I think I have no annotations.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@skywalking.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [skywalking-java] mufiye commented on pull request #442: Expose complete Tracing APIs in the tracing toolkit
Posted by "mufiye (via GitHub)" <gi...@apache.org>.
mufiye commented on PR #442:
URL: https://github.com/apache/skywalking-java/pull/442#issuecomment-1399827721
I have completed these five docs.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@skywalking.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [skywalking-java] mufiye commented on pull request #442: Expose complete Tracing APIs in the tracing toolkit
Posted by "mufiye (via GitHub)" <gi...@apache.org>.
mufiye commented on PR #442:
URL: https://github.com/apache/skywalking-java/pull/442#issuecomment-1399829303
>
Ok, I will do it. But I think the thing I need to do for this cross-thread-doc is only removing the dependency part.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@skywalking.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [skywalking-java] mufiye commented on pull request #442: Expose complete Tracing APIs in the tracing toolkit
Posted by "mufiye (via GitHub)" <gi...@apache.org>.
mufiye commented on PR #442:
URL: https://github.com/apache/skywalking-java/pull/442#issuecomment-1399406093
Actually, I have some questions about tag API design. Do you think I should add tag API into the `SpanRef` class just like the log API?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@skywalking.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [skywalking-java] mufiye commented on pull request #442: Expose complete Tracing APIs in the tracing toolkit
Posted by "mufiye (via GitHub)" <gi...@apache.org>.
mufiye commented on PR #442:
URL: https://github.com/apache/skywalking-java/pull/442#issuecomment-1399536690
> The parts are for you to reorganize your new one and existing docs into one list. Yours are good, they should be in my (2)
I think the menu you list is of Application-toolkit-trace.md. So should I only modify this file or create a new file? BTW, whether the heading is banned in the markdown docs?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@skywalking.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [skywalking-java] wu-sheng commented on a diff in pull request #442: Expose complete Tracing APIs in the tracing toolkit
Posted by "wu-sheng (via GitHub)" <gi...@apache.org>.
wu-sheng commented on code in PR #442:
URL: https://github.com/apache/skywalking-java/pull/442#discussion_r1084070402
##########
docs/en/setup/service-agent/java-agent/Application-toolkit-tracer.md:
##########
@@ -0,0 +1,213 @@
+# Span creating
Review Comment:
- Create Span
- Inject and Extract Context
- Capture and Continue Context
- Add Span's Tag and Log
- Set the span in async mode
- Access the Active Span
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@skywalking.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [skywalking-java] wu-sheng commented on a diff in pull request #442: Expose complete Tracing APIs in the tracing toolkit
Posted by "wu-sheng (via GitHub)" <gi...@apache.org>.
wu-sheng commented on code in PR #442:
URL: https://github.com/apache/skywalking-java/pull/442#discussion_r1084111168
##########
docs/menu.yml:
##########
@@ -37,13 +37,23 @@ catalog:
- name: "Manual APIs"
catalog:
- name: "Tracing APIs"
- path: "/en/setup/service-agent/java-agent/application-toolkit-trace"
+ catalog:
+ - name: "Add Trace Toolkit Dependencies"
+ path: "/en/setup/service-agent/java-agent/application-toolkit-dependency"
+ - name: "Use Native Tracer"
+ path: "/en/setup/service-agent/java-agent/application-toolkit-tracer"
+ - name: "Read Tracing Context"
+ path: "/en/setup/service-agent/java-agent/application-toolkit-trace-read-context"
+ - name: "Annotations"
+ path: "/en/setup/service-agent/java-agent/application-toolkit-trace-annotation"
+ - name: "Use Correlation Context"
+ path: "/en/setup/service-agent/java-agent/application-toolkit-trace-correlation-context"
+ - name: "Another Across Thread Solution"
Review Comment:
```suggestion
- name: "Across Thread Solution"
```
Another seems a strange word in doc menu
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@skywalking.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [skywalking-java] wu-sheng commented on a diff in pull request #442: Expose complete Tracing APIs in the tracing toolkit
Posted by "wu-sheng (via GitHub)" <gi...@apache.org>.
wu-sheng commented on code in PR #442:
URL: https://github.com/apache/skywalking-java/pull/442#discussion_r1084026480
##########
docs/en/setup/service-agent/java-agent/Application-toolkit-tracer.md:
##########
@@ -0,0 +1,213 @@
+# Span creating
Review Comment:
Please consistent titles, current you have
- span creating
- Capture/continues
- Tag and log of spans
We should use consistent names. Such as,
- Create Span
- Capture and Continuous Snapshot
- ...
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@skywalking.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [skywalking-java] mufiye commented on pull request #442: Expose complete Tracing APIs in the tracing toolkit
Posted by "mufiye (via GitHub)" <gi...@apache.org>.
mufiye commented on PR #442:
URL: https://github.com/apache/skywalking-java/pull/442#issuecomment-1399183707
> A question, how do you make toolkit works in the test scenario?
The CI shows the build failure. I think when I write the test scenarios, there are some wrong maven operations. I try to re-clone the project now, it can't build successfully in local. I will fix it, sorry.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@skywalking.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [skywalking-java] mufiye commented on a diff in pull request #442: Expose complete Tracing APIs in the tracing toolkit
Posted by "mufiye (via GitHub)" <gi...@apache.org>.
mufiye commented on code in PR #442:
URL: https://github.com/apache/skywalking-java/pull/442#discussion_r1084033643
##########
docs/en/setup/service-agent/java-agent/Application-toolkit-tracer.md:
##########
@@ -0,0 +1,213 @@
+# Span creating
+
+* Use `Tracer.createEntrySpan()` API to create entry span, and then use `SpanRef` to contain the reference of created span in agent kernel. The first parameter is operation name of span and the second parameter is the `ContextCarrierRef` instance which is the reference of contextcarrier in agent kernel. If the second parameter is not null, the process of creating entry span will do the extract operation which will be introduced in **inject/extract** scenario.
+
+ ```java
+ import Tracer;
+ ...
+
+ SpanRef spanRef = Tracer.createEnteySpan("${operationName}", null);
+ ```
+
+* Use `Tracer.createLocalSpan()` API to create local span, the only parameter is the operation name of span.
+
+ ```java
+ import Tracer;
+ ...
+
+ SpanRef spanRef = Tracer.createLocalSpan("${operationName}");
+ ```
+
+* Use `Tracer.createExitSpan()` API to create exit span
+
+ * **two parameters case**: the first parameter is the operation name of span, the second parameter is the remote peer which means the peer address of exit operation.
+
+ ```java
+ import Tracer;
+ ...
+
+ SpanRef spanRef = Tracer.createExitSpan("${operationName}", "${remotePeer}");
+ ```
+
+ * **three parameters case**: the first parameter is the operation name of span, the second parameter is the `ContextCarrierRef` instance and the third parameter is the remote peer. This case will be introduced in **inject/extract** scenario.
+
+* Use `Tracer.stopSpan()` API to stop current span
+
+ ```java
+ import Tracer;
+ ...
+
+ Tracer.stopSpan();
+ ```
+
+# Inject/extract
+
+The Inject/extract is to pass context information between different process. The `ContextCarrierRef` contains the reference of `ContextCarrier` and the `CarrierItemRef` contains the reference of CarrierItem. The `CarrierItem` instances compose a linked list.
+
+* Use `Tracer.inject()` to inject information of current context into carrier
+* Use `Tracer.extract()` to extract info from contextCarrier.
+* Use `items()` of `ContextCarrierRef` instance to get head `CarrierItemRef` instance.
+* Use `hasNext()` of `CarrierItemRef` instance to judge if the `CarrierItemRef` has next item.
+* Use `next()` of `CarrierItemRef` instance to get next item
+* Use `getHeadKey` of `CarrierItemRef` instance to get key of current item
+* Use `getHeadValue` of `CarrierItemRef` instance to get value of current item
+* Use `setHeadValue` of `CarrierItemRef` instance to set value of current item
+
+```java
+/*
+ You can consider map as the message body, such as Http, MQ and RPC.
+ This code block do the inject operation in one process and then pass the map message.
+*/
+ContextCarrierRef contextCarrierRef = new ContextCarrierRef();
+Tracer.inject(contextCarrierRef);
+Map<String, String> map = new HashMap<>();
+CarrierItemRef next = contextCarrierRef.items();
+while (next.hasNext()) {
+ next = next.next();
+ map.put(next.getHeadKey(), next.getHeadValue());
+}
+...
+
+```
+
+```java
+// This code block receive the map message and do the extract operation in another process.
Review Comment:
Because I want to remind users that these two code blocks are always used before sending the message and after receiving the message.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@skywalking.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [skywalking-java] mufiye commented on a diff in pull request #442: Expose complete Tracing APIs in the tracing toolkit
Posted by "mufiye (via GitHub)" <gi...@apache.org>.
mufiye commented on code in PR #442:
URL: https://github.com/apache/skywalking-java/pull/442#discussion_r1084046282
##########
docs/en/setup/service-agent/java-agent/Application-toolkit-tracer.md:
##########
@@ -0,0 +1,213 @@
+# Span creating
Review Comment:
how about:
* Create Span
* Inject/Extract Context Carrier
* Capture/Continue Context Snapshot
* Add Span's Tag and Log
* Async prepare/finish
* ActiveSpan
I try to make every title as verb-object phrase.
##########
docs/en/setup/service-agent/java-agent/Application-toolkit-tracer.md:
##########
@@ -0,0 +1,213 @@
+# Span creating
Review Comment:
how about:
* Create Span
* Inject/Extract Context Carrier
* Capture/Continue Context Snapshot
* Add Span's Tag and Log
* Async prepare/finish
* ActiveSpan
I try to make every title as verb-object phrase.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@skywalking.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org