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

[mixer] Introduce tracespan template into Mixer #1349

Merged
merged 3 commits into from
Nov 9, 2017

Conversation

douglas-reid
Copy link
Contributor

@douglas-reid douglas-reid commented Nov 3, 2017

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:

Tracing template added to Mixer

Copy link
Contributor

@guptasu guptasu left a 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"]
Copy link
Contributor

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 ?

Copy link
Contributor Author

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 ?

Copy link
Contributor

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.

Copy link
Contributor

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.
Copy link
Contributor

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
Copy link
Contributor

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.
Copy link
Contributor

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.

Copy link
Contributor Author

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
Copy link
Contributor

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 ?

Copy link
Contributor

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

Copy link
Contributor Author

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"] | ""
Copy link
Contributor

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.

Copy link
Contributor Author

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.

Copy link
Contributor

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.
Copy link
Contributor

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?

Copy link
Contributor Author

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.

Copy link
Contributor

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.

Copy link
Contributor

@geeknoid geeknoid left a comment

Choose a reason for hiding this comment

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

Looks good.

Copy link
Contributor Author

@douglas-reid douglas-reid left a 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.
Copy link
Contributor Author

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"]
Copy link
Contributor Author

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"] | ""
Copy link
Contributor Author

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
Copy link
Contributor Author

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.
Copy link
Contributor Author

Choose a reason for hiding this comment

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

done.

Copy link
Contributor

@guptasu guptasu left a 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.
Copy link
Contributor

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"]
Copy link
Contributor

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"] | ""
Copy link
Contributor

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
Copy link
Contributor

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 ?

Copy link
Contributor Author

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.

@guptasu
Copy link
Contributor

guptasu commented Nov 6, 2017

/lgtm

@istio-merge-robot
Copy link

[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 /approve in a comment
You can cancel your approval by writing /approve cancel in a comment

vbatts pushed a commit to vbatts/istio that referenced this pull request Nov 8, 2017
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
```
@rshriram rshriram changed the title Introduce tracespan template into Mixer [mixer] Introduce tracespan template into Mixer Nov 8, 2017
@douglas-reid douglas-reid merged commit 9377ba0 into istio:master Nov 9, 2017
vadimeisenbergibm pushed a commit to vadimeisenbergibm/istio that referenced this pull request Nov 10, 2017
* Introduce tracespan template into Mixer

* Address review comments

* Add generated files
jamsajones pushed a commit to jamsajones/istio that referenced this pull request Jan 3, 2018
* Introduce tracespan template into Mixer

* Address review comments

* Add generated files
@douglas-reid douglas-reid deleted the trace-template branch June 18, 2018 17:20
0x01001011 pushed a commit to thedemodrive/istio that referenced this pull request Jul 16, 2020
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.

Design a template to allow tracing data to flow through Mixer Support diverse tracing backends in Mixer
8 participants