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

A72: OpenTelemetry Tracing #389

Open
wants to merge 28 commits into
base: master
Choose a base branch
from
Open

Conversation

YifeiZhuang
Copy link
Contributor

@YifeiZhuang YifeiZhuang commented Aug 22, 2023

Design doc: go/grpc-open-telemetry-tracing-design

cc. @yashykt @zasweq @XuanWang-Amos

@yashykt
Copy link
Member

yashykt commented Sep 13, 2023

I don't see the span name mentioned here. I was going to ask whether we can be consistent on the naming. @dfawley had suggested we "rcvd" instead of "recv" as the shortform for received in the OTel metrics #380

@YifeiZhuang
Copy link
Contributor Author

I don't see the span name mentioned here. I was going to ask whether we can be consistent on the naming. @dfawley had suggested we "rcvd" instead of "recv" as the shortform for received in the OTel metrics #380

The span name will inherit what census uses, like in server Recv.<service name>.<method name>, client side Sent.<service name>.<method name> (A45), as mentioned in New Function in OpenTelemetry Plugin

In the new function we will produce the same tracing information as we produce for Census

But it looks A45 does not mention Recv at all.
rcvd seems fine. When there is decision there, we can certainly make the name consistent here.

A72-open-telemetry-tracing.md Outdated Show resolved Hide resolved
A72-open-telemetry-tracing.md Outdated Show resolved Hide resolved
A72-open-telemetry-tracing.md Show resolved Hide resolved
A72-open-telemetry-tracing.md Show resolved Hide resolved
A72-open-telemetry-tracing.md Outdated Show resolved Hide resolved
A72-open-telemetry-tracing.md Outdated Show resolved Hide resolved
A72-open-telemetry-tracing.md Outdated Show resolved Hide resolved
A72-open-telemetry-tracing.md Outdated Show resolved Hide resolved
A72-open-telemetry-tracing.md Outdated Show resolved Hide resolved
A72-open-telemetry-tracing.md Outdated Show resolved Hide resolved
A72-open-telemetry-tracing.md Outdated Show resolved Hide resolved
A72-open-telemetry-tracing.md Outdated Show resolved Hide resolved
A72-open-telemetry-tracing.md Outdated Show resolved Hide resolved
A72-open-telemetry-tracing.md Outdated Show resolved Hide resolved
A72-open-telemetry-tracing.md Outdated Show resolved Hide resolved
A72-open-telemetry-tracing.md Outdated Show resolved Hide resolved
YifeiZhuang and others added 5 commits December 19, 2023 15:05
ejona's language suggestion

Co-authored-by: Eric Anderson <ejona@google.com>
1. [done] Add that OpenTelemetry module should document that things/configurations will change as OT changes.
2. [done] Move C++ fast path to rationale. Capture two alternatives about the fast path that may have in the future.
3. [done] Update C++ API about adding a new method in OpenTelemetryPluginBuilder, and reference to the current code and the gRFC.
4. [todo] complete the C++ GrpcTraceBinPropagator and GrpcTextMapCarrier
A72-open-telemetry-tracing.md Outdated Show resolved Hide resolved
A72-open-telemetry-tracing.md Outdated Show resolved Hide resolved
A72-open-telemetry-tracing.md Outdated Show resolved Hide resolved
A72-open-telemetry-tracing.md Outdated Show resolved Hide resolved
A72-open-telemetry-tracing.md Outdated Show resolved Hide resolved
A72-open-telemetry-tracing.md Outdated Show resolved Hide resolved
@YifeiZhuang
Copy link
Contributor Author

@markdroth thanks for the suggestions. They are great. Please take a look again.

@dfawley kind reminder please review and approve.

Copy link
Member

@markdroth markdroth left a comment

Choose a reason for hiding this comment

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

This new organization looks much better! I have a few more specific comments along the same lines.

Please let me know if you have any questions. Thanks!

A72-open-telemetry-tracing.md Outdated Show resolved Hide resolved
A72-open-telemetry-tracing.md Outdated Show resolved Hide resolved
A72-open-telemetry-tracing.md Outdated Show resolved Hide resolved
A72-open-telemetry-tracing.md Outdated Show resolved Hide resolved
A72-open-telemetry-tracing.md Outdated Show resolved Hide resolved
A72-open-telemetry-tracing.md Show resolved Hide resolved
#### Go
In Go, the OpenTelemetry stream tracers and interceptors will be provided for users to install.

TODO: add Go API.
Copy link
Member

Choose a reason for hiding this comment

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

Can we fill in the Go section before we merge this? @zasweq

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@zasweq please take a look. I added the Go API, similar to Otel metrics, and comments about how users will expect from it.

A72-open-telemetry-tracing.md Outdated Show resolved Hide resolved
A72-open-telemetry-tracing.md Outdated Show resolved Hide resolved
A72-open-telemetry-tracing.md Outdated Show resolved Hide resolved
@YifeiZhuang
Copy link
Contributor Author

This new organization looks much better! I have a few more specific comments along the same lines.

Please let me know if you have any questions. Thanks!

@markdroth Thanks for the quick feedbacks, I should have resolved all the comments. Please take a look again.

Copy link
Member

@markdroth markdroth left a comment

Choose a reason for hiding this comment

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

This is looking better and better! Comments are mostly fine details at this point.

Please let me know if you have any questions. Thanks!

