Skip to content

Expose trace sampling controls#444

Merged
mattklein123 merged 3 commits intoenvoyproxy:masterfrom
douglas-reid:trace-sampling
Jan 31, 2018
Merged

Expose trace sampling controls#444
mattklein123 merged 3 commits intoenvoyproxy:masterfrom
douglas-reid:trace-sampling

Conversation

@douglas-reid
Copy link
Copy Markdown
Contributor

@douglas-reid douglas-reid commented Jan 30, 2018

This PR adds trace sampling controls to the public API. It is a continuation of work from PR #375.

The controls added:

Signed-off-by: Douglas Reid douglas-reid@users.noreply.github.com

Signed-off-by: Douglas Reid <douglas-reid@users.noreply.github.com>

// Target percentage of requests managed by this HTTP connection manager that will be randomly
// traced. Defaults to 100%. This variable is a direct analog for the variable of the same name
// in the :ref:`HTTP Connection Manager <config_http_conn_man_runtime>`.
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I think it would be useful to add a note comparing the two fields. It's not entirely obvious to me how they differ.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

agreed

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I was similarly confused. I attempted a bit of clarification based on my read of the existing documentation and code. Hopefully my attempt has added clarity. Please let me know what you think.

@mattklein123
Copy link
Copy Markdown
Member

FYI this PR was just closed that was working on the same thing. Please reconcile with the giant set of comments in there. Thank you. #375

@mattklein123
Copy link
Copy Markdown
Member

Oops sorry didn't see comment on other PR. Yes if this is reconciled with that, would love to see this move forward.

@douglas-reid
Copy link
Copy Markdown
Contributor Author

@mattklein123 as far as I am aware, this is reconciled -- with the new bits being a move to use the newly-added Percent message for both fields (as suggested by @htuch).

Copy link
Copy Markdown
Member

@mattklein123 mattklein123 left a comment

Choose a reason for hiding this comment

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

thanks, small comments


// Target percentage of requests managed by this HTTP connection manager that will be traced
// after all other checks have been applied (force tracing, sampling, etc.). Defaults to 100%.
// This variable is a direct analog for the variable named 'global_enabled' in the :ref:`HTTP
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

nit: "runtime variable"

Percent sampling = 3;

// Target percentage of requests managed by this HTTP connection manager that will be randomly
// traced. Defaults to 100%. This variable is a direct analog for the variable of the same name
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

"runtime variable"


// Target percentage of requests managed by this HTTP connection manager that will be randomly
// traced. Defaults to 100%. This variable is a direct analog for the variable of the same name
// in the :ref:`HTTP Connection Manager <config_http_conn_man_runtime>`.
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

agreed

Signed-off-by: Douglas Reid <douglas-reid@users.noreply.github.com>
@douglas-reid
Copy link
Copy Markdown
Contributor Author

PTAL. I've tried to clean up the docs as suggested in comments. I also added back the client_sampling config bit which I inadvertently left off in the initial commit.

I've renamed sampling to overall_sampling in an attempt to clarify (based on my perhaps erroneous understanding of how the runtime params are used).

Copy link
Copy Markdown
Member

@mattklein123 mattklein123 left a comment

Choose a reason for hiding this comment

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

LGTM. Thanks for the doc explanations, very helpful (and I believe accurate). Just one small x-link nit.

repeated string request_headers_for_tags = 2;

// Target percentage of requests managed by this HTTP connection manager that will be force
// traced if the *x-client-trace-id* header is set. This field is a direct analog for the
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

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

@kyessenov kyessenov left a comment

Choose a reason for hiding this comment

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

Thank you for writing the explanation. It is very helpful.

@wora
Copy link
Copy Markdown
Contributor

wora commented Jan 31, 2018

Thanks for the detailed documentation.

/lgtm

htuch
htuch previously approved these changes Jan 31, 2018
Copy link
Copy Markdown
Member

@htuch htuch left a comment

Choose a reason for hiding this comment

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

LGTM modulo remaining comments.

Signed-off-by: Douglas Reid <douglas-reid@users.noreply.github.com>
@douglas-reid
Copy link
Copy Markdown
Contributor Author

Thanks for the quick reviews!

I've added the ref for x-client-trace-id as requested. PTAL.

Copy link
Copy Markdown
Member

@mattklein123 mattklein123 left a comment

Choose a reason for hiding this comment

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

Thanks!

@mattklein123 mattklein123 merged commit 3ab669b into envoyproxy:master Jan 31, 2018
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.

5 participants