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

Remove metrics for deleted projections #7

Closed
dev-rowbot opened this issue Sep 18, 2019 · 4 comments

Comments

@dev-rowbot
Copy link
Contributor

@dev-rowbot dev-rowbot commented Sep 18, 2019

Hi,

First of all - thanks for a very useful exporter!

After using it for a while I've noticed that when projections are deleted they still show up in the metrics:

# HELP eventstore_projection_running If 1, projection is in 'Running' state
# TYPE eventstore_projection_running gauge
eventstore_projection_running{projection="$by_category"} 1
eventstore_projection_running{projection="$by_correlation_id"} 1
eventstore_projection_running{projection="$by_event_type"} 1
eventstore_projection_running{projection="$stream_by_category"} 1
eventstore_projection_running{projection="$streams"} 1
eventstore_projection_running{projection="Test_Fail"} 0

I think this is because the Gauge/label is added to projectionRunning but if the projection no longer exists in stats it should be removed.

I think you will need to compare the projections available in stats with the projections being collected and delete the labels for the removed projections: GaugeVec.DeleteLabelValues

I would make the changes myself but it will take me some time to figure out the Go code :-)

@dev-rowbot

This comment has been minimized.

Copy link
Contributor Author

@dev-rowbot dev-rowbot commented Sep 18, 2019

Sorry - missed some details - projection="Test_Fail" has been deleted from eventstore but is still being shown in the metrics

@marcinbudny

This comment has been minimized.

Copy link
Owner

@marcinbudny marcinbudny commented Sep 18, 2019

Hi and thank you for the contribution. I will take a look at this later.

marcinbudny added a commit that referenced this issue Sep 21, 2019
Fixes #7 - reset gauge to remove deleted projections
@marcinbudny

This comment has been minimized.

Copy link
Owner

@marcinbudny marcinbudny commented Sep 21, 2019

Version 0.7.0 is now released.

@dev-rowbot

This comment has been minimized.

Copy link
Contributor Author

@dev-rowbot dev-rowbot commented Sep 25, 2019

Thank you very much

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants
You can’t perform that action at this time.