-
Notifications
You must be signed in to change notification settings - Fork 7.8k
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
[mixer] Introduce tracespan template into Mixer #1349
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Took a quick pass. Looks good.
// name: default | ||
// namespace: istio-system | ||
// spec: | ||
// traceId: request.headers["x-b3-traceid"] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These should be snake case right ? May be camelCase might work too, what is our recommendation ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I was under the impression we wanted "human case" config, where camelCase was preferred to snake_case. But I actually am not certain. @geeknoid ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think camelCase is what we're using.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for clarifying.
// being described by this message. If this is a root span, then this field | ||
// MUST be empty. | ||
// | ||
// Optional. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This cannot be auto generated. Consider explaining what will happen if this is not provided ?
string span_id = 2; | ||
|
||
// Parent Span ID is the unique identifier for a parent span of the span | ||
// being described by this message. If this is a root span, then this field |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
by this span instance ?
|
||
// The start time of the span. | ||
// | ||
// Required: This field MUST be configured in generated instances. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
consider removing "in generated instances". May be remove the entire sentence.. just Required is sufficient, unless we want to explain why is this required.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done.
// Examples: | ||
// "http.method" : "POST" | ||
// "peer.service" : "foo.default.svc.cluster.local" | ||
// "request_size_bytes" : 234 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
should we make this request.size
? and "peer.service" : source.service
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Or just copy the same example from above
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've removed the examples altogether, as they overlap with example attribute expressions.
// namespace: istio-system | ||
// spec: | ||
// traceId: request.headers["x-b3-traceid"] | ||
// spanId: request.headers["x-b3-spanid"] | "" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
are the x-b3-spanid and x-b3-parentspanid well known header names. If we expect operators to use these for most case, consider explaining a bit about whey those tags mean.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
these are well-known header names (from the zipkin set of headers). they are described in full on our distributed tracing task. I've added a link to that Task here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Cool, that link will be helpful.
|
||
option (istio.mixer.v1.template.template_variety) = TEMPLATE_VARIETY_REPORT; | ||
|
||
// TraceSpan represents an individual span within a distributed trace. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should this be Trace span instead of TraceSpan?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Are you suggesting renaming the package, or just wondering if I should put a space in between the two words? This naming matches LogEntry
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I see, I was referring to the absence of space between the two words. Let's stick to LogEntry format then.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
PTAL.
|
||
option (istio.mixer.v1.template.template_variety) = TEMPLATE_VARIETY_REPORT; | ||
|
||
// TraceSpan represents an individual span within a distributed trace. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Are you suggesting renaming the package, or just wondering if I should put a space in between the two words? This naming matches LogEntry
.
// name: default | ||
// namespace: istio-system | ||
// spec: | ||
// traceId: request.headers["x-b3-traceid"] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I was under the impression we wanted "human case" config, where camelCase was preferred to snake_case. But I actually am not certain. @geeknoid ?
// namespace: istio-system | ||
// spec: | ||
// traceId: request.headers["x-b3-traceid"] | ||
// spanId: request.headers["x-b3-spanid"] | "" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
these are well-known header names (from the zipkin set of headers). they are described in full on our distributed tracing task. I've added a link to that Task here.
// Examples: | ||
// "http.method" : "POST" | ||
// "peer.service" : "foo.default.svc.cluster.local" | ||
// "request_size_bytes" : 234 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've removed the examples altogether, as they overlap with example attribute expressions.
|
||
// The start time of the span. | ||
// | ||
// Required: This field MUST be configured in generated instances. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM.
|
||
option (istio.mixer.v1.template.template_variety) = TEMPLATE_VARIETY_REPORT; | ||
|
||
// TraceSpan represents an individual span within a distributed trace. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I see, I was referring to the absence of space between the two words. Let's stick to LogEntry format then.
// name: default | ||
// namespace: istio-system | ||
// spec: | ||
// traceId: request.headers["x-b3-traceid"] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for clarifying.
// namespace: istio-system | ||
// spec: | ||
// traceId: request.headers["x-b3-traceid"] | ||
// spanId: request.headers["x-b3-spanid"] | "" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Cool, that link will be helpful.
// Required. | ||
string trace_id = 1; | ||
|
||
// Span ID is the unique identifier for a span within a trace. It is assigned |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this auto assigned if not provided ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes. Although, I think that is an adapter detail. Certainly, proper implementations will auto-assign.
/lgtm |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: guptasu The full list of commands accepted by this bot can be found here.
Needs approval from an approver in each of these OWNERS Files:
You can indicate your approval by writing |
Automatic merge from submit-queue remove nodeport from eureka service **What this PR does / why we need it**: Removes `NodePort` designation from Eureka service. This might cause issues with the automated tests if it is not removed. Fortunately, no Eureka tests have been enabled yet, so it shouldn't be causing issues right now. **Which issue this PR fixes** *(optional, in `fixes #<issue number>(, fixes #<issue_number>, ...)` format, will close that issue when PR gets merged)*: fixes # **Special notes for your reviewer**: **Release note**: ```release-note NONE ```
e44ce9b
to
f6a7abe
Compare
* Introduce tracespan template into Mixer * Address review comments * Add generated files
* Introduce tracespan template into Mixer * Address review comments * Add generated files
What this PR does / why we need it:
This PR adds a template for trace spans to Mixer. A trace span template enables the integration of tracing adapters into Mixer. Early prototyping using this template demonstrated success in deriving tracing spans from proxy Report()s for services for jaeger, zipkin, and stackdriver backends. Operators can control the level of detail forwarded to tracing backends (as well as span names, for instance) using this template. The template also lays the groundwork for supporting Mixer ingestion of trace span data.
Which issue this PR fixes (optional, in
fixes #<issue number>(, fixes #<issue_number>, ...)
format, will close that issue when PR gets merged): fixes #fixes istio/old_mixer_repo#797, fixes: istio/old_mixer_repo#1509
Special notes for your reviewer:
Release note: