Skip to content

Conversation

@mathias-kende
Copy link

This change makes it so that the RestrictedRegistry will always attempt to collect metrics from a collector for which it couldn’t find any metrics name. This is meant to be used with MultiProcessCollector (but there is no strong reason to limit it to that one).

This changes the current behavior of the code but should be somehow safe as it enables filtering in case where it was not working previously. If this is an issue, an alternative approach with an explicit flag could be used (set either in the MultiProcessCollector or in the registry itself).

The intent here is to allow collecting a subset of metrics from production fastapi servers (running in multiprocess mode). So not having to change the library usage in these servers is advantageous to have filtering work out-of-the-box with this change.

@csmarchbanks let me know what you think.

Thanks

@mathias-kende
Copy link
Author

@csmarchbanks do you know if you will be able to review this? If you agree with the idea but would prefer a different implementation, I’m happy to rewrite that differently.

@csmarchbanks
Copy link
Member

Hello! I am out of town for another week but will review this after I return. In the meantime it looks like the DCO check is failing.

This change makes it so that the RestrictedRegistry will always attempt to collect metrics from a collector for which it couldn’t find any metrics name. Although this can be used generally, this is meant to be used with MultiProcessCollector.

This changes the current behavior of the code but should be somehow safe as it enables filtering in case where it was not working previously. If this is an issue, an alternative approach with an explicit flag could be used (set either in the MultiProcessCollector or in the registry).

The intent here is to allow collecting a subset of metrics from production fastapi servers (running in multiprocess mode). So not having to change the library usage in these servers is advantageous to have filtering work out-of-the-box with this change.

Signed-off-by: Mathias Kende <[email protected]>
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.

2 participants