Open
Conversation
cybergrind
reviewed
Jul 22, 2021
| def __init__(self, redis_url: str = None, expiration: int = None): | ||
| self.redis_url = redis_url | ||
| self.connection = self.connect() | ||
| self.expiration = expiration or 60 * 60 * 24 * 30 |
Member
There was a problem hiding this comment.
Probably value 600 seconds will be healthier
cybergrind
reviewed
Jul 22, 2021
| Usage: | ||
| >>> redis_storage = RedisMetricsStorage('redis://localhost:6379/1') | ||
| ... exporter = PrometheusExporter(storage=redis_storage) | ||
| ... exporter.metrics([ExporterMetricItem(name='some_code_metrics', mean_count=5)]) |
Member
There was a problem hiding this comment.
This declaration is way too long and requires us to register the same metric twice.
I believe we could automatically register metrics in decorator and by default export everything with sane defaults.
The only thing that we possible can add to store different kind of metrics in the same redis instance - probably add some kind of prefix paramter
Member
There was a problem hiding this comment.
because it would be tedious to repeat prefix parameter in every decorator, probably we can use default from environ, like RED_PREFIX
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.