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

Allow for pushing metrics to servers #6230

Conversation

ericvaandering
Copy link
Contributor

@ericvaandering ericvaandering commented Jun 8, 2023

@rcarpa @bari12

Here's the push method and the specification/retrieval of the registry.

I also have a new version of the context manager originally defined here: https://github.com/rucio/probes/blob/7b8ba2d345dd9d1795d44f3fc4222183c62a89f8/common/utils/common.py#L39

Which lets you do something like

        with PrometheusPusher() as manager:
            (manager.gauge(name='statsd_name.{rse}.{country}.{rse_type}.{source}',
                           documentation='Space used at an RSE from various sources')
                    .labels(rse=rse['rse'], country=country, rse_type=rse_type, source=source)
                    .set(usage['used']))

And all the metrics you created in there get pushed at the end. Would you prefer I keep that in probes or put this in monitor.py too?

@bari12 bari12 merged commit 86d2b2c into rucio:master Jun 19, 2023
70 checks passed
bari12 pushed a commit that referenced this pull request Jun 19, 2023
* Allow for pushing metrics to servers

* Fix type annotations

* Type on return too

* Get types correct

* Add Any

* It's a dict, not a list

* Add get_registry
@bari12 bari12 linked an issue Jun 19, 2023 that may be closed by this pull request
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.

Make monitoring able to use prometheus push gateway
3 participants