Skip to content

MetricsCollectionProfiles: Reword and update KEP #1791

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

Open
wants to merge 26 commits into
base: master
Choose a base branch
from

Conversation

rexagod
Copy link
Member

@rexagod rexagod commented May 7, 2025

Re-opening the KEP PR to backfill on the required proposal context.

Signed-off-by: Pranshu Srivastava rexagod@gmail.com


Continues: #1298

@openshift-ci openshift-ci bot requested review from jan--f and simonpasquier May 7, 2025 07:33
@rexagod rexagod force-pushed the metrics-collection-profiles branch from 559e546 to 34d451e Compare May 8, 2025 08:06
@rexagod
Copy link
Member Author

rexagod commented May 8, 2025

/cc @JoaoBraveCoding

Requesting a review here. If things look good to you, I'll request the API folks to take a look. 🙂

@openshift-ci openshift-ci bot requested a review from JoaoBraveCoding May 8, 2025 08:52
JoaoBraveCoding and others added 25 commits May 8, 2025 14:45
ServiceMonitor examples

Signed-off-by: JoaoBraveCoding <jmarcal@redhat.com>
Co-authored-by: Simon Pasquier <spasquie@redhat.com>
Signed-off-by: JoaoBraveCoding <jmarcal@redhat.com>
Co-authored-by: Pranshu Srivastava <prasriva@redhat.com>
Co-authored-by: Pranshu Srivastava <prasriva@redhat.com>
added documentation for the CLI utility based on the recent discussion.

Signed-off-by: Pranshu Srivastava <rexagod@gmail.com>
Co-authored-by: Joao Marcal <joao.marcal12@gmail.com>
Co-authored-by: Joao Marcal <joao.marcal12@gmail.com>
Co-authored-by: Joao Marcal <joao.marcal12@gmail.com>
Co-authored-by: Junqi Zhao <juzhao@redhat.com>
@rexagod rexagod force-pushed the metrics-collection-profiles branch 2 times, most recently from 44fc0aa to 4670400 Compare May 8, 2025 10:40
Re-opening the KEP PR to backfill on the required proposal context.

Signed-off-by: Pranshu Srivastava <rexagod@gmail.com>
@rexagod rexagod force-pushed the metrics-collection-profiles branch from 4670400 to 577a948 Compare May 12, 2025 08:34
Copy link
Contributor

openshift-ci bot commented May 12, 2025

@rexagod: all tests passed!

Full PR test history. Your PR dashboard.

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. I understand the commands that are listed here.

Copy link
Contributor

@JoaoBraveCoding JoaoBraveCoding left a comment

Choose a reason for hiding this comment

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

LGTM 👍 Thank you for resuming this work 🙌

Copy link
Contributor

openshift-ci bot commented May 14, 2025

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: JoaoBraveCoding
Once this PR has been reviewed and has the lgtm label, please assign jan--f for approval. For more information see the Code Review Process.

The full list of commands accepted by this bot can be found here.

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@openshift-bot
Copy link

Inactive enhancement proposals go stale after 28d of inactivity.

See https://github.com/openshift/enhancements#life-cycle for details.

Mark the proposal as fresh by commenting /remove-lifecycle stale.
Stale proposals rot after an additional 7d of inactivity and eventually close.
Exclude this proposal from closing by commenting /lifecycle frozen.

If this proposal is safe to close now please do so with /close.

/lifecycle stale

@openshift-ci openshift-ci bot added the lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. label Jun 11, 2025
data:
config.yaml: |
prometheusK8s:
collectionProfile: full
Copy link
Contributor

Choose a reason for hiding this comment

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

Enum values should be PascalCase

// metrics that are exposed by the platform components. In the `minimal`
// profile, Prometheus only collects metrics necessary for the default
// platform alerts, recording rules, telemetry and console dashboards.
CollectionProfile CollectionProfile `json:"collectionProfile,omitempty"`
Copy link
Contributor

Choose a reason for hiding this comment

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

Is this field required or optional?

What happens when it is not set?

How does the upgrade work for existing clusters, is there any action needed?

reviewers:
- openshift/openshift-team-monitoring
approvers:
- "@openshift/openshift-team-monitoring"
Copy link
Contributor

Choose a reason for hiding this comment

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

Should be a single person

approvers:
- "@openshift/openshift-team-monitoring"
api-approvers:
- "@dgrisonnet"
Copy link
Contributor

Choose a reason for hiding this comment

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

Damien is not an API approver, this should be me, or David Eads

Given this, the following steps would be necessary to implement this
enhancement:

- expose a configuration option in the cluster-monitoring-operator ConfigMap
Copy link
Contributor

Choose a reason for hiding this comment

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

Given we are moving away from the configmap to something more structured, what impact does adding new configmap items have on that effort? It can only hinder the effort no?

Comment on lines +161 to +165
- monitors with the
`monitoring.openshift.io/collection-profile: <selected profile>` label.
- monitors without the `monitoring.openshift.io/collection-profile` profile
label present, to retain the default behaviour (for components that didn't
opt-in for metrics collection profile).
Copy link
Contributor

Choose a reason for hiding this comment

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

Does this mechanism allow a component to disable scraping altogether? Or just to enable filtering the metrics it exposes? Or both?

What implementation is needed from the operator dev, is it just the yaml, or do they need operator/operand changes too?


OpenShift teams can decide if they want to adopt this feature. Without any
change to a monitor, if a user picks a profile in the CMO config, things
will work as they did before. When an OpenShift team wants to implement
Copy link
Contributor

Choose a reason for hiding this comment

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

If you decide later to add an additional profile, how would that impact existing teams? What would you have to do before you could introduce the new profile?

metricRelabelings:
- sourceLabels: [__name__]
action: keep
regex: "federate_samples|federate_filtered_samples"
Copy link
Contributor

Choose a reason for hiding this comment

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

If I end up with a very large regex, can I split this into multiple entries within the metricRelabelings list?

Copy link
Contributor

Choose a reason for hiding this comment

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

not directly but you can do tricks to split a long expression into several steps

  metricRelabelings:
  - sourceLabels: [__name__]
    action: replace
    replacement: "keep"
    regex: "federate_samples|federate_filtered_samples"
    targetLabel: __tmp_keep_or_drop
  - sourceLabels: [__name__]
    action: replace
    regex: "foo|bar"
    replacement: "keep"
    targetLabel: __tmp_keep_or_drop
  - action: replace
    regex: "keep"
    replacement: ""

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants