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

Expose Envoy's /stats for statsd agents #7173

Merged
merged 6 commits into from
Feb 3, 2020

Conversation

tpaschalis
Copy link
Contributor

@tpaschalis tpaschalis commented Jan 30, 2020

This PR closes #7070 connect: Option to Expose Envoy's /stats/ for agents like DataDog that can read from there.

Description of changes

  • Add a new StatsBindAddr field to Envoy's BootstrapConfig
  • Rename the generatePrometheusConfig to generateMetricsListenerConfig and allow passing in the bind address, the name of the listener, the path that will be exposed and the prefix that will be rewritten
  • Add testcases for new functionality
  • Run all tests

Comments/Notes

  • I initially attempted to configure a single listener, that would expose two routes.
    In that case, we'd have to distinguish between
    • StatsBindAddr == PrometheusBindAddr, where a single listener is needed and
    • StatsBindAddr != PrometheusBindAddr, where two separate listeners should be configured.

This change would have made the code somewhat more complicated, so I thought I'd leave it as two separate listener fields in any case. Let me know what you think!

  • A seemingly unrelated test keeps failing.

Copy link
Member

@banks banks left a comment

Choose a reason for hiding this comment

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

@tpaschalis this PR is awesome, thanks for your effort!

The tests are great and thorough and this is super close.

I had a couple of suggestions inline that mostly revolve around the first point here but just to summarize changes requested:

  1. I think we should expose the whole /stats prefix - sorry if that wasn't clear in the issue I probably didn't specify it well enough!
  2. Can you add the new config option to the Envoy docs the source is in website/source/docs/connect/proxies/envoy.html.md and you can mostly follow the example set for the prometheus ones.

Thanks again. This is a fantastic PR and much appreciated!

command/connect/envoy/bootstrap_config.go Outdated Show resolved Hide resolved
command/connect/envoy/bootstrap_config.go Outdated Show resolved Hide resolved
command/connect/envoy/bootstrap_config.go Outdated Show resolved Hide resolved
command/connect/envoy/bootstrap_config.go Outdated Show resolved Hide resolved
@tpaschalis tpaschalis requested a review from banks January 30, 2020 17:22
@tpaschalis
Copy link
Contributor Author

Hey @banks, sorry for pinging you. When you have some time, let me know how this looks ^^

Copy link
Member

@banks banks left a comment

Choose a reason for hiding this comment

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

Thanks @tpaschalis this looks fantastic!

I had one minor suggestion to fix a comment in the documentation which you can just commit through GitHub UI if that's easiest and then I think this is good to merge!

Oh, we also have our CLA bot complaining that it's waiting for something but I don't see it prompting you to sign the CLA so there might be something stuck there. Paging @alvin-huang is there something we can do to fix CLA bot here?

website/source/docs/connect/proxies/envoy.md Outdated Show resolved Hide resolved
@tpaschalis
Copy link
Contributor Author

I've already signed the CLA, and pushed your most recent change directly through the GitHub UI. Let's see how the bot works this time!

@tpaschalis tpaschalis requested a review from banks February 3, 2020 15:34
@banks
Copy link
Member

banks commented Feb 3, 2020

Looks like CLA bot is happy now! Thanks again. I'll wait for the CI run and then we can get this merged!

@banks
Copy link
Member

banks commented Feb 3, 2020

🎉 Thanks again @tpaschalis, this is a fantastic contribution to Consul!

@banks banks merged commit a335aa5 into hashicorp:master Feb 3, 2020
@banks
Copy link
Member

banks commented Feb 3, 2020

Should end up in Consul 1.7.0 pretty soon!

@tpaschalis
Copy link
Contributor Author

I'd like to personally thank you. It was my first contribution to Consul, and you helped immensely with your positive attitude and help!! I'm already looking for the next issue to work on!

@tpaschalis tpaschalis deleted the expose-envoy-statsd branch February 4, 2020 10:00
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.

connect: Option to Expose Envoy's /stats/ for agents like DataDog that can read from there.
2 participants