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

Prometheus Client 0.1.4.1 has reverted to choose_encoder over choose_formatter #140

Closed
rhymes opened this issue Aug 25, 2022 · 3 comments
Closed

Comments

@rhymes
Copy link

rhymes commented Aug 25, 2022

Apparently prometheus/client_python#796 went back from:

from prometheus_client.exposition import choose_formatter

to

from prometheus_client.exposition import choose_encoder

I wondered if you'd be interested in a PR which swaps the import orders in here:

try:
# prometheus-client >= 0.14.0
from prometheus_client.exposition import choose_encoder
except ImportError:
# prometheus-client < 0.14.0
from prometheus_client.exposition import choose_formatter as choose_encoder

and keeps choose_encoder as the default name

@rycus86
Copy link
Owner

rycus86 commented Aug 25, 2022

Hm, interested in what's the reason for that suggestion?
I'd have thought it's better to try the latest / more likely import first, and fall back to the other one in case you have that specific version?

@rhymes
Copy link
Author

rhymes commented Aug 25, 2022

@rycus86 omg you're right, for some reason I read the first block as choose_formatter and not choose_encoder

Too many renames :D

Thanks for taking the time and sorry for the mishap!

@rhymes rhymes closed this as completed Aug 25, 2022
@rycus86
Copy link
Owner

rycus86 commented Aug 25, 2022

No problem at all! :)
I was curious if I was missing something. 😅

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

No branches or pull requests

2 participants