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

Update prometheus guide to a working example and add Envoy metrics port #6269

Merged

Conversation

sunjayBhatia
Copy link
Member

Updates docs page guide instructions and sample manifests

Also removes prometheus annotations from Contour/Envoy and adds the metrics port to Envoy DaemonSet/Deployment so that Prometheus PodMonitors can reach the metrics server. The prometheus-operator project uses PodMonitors rather than annotations to configure Prometheus to discover scrape endpoints.

@sunjayBhatia sunjayBhatia added release-note/docs A documentation change for the release notes. release-note/minor A minor change that needs about a paragraph of explanation in the release notes. release-note/deprecation A deprecation or removal that needs about a paragraph of explanation in the release notes. labels Mar 14, 2024
@sunjayBhatia sunjayBhatia requested a review from a team as a code owner March 14, 2024 18:25
@sunjayBhatia sunjayBhatia requested review from tsaarni, skriss, a team, davinci26 and clayton-gonsalves and removed request for a team March 14, 2024 18:25
@sunjayBhatia sunjayBhatia removed the release-note/docs A documentation change for the release notes. label Mar 14, 2024
@sunjayBhatia sunjayBhatia changed the title docs: Update prometheus guide to a working example Update prometheus guide to a working example and add Envoy metrics port Mar 14, 2024
Copy link

codecov bot commented Mar 14, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 81.62%. Comparing base (bd33dfc) to head (af7fbff).

❗ Current head af7fbff differs from pull request most recent head 5f3aac7. Consider uploading reports for the commit 5f3aac7 to get more accurate results

Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##             main    #6269      +/-   ##
==========================================
+ Coverage   81.61%   81.62%   +0.01%     
==========================================
  Files         133      133              
  Lines       15858    15857       -1     
==========================================
+ Hits        12942    12944       +2     
+ Misses       2621     2619       -2     
+ Partials      295      294       -1     

see 11 files with indirect coverage changes

Copy link

github-actions bot commented Apr 8, 2024

The Contour project currently lacks enough contributors to adequately respond to all PRs.

This bot triages PRs according to the following rules:

  • After 14d of inactivity, lifecycle/stale is applied
  • After 30d of inactivity since lifecycle/stale was applied, the PR is closed

You can:

  • Ensure your PR is passing all CI checks. PRs that are fully green are more likely to be reviewed. If you are having trouble with CI checks, reach out to the #contour channel in the Kubernetes Slack workspace.
  • Mark this PR as fresh by commenting or pushing a commit
  • Close this PR
  • Offer to help out with triage

Please send feedback to the #contour channel in the Kubernetes Slack

@github-actions github-actions bot added the lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. label Apr 8, 2024
@sunjayBhatia sunjayBhatia removed the lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. label Apr 8, 2024
Copy link
Member

@tsaarni tsaarni left a comment

Choose a reason for hiding this comment

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

I tested this and looks good!

Couple of comments/questions inline and also, at the top of the guide, there is still reference to the annotations that can now be removed:

default, annotations to gather them are in all the `deployment` yamls and they
should work out of the box with most configurations.

then go to `http://localhost:9090` in your browser.

#### Access the Alertmanager web UI
Now add [`PodMonitor`][6] resources for scraping metrics from Contour and Envoy pods in the `projectcontour` namespace:
Copy link
Member

Choose a reason for hiding this comment

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

I found some discussion that suggested preferring ServiceMonitor when service exists. Was there particular reason why choose PodMonitor instead of ServiceMonitor? I guess there should not be any difference at the end.

Copy link
Contributor

Choose a reason for hiding this comment

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

We use PodMonitor internally because when the pods of Envoy become not-ready during shutdown (preStop) you end up losing prom scrapes if you use ServiceMonitor

site/content/docs/main/guides/prometheus.md Outdated Show resolved Hide resolved
changelogs/unreleased/6269-sunjayBhatia-minor.md Outdated Show resolved Hide resolved
Copy link

The Contour project currently lacks enough contributors to adequately respond to all PRs.

This bot triages PRs according to the following rules:

  • After 14d of inactivity, lifecycle/stale is applied
  • After 30d of inactivity since lifecycle/stale was applied, the PR is closed

You can:

  • Ensure your PR is passing all CI checks. PRs that are fully green are more likely to be reviewed. If you are having trouble with CI checks, reach out to the #contour channel in the Kubernetes Slack workspace.
  • Mark this PR as fresh by commenting or pushing a commit
  • Close this PR
  • Offer to help out with triage

Please send feedback to the #contour channel in the Kubernetes Slack

@github-actions github-actions bot added the lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. label Apr 25, 2024
@sunjayBhatia sunjayBhatia removed the lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. label May 3, 2024
@sunjayBhatia
Copy link
Member Author

I tested this and looks good!

Couple of comments/questions inline and also, at the top of the guide, there is still reference to the annotations that can now be removed:

default, annotations to gather them are in all the `deployment` yamls and they
should work out of the box with most configurations.

I just removed that 2 sentences since the annotation part is no longer relevant

Updates docs page guide instructions and sample manifests

Also removes prometheus annotations from Contour/Envoy and adds the metrics port to Envoy DaemonSet/Deployment so that Prometheus PodMonitors can reach the metrics server. The prometheus-operator project uses PodMonitors rather than annotations to configure Prometheus to discover scrape endpoints.

Signed-off-by: Sunjay Bhatia <sunjayb@vmware.com>
Signed-off-by: Sunjay Bhatia <sunjayb@vmware.com>
Signed-off-by: Sunjay Bhatia <sunjayb@vmware.com>
Signed-off-by: Sunjay Bhatia <sunjayb@vmware.com>
Signed-off-by: Sunjay Bhatia <sunjayb@vmware.com>
Signed-off-by: Sunjay Bhatia <sunjayb@vmware.com>
Signed-off-by: Sunjay Bhatia <sunjayb@vmware.com>
Copy link
Member

@skriss skriss left a comment

Choose a reason for hiding this comment

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

LGTM once linter issue is fixed

Copy link
Member

@tsaarni tsaarni 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 to me as well 👍

Signed-off-by: Sunjay Bhatia <sunjayb@vmware.com>
@sunjayBhatia sunjayBhatia enabled auto-merge (squash) May 10, 2024 13:52
@sunjayBhatia sunjayBhatia merged commit 06761ae into projectcontour:main May 10, 2024
24 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
release-note/deprecation A deprecation or removal that needs about a paragraph of explanation in the release notes. release-note/minor A minor change that needs about a paragraph of explanation in the release notes.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants