Skip to content

Exposed stats to watchdog actions.#13151

Merged
htuch merged 4 commits intoenvoyproxy:masterfrom
KBaichoo:wde-stats-expose
Sep 23, 2020
Merged

Exposed stats to watchdog actions.#13151
htuch merged 4 commits intoenvoyproxy:masterfrom
KBaichoo:wde-stats-expose

Conversation

@KBaichoo
Copy link
Contributor

Signed-off-by: Kevin Baichoo kbaichoo@google.com

For an explanation of how to fill out the fields, please see the relevant section
in PULL_REQUESTS.md

Commit Message: Exposed Stats to Watchdog Actions.
Additional Description: This will allow them to create their own counters to expose for monitoring
Risk Level: low
Testing: unit tests
Docs Changes: N/A
Release Notes: N/A?

Signed-off-by: Kevin Baichoo <kbaichoo@google.com>
@KBaichoo KBaichoo requested a review from htuch as a code owner September 17, 2020 18:43
Signed-off-by: Kevin Baichoo <kbaichoo@google.com>
Signed-off-by: Kevin Baichoo <kbaichoo@google.com>
struct GuardDogActionFactoryContext {
Api::Api& api_;
Event::Dispatcher& dispatcher_; // not owned (this is the guard dog's dispatcher)
Stats::Scope& stats_; // not owned (this is the server's stats scope)
Copy link
Member

Choose a reason for hiding this comment

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

FYI, this is inconsistent with other factory contexts, where we use pure virtual functions. By having pure interfaces, we give implementations flexibility on how they want to back each of these attributes.

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 CommonFactoryContext in include/envoy/server/factory_context.h

I wonder if we should prefer passing that in. We do need to pass in the dispatcher associated with the guarddog since there are multiple watchdog instances, each of which needs to keep it's own list of actions.

@htuch what is your recommendation?

Copy link
Member

Choose a reason for hiding this comment

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

In theory, it would be ideal to pass in a minimal factory context, since the provider doesn't need to back it with unused features. In practice, most of these factory contexts now have a lot in common, e.g. compare TransportFactoryContext with CommonFactoryContext. I'd say that if it's trivial to replace with CommonFactoryContext at the site-of-instantiation, then go with a subclass of this for now. I'd add the subclass even if empty, to prevent future interface churn for 3rd party devs.

Copy link
Contributor

Choose a reason for hiding this comment

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

Changing this to an interface seems like a good cleanup. Do you have an opinion about doing it in this PR, as a PR merged before this one or as a followup PR?

Copy link
Member

Choose a reason for hiding this comment

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

No strong opinion as long as it happens :)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Will do a clean up of this then as a follow up.

Signed-off-by: Kevin Baichoo <kbaichoo@google.com>
Copy link
Contributor

@antoniovicente antoniovicente left a comment

Choose a reason for hiding this comment

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

Changes LGTM, waiting on feedback from htuch on the FactoryContext

@KBaichoo
Copy link
Contributor Author

/retest

@repokitteh-read-only
Copy link

Retrying Azure Pipelines, to retry CircleCI checks, use /retest-circle.
Retried failed jobs in: envoy-presubmit

🐱

Caused by: a #13151 (comment) was created by @KBaichoo.

see: more, trace.

Copy link
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, thanks!

@htuch htuch self-assigned this Sep 23, 2020
@htuch htuch merged commit 2059228 into envoyproxy:master Sep 23, 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.

3 participants