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

feat: Add operation configuration to gauge metric. Fixes #10662 #10774

Merged
merged 6 commits into from
Apr 19, 2023

Conversation

eduardodbr
Copy link
Member

@eduardodbr eduardodbr commented Mar 28, 2023

Hey,
first time contributing to Argo, I've read the contributing guidelines but let me know if something else is needed.

Prometheus Gauge interface allows to Set(), Add() and Sub() to the metric's current value. However, Argo workflows only accept setting a new value. This PR implements a new configuration field to the gauge metric called operation. This field accepts three values: Add, Set, and Sub. To avoid breaking changes, it uses Set by default if the field is not configured.

Let me know what you think about the implementation. I can also add the field to the documentation examples.

Fixes #10662



Signed-off-by: eduardodbr <eduardodbr@hotmail.com>
Signed-off-by: eduardodbr <eduardodbr@hotmail.com>
Signed-off-by: eduardodbr <eduardodbr@hotmail.com>
@eduardodbr eduardodbr marked this pull request as ready for review March 29, 2023 11:36
Copy link
Member

@rohankmr414 rohankmr414 left a comment

Choose a reason for hiding this comment

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

minor nit, rest LGTM!

pkg/apis/workflow/v1alpha1/workflow_types.go Show resolved Hide resolved
Signed-off-by: eduardodbr <eduardodbr@hotmail.com>
@terrytangyuan
Copy link
Member

Could you resolve the conflicts? Thanks!

Signed-off-by: eduardodbr <eduardodbr@hotmail.com>
@terrytangyuan terrytangyuan merged commit fd292ca into argoproj:master Apr 19, 2023
@eduardodbr eduardodbr deleted the operation_gauge branch April 20, 2023 00:01
JPZ13 pushed a commit to pipekit/argo-workflows that referenced this pull request Jul 4, 2023
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.

Allow to access metric value on custom metrics
3 participants