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

Target subscribe state metric #89

Closed
wants to merge 1 commit into from

Conversation

mc-dn
Copy link
Contributor

@mc-dn mc-dn commented Apr 3, 2023

feature: add api server gauge metrics for target subscribe state

What I'm trying to accomplish here is to expose the subscription state of loaded targets for reporting or alerting. If this isn't the right way to implement such a feature, please point me in the right direction and I'll implement it in a way that better follows the architecture of gNMIc.

@karimra
Copy link
Collaborator

karimra commented Apr 4, 2023

Thanks for the PR, I read through it briefly.
I didn't see a way for the gauge to be set back to 0 when the target is not subscribed to anymore.
Maybe a defer subscribeTargetState.WithLabelValues(t.Config.Name).Set(0) at the start the target goroutine could do the job ?

@mc-dn
Copy link
Contributor Author

mc-dn commented Apr 6, 2023

Good point. I'm going to give that a try.

@mc-dn
Copy link
Contributor Author

mc-dn commented Jul 5, 2023

Still haven't forgotten about this. Something with defer() coming soon.

@mc-dn
Copy link
Contributor Author

mc-dn commented Nov 6, 2023

This GitHub account will be closed. I may work on this through another account.

@mc-dn mc-dn closed this Nov 6, 2023
@mc-dn mc-dn deleted the target_status_metric branch November 6, 2023 18:47
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.

None yet

2 participants