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

jsonnet: Support scraping the config-reloader for AlertManager and Pr… #1344

Merged
merged 1 commit into from
Sep 22, 2021

Conversation

philipgough
Copy link
Contributor

…ometheus

Description

This change updates the ServiceMonitor to scrape the reloader sidecar for Promtheus and AlertManager via the service when the components are not set to listen on localhost.

Type of change

What type of changes does your code introduce to the kube-prometheus? Put an x in the box that apply.

  • CHANGE (fix or feature that would cause existing functionality to not work as expected)
  • FEATURE (non-breaking change which adds functionality)
  • BUGFIX (non-breaking change which fixes an issue)
  • ENHANCEMENT (non-breaking change which improves existing functionality)
  • NONE (if none of the other choices apply. Example, tooling, build system, CI, docs, etc.)

Changelog entry

Support scraping config-reloader sidecar for Prometheus and AlertManager StatefulSets

Copy link
Member

@ArthurSens ArthurSens left a comment

Choose a reason for hiding this comment

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

Just tested and it works as expected :)
image

Looks like reloader only adds 7 metrics, pretty cheap. From my side, it is ok to have the scrape enabled by default, but I'll let others leave their opinion prior to merging

@philipgough
Copy link
Contributor Author

@ArthurSens thanks for the review and testing it. I was happy to leave it off as default actually but just wanted to ensure CI passed with it enabled. As you said, we can wait to see what others think and am happy to leave it or change it either way.

Copy link
Contributor

@dgrisonnet dgrisonnet left a comment

Choose a reason for hiding this comment

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

Just a few comments from my side but it looks great overall, thanks @philipgough.

@@ -19,6 +19,8 @@ local utils = import './lib/utils.libsonnet';
common: {
namespace: 'default',
platform: null,
scrapeConfigReloader: true,
Copy link
Contributor

Choose a reason for hiding this comment

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

I don't think this should be conditional since we thrive to monitor all the applications that we run.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@dgrisonnet - understood, my thinking was that there might be situations where the downstream might be injecting a proxy for example or setting the reloader to listen on localhost where it wouldn't be scrape-able via the service monitor. Any concerns in that respect?

@@ -19,6 +19,8 @@ local utils = import './lib/utils.libsonnet';
common: {
namespace: 'default',
platform: null,
scrapeConfigReloader: true,
reloaderPort: 8080,
Copy link
Contributor

Choose a reason for hiding this comment

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

This value is specific to each component so I wouldn't define its value globally but rather per component.

@philipgough
Copy link
Contributor Author

@dgrisonnet removed the option for conditional config and added component specific config for the port as requested.

@@ -136,6 +137,7 @@ function(params) {
spec: {
ports: [
{ name: 'web', targetPort: 'web', port: 9093 },
{ name: 'reloader-web', port: am._config.reloaderPort, targetPort: am._config.reloaderPort },
Copy link
Contributor

Choose a reason for hiding this comment

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

targetPort should be reloader-web

@@ -98,6 +99,7 @@ function(params) {
spec: {
ports: [
{ name: 'web', targetPort: 'web', port: 9090 },
{ name: 'reloader-web', port: p._config.reloaderPort, targetPort: p._config.reloaderPort },
Copy link
Contributor

Choose a reason for hiding this comment

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

targetPort should be reloader-web

Copy link
Contributor

@dgrisonnet dgrisonnet left a comment

Choose a reason for hiding this comment

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

Awesome, thank you @philipgough.

@dgrisonnet dgrisonnet merged commit 7f1092c into prometheus-operator:main Sep 22, 2021
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