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

Adjust Prometheus plugin to the latest aioprometheus version 21.9.0 #211

Merged
merged 1 commit into from
Sep 27, 2021

Conversation

giffels
Copy link
Member

@giffels giffels commented Sep 24, 2021

aioprometheus has changed its API so that metrics are automatically registered when they are created according to https://github.com/claws/aioprometheus/blob/master/CHANGELOG.md. With newer versions the unittest is failing, because the method to register new metrics does not exists anymore. This pull request changes the Prometheus plugin accordingly and enforces the installation of aioprometheus>=21.9.0.

@giffels giffels added potential problem Avoid foreseeable misuse Improvement Code Improvements labels Sep 24, 2021
@codecov-commenter
Copy link

Codecov Report

Merging #211 (e02885d) into master (9728248) will not change coverage.
The diff coverage is 100.00%.

❗ Current head e02885d differs from pull request most recent head 67ad26c. Consider uploading reports for the commit 67ad26c to get more accurate results
Impacted file tree graph

@@           Coverage Diff           @@
##           master     #211   +/-   ##
=======================================
  Coverage   99.55%   99.55%           
=======================================
  Files          42       42           
  Lines        1795     1795           
=======================================
  Hits         1787     1787           
  Misses          8        8           
Impacted Files Coverage Δ
tardis/utilities/attributedict.py 100.00% <ø> (ø)
tardis/adapters/sites/cloudstack.py 100.00% <100.00%> (ø)
tardis/adapters/sites/htcondor.py 100.00% <100.00%> (ø)
tardis/adapters/sites/moab.py 100.00% <100.00%> (ø)
tardis/adapters/sites/openstack.py 100.00% <100.00%> (ø)
tardis/adapters/sites/slurm.py 100.00% <100.00%> (ø)
tardis/plugins/prometheusmonitoring.py 100.00% <100.00%> (ø)
tardis/resources/dronestates.py 99.32% <100.00%> (ø)
tardis/resources/poolfactory.py 100.00% <0.00%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 9d45bbc...67ad26c. Read the comment docs.

@giffels giffels requested review from a team, maxfischer2781 and mschnepf and removed request for a team September 24, 2021 14:33
Copy link
Member

@mschnepf mschnepf left a comment

Choose a reason for hiding this comment

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

Looks good to me. Thanks for that fix :-)

@maxfischer2781
Copy link
Member

I did some digging through the aioprometheous source and judging by their older __init__.py the new imports should work down to v16.06.1 (there aren't any older tags available). Judging by the age of the initial PR (#142) I assume TARDIS works with aioprometheus>=19.10.0.

@giffels
Copy link
Member Author

giffels commented Sep 27, 2021

I did some digging through the aioprometheous source and judging by their older __init__.py the new imports should work down to v16.06.1 (there aren't any older tags available). Judging by the age of the initial PR (#142) I assume TARDIS works with aioprometheus>=19.10.0.

Yes, imports might work down to v16.06.1, but the API changes (automated registering of metrics) have been introduced in 21.9.0 according to the changelog and the commit. So, with earlier versions the changes will not work.

Copy link
Member

@maxfischer2781 maxfischer2781 left a comment

Choose a reason for hiding this comment

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

Thanks a lot for checking the version dependency! Go for it.

@giffels giffels merged commit d26af13 into MatterMiners:master Sep 27, 2021
@giffels giffels deleted the fix-prometheus-import branch September 27, 2021 14:19
giffels added a commit to giffels/tardis that referenced this pull request Apr 19, 2022
giffels added a commit to giffels/tardis that referenced this pull request Jan 20, 2023
giffels added a commit to giffels/tardis that referenced this pull request Feb 24, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Improvement Code Improvements potential problem Avoid foreseeable misuse
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants