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

Added red metrics #10

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

Added red metrics #10

wants to merge 1 commit into from

Conversation

slivetssergey
Copy link
Collaborator

No description provided.

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
Copy link
Member

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)])
Copy link
Member

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

Copy link
Member

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

Copy link
Member

@cybergrind cybergrind left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

see comments

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