-
Notifications
You must be signed in to change notification settings - Fork 1
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
Added red metrics #10
base: master
Are you sure you want to change the base?
Conversation
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 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Probably value 600 seconds will be healthier
Usage: | ||
>>> redis_storage = RedisMetricsStorage('redis://localhost:6379/1') | ||
... exporter = PrometheusExporter(storage=redis_storage) | ||
... exporter.metrics([ExporterMetricItem(name='some_code_metrics', mean_count=5)]) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
because it would be tedious to repeat prefix parameter in every decorator, probably we can use default from environ, like RED_PREFIX
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
see comments
No description provided.