A72-open-telemetry-tracing.md Outdated Show resolved Hide resolved
A72-open-telemetry-tracing.md Outdated Show resolved Hide resolved
A72-open-telemetry-tracing.md Outdated Show resolved Hide resolved
A72-open-telemetry-tracing.md Outdated Show resolved Hide resolved
A72-open-telemetry-tracing.md Outdated Show resolved Hide resolved
A72-open-telemetry-tracing.md Outdated Show resolved Hide resolved
A72-open-telemetry-tracing.md Outdated Show resolved Hide resolved
A72-open-telemetry-tracing.md Outdated Show resolved Hide resolved
A72-open-telemetry-tracing.md Outdated Show resolved Hide resolved
A72-open-telemetry-tracing.md Outdated Show resolved Hide resolved
@YifeiZhuang
Copy link
Contributor Author

@ejona86 @yashykt @markdroth @zasweq @dfawley updated tracing info based on conversation yesterday. Please review. Thanks!

Copy link
Member

@markdroth markdroth left a comment

Choose a reason for hiding this comment

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

Just a few details left here!

PLMK if you have any questions. Thanks!

A72-open-telemetry-tracing.md Show resolved Hide resolved
A72-open-telemetry-tracing.md Outdated Show resolved Hide resolved
A72-open-telemetry-tracing.md Outdated Show resolved Hide resolved
A72-open-telemetry-tracing.md Outdated Show resolved Hide resolved
A72-open-telemetry-tracing.md Outdated Show resolved Hide resolved
A72-open-telemetry-tracing.md Outdated Show resolved Hide resolved
A72-open-telemetry-tracing.md Outdated Show resolved Hide resolved
A72-open-telemetry-tracing.md Outdated Show resolved Hide resolved
A72-open-telemetry-tracing.md Outdated Show resolved Hide resolved
Copy link
Member

@yashykt yashykt left a comment

Choose a reason for hiding this comment

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

I think my comments are mostly minor assuming we can easily change the formatting of the event messages and attributes

(it depends on implementation whether there is a single event or two separate
events for compressed/uncompressed message sizes, the same below)
with name "Outbound message sent" and the following attributes:
* key `message.event.type` with string value "SENT".
Copy link
Member

Choose a reason for hiding this comment

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

is this attribute "message.event.type" useful? The message already says sent?

* When the application sends an outbound message to the transport, add Event(s)
(it depends on implementation whether there is a single event or two separate
events for compressed/uncompressed message sizes, the same below)
with name "Outbound message sent" and the following attributes:
Copy link
Member

Choose a reason for hiding this comment

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

nit: feel free to ignore
Is "outbound" adding any value here?

events for compressed/uncompressed message sizes, the same below)
with name "Outbound message sent" and the following attributes:
* key `message.event.type` with string value "SENT".
* key `message.message.id` with integer value of the seq no. The seq no. indicates
Copy link
Member

Choose a reason for hiding this comment

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

how was the namespacing for "message.message.id" decided?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It was from the Otel java opencensus shim. Languages can be different.
I think whenever possible, we can make the name generated from the shim and the one generated directly from otel be consistent. This is not happening because the naming in our census needs improvements. And I am fine with that. @markdroth @ejona86

(https://github.com/open-telemetry/opentelemetry-java/blob/main/opencensus-shim/src/main/java/io/opentelemetry/opencensusshim/SpanConverter.java#L24-L27)

A72-open-telemetry-tracing.md Outdated Show resolved Hide resolved
A72-open-telemetry-tracing.md Outdated Show resolved Hide resolved
Copy link
Member

@markdroth markdroth left a comment

Choose a reason for hiding this comment

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

Just one issue remaining here!

PLMK if you have any questions. Thanks!

A72-open-telemetry-tracing.md Outdated Show resolved Hide resolved
Copy link
Member

@markdroth markdroth left a comment

Choose a reason for hiding this comment

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

Thanks for all the edits! This looks great!

tracer factory API will be stabilized. OpenTelemetryModule will be created with
an OpenTelemetry API instance passing in for necessary configurations.
Users can also rely on SDK autoconfig extension that configures the sdk object
through environmental variables or Java system properties, then pass the
Copy link
Member

Choose a reason for hiding this comment

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

Nit: "environment" variables, not "environmental".

Comment on lines +158 to +184
// DialOption returns a dial option which enables OpenTelemetry instrumentation
// code for a grpc.ClientConn.
//
// Client applications interested in instrumenting their grpc.ClientConn should
// pass the dial option returned from this function as a dial option to
// grpc.Dial().
//
// Using this option will always lead to instrumentation, however in order to
// use the data a SpanExporter must be registered with the TraceProvider in the
// TraceOption. Client side has retries, so a Unary and Streaming Interceptor are
// registered to handle per RPC traces, and a Stats Handler is registered to handle
// per RPC attempt trace. These three components registered work together in
// conjunction, and do not work standalone.
func DialOption(to TraceOptions) grpc.DialOption {}

// ServerOption returns a server option which enables OpenTelemetry
// instrumentation code for a grpc.Server.
//
// Server applications interested in instrumenting their grpc.Server should pass
// the server option returned from this function as an argument to
// grpc.NewServer().
//
// Using this option will always lead to instrumentation, however in order to
// use the data a SpanExporter must be registered with the TraceProvider option.
// Server side does not have retries, so a registered Stats Handler is the only
// option that is returned.
func ServerOption(to TraceOptions) grpc.ServerOption {}
Copy link
Member

Choose a reason for hiding this comment

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

These bits are pre-existing from after Metrics support is added. I think instead we'll just be adding a field called TraceOptions to opentelemetry.Options

Copy link
Contributor

Choose a reason for hiding this comment

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

Yeah we will. Options will have Metrics Options as the in flight PR, I'll add tracing options, and eventually Logging Options.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

oh I see this in the open grpc/grpc-go#7166, This will be outdated but i think not necessary to keep all updated - we are racing with ourselves.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

8 participants