Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[4.x][Doc] - Fix tracing documentation #7962

Merged
merged 7 commits into from
Nov 14, 2023

Conversation

dalexandrov
Copy link
Contributor

Fix Traxing docs #7931

Signed-off-by: Dmitry Aleksandrov <[email protected]>
@dalexandrov dalexandrov added docs 4.x Version 4.x labels Nov 7, 2023
@dalexandrov dalexandrov requested a review from tjquinno November 7, 2023 11:33
@dalexandrov dalexandrov self-assigned this Nov 7, 2023
@oracle-contributor-agreement oracle-contributor-agreement bot added the OCA Verified All contributors have signed the Oracle Contributor Agreement. label Nov 7, 2023
Signed-off-by: Dmitry Aleksandrov <[email protected]>
docs/se/guides/tracing.adoc Outdated Show resolved Hide resolved
Comment on lines 236 to 255
This means a single trace can include spans from multiple services and hosts. OpenTracing uses a `SpanContext` to
Helidon automatically traces across services if the services use the same tracer, for example, the same instance of Jaeger.
This means a single trace can include spans from multiple services and hosts. Helidon uses a `Span.context()` to
propagate tracing information across process boundaries. When you make client API calls, Helidon will
internally call OpenTracing APIs to propagate the `SpanContext`. There is nothing you need to do in your application to make this work.
internally call OpenTracing APIs to propagate the Span Context. There is nothing you need to do in your application to make this work.
Copy link
Member

Choose a reason for hiding this comment

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

V4 still has a SpanContext interface io.helidon.tracing. I think we can continue to refer to it as in the original document. If you want to avoid referring to that type for some reason, "Helidon uses a Span.context()" is awkward wording; maybe just use "span context" here and a couple lines below (lower case with space between the words).

It does make good sense to change OpenTracing to Helidon as shown.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Fixed :)

<artifactId>helidon-tracing-providers-jaeger</artifactId> <3>
</dependency>
----
<1> Helidon Tracing dependencies.
Copy link
Member

Choose a reason for hiding this comment

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

All three are Helidon tracing dependencies so this description does not really distinguish this one from the others. Maybe change this first one to something like "Helidon tracing API" instead?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

ok :)

Comment on lines +308 to +318
service: helidon-se-2
protocol: http
port: 14250
path: /api/traces
tags:
env: development
enabled: true
sampler-type: "const"
sampler-param: 1
log-spans: true
propagation: b3
Copy link
Member

Choose a reason for hiding this comment

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

It's very good to use config settings that will make tracing work easily as a user experiments with it. (The param = 1 for example, IIRC, makes sure traces are flushed right away so they appear in the back-end system with minimal buffering or delay.)

That said, maybe we add a brief sentence explaining that and advising users to use different settings for production servers for performance reasons.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Fixed :)

Comment on lines 478 to 481
response.send(result);
} finally {
span.finish(); // <5>
span.end(); // <5>
}
Copy link
Member

Choose a reason for hiding this comment

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

This code should probably conform to the earlier example which uses span.end() in the try block and span.end(t) in a catch (Throwable t) block.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Fixed :)

----
<dependency>
<groupId>io.helidon.tracing.providers</groupId>
<artifactId>helidon-tracing-providers-jaeger</artifactId>
Copy link
Member

Choose a reason for hiding this comment

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

The OTel case should not refer to the Jaeger provider, should it?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Fixed :)

----
<dependency>
<groupId>io.helidon.tracing.providers</groupId>
<artifactId>helidon-tracing-providers-jaeger</artifactId>
Copy link
Member

Choose a reason for hiding this comment

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

Should the OpenTracing case refer to the Jaeger provider?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Fixed :)

Signed-off-by: Dmitry Aleksandrov <[email protected]>
Signed-off-by: Dmitry Aleksandrov <[email protected]>
Signed-off-by: Dmitry Aleksandrov <[email protected]>
Copy link
Member

@tjquinno tjquinno left a comment

Choose a reason for hiding this comment

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

A few minor edits and one fix to an omission in an example.

propagate tracing information across process boundaries. When you make client API calls, Helidon will
internally call OpenTracing APIs to propagate the `SpanContext`. There is nothing you need to do in your application to make this work.
internally call OpenTelemetry APIs or OpenTracing APIs to propagate the Span Context. There is nothing you need to do in your application to make this work.
Copy link
Member

Choose a reason for hiding this comment

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

If you are going to make any other changes, please change Span Context to either

span context

or

SpanContext (with back ticks before and after)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

fixed

<artifactId>helidon-tracing-providers-jaeger</artifactId> <3>
</dependency>
----
<1> Helidon Tracing API dependencies.
Copy link
Member

Choose a reason for hiding this comment

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

If you are going to make any other changes, please remove the word "dependencies" because all the called-out elements are dependencies.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Fixed


try {
requestBuilder.property(
ClientTracingFilter.CURRENT_SPAN_CONTEXT_PROPERTY_NAME, request.spanContext()); // <3>
ClientTracingFilter.CURRENT_SPAN_CONTEXT_PROPERTY_NAME, span.context()); // <3>

String result = requestBuilder // <4>
.get(String.class);
response.send(result);
Copy link
Member

Choose a reason for hiding this comment

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

After the response.send(result) line add span.end() so in the normal case the span is properly ended.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Fixed


String result = requestBuilder // <4>
.get(String.class);
response.send(result);
} finally {
span.finish(); // <5>
} catch (Throwandle t) {
Copy link
Member

Choose a reason for hiding this comment

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

Change Throwandle to Throwable

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Fixed

Copy link
Member

Choose a reason for hiding this comment

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

New typo: line 480 should be span.end(); (not spa)

Copy link
Member

Choose a reason for hiding this comment

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

Looks like 481 still says Throwandle; it needs to be Throwable

Signed-off-by: Dmitry Aleksandrov <[email protected]>
@dalexandrov dalexandrov marked this pull request as ready for review November 13, 2023 09:27
Copy link
Member

@tjquinno tjquinno left a comment

Choose a reason for hiding this comment

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

One new typo; one left over from earlier.


String result = requestBuilder // <4>
.get(String.class);
response.send(result);
} finally {
span.finish(); // <5>
} catch (Throwandle t) {
Copy link
Member

Choose a reason for hiding this comment

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

New typo: line 480 should be span.end(); (not spa)


String result = requestBuilder // <4>
.get(String.class);
response.send(result);
} finally {
span.finish(); // <5>
} catch (Throwandle t) {
Copy link
Member

Choose a reason for hiding this comment

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

Looks like 481 still says Throwandle; it needs to be Throwable

Signed-off-by: Dmitry Aleksandrov <[email protected]>
@dalexandrov dalexandrov requested a review from tjquinno November 14, 2023 09:17
@dalexandrov dalexandrov merged commit a9b6444 into helidon-io:main Nov 14, 2023
12 checks passed
@dalexandrov dalexandrov deleted the 7931_fix_tracing_docs branch November 14, 2023 13:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
4.x Version 4.x docs OCA Verified All contributors have signed the Oracle Contributor Agreement.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants