Add an AIOHTTP exporter#1139
Merged
csmarchbanks merged 2 commits intoprometheus:masterfrom Sep 19, 2025
Merged
Conversation
Contributor
Author
|
oops, I just noticed ruff reformatted a file it shouldn't have |
Since the client now requires a minimum of Python 3.9, we don't need to have this feature gate in place any more Signed-off-by: Lexi Robinson <lexi@lexi.org.uk>
c2e78d5 to
f1a4c87
Compare
Member
csmarchbanks
left a comment
There was a problem hiding this comment.
Thanks! I am happy enough to have lightweight helpers like this, my one ask would be to put it into its own module similar to twisted rather than in the base module and __init__.py. That makes it a bit more clear that the code is separate and to be sure not to depend on it in core.
tox.ini
Outdated
|
|
||
| [testenv] | ||
| deps = | ||
| aiohttp |
Member
There was a problem hiding this comment.
Similar to twisted it would be good to only install this onto certain versions so that we don't break something core in environments where aiohttp is not present.
Unfortunately the AIOHTTP library doesn't support ASGI and apparently has no plans to do so which makes the ASGI exporter not suitable for anyone using it to run their python server. Where possible this commit follows the existing ASGI implementation and runs the same tests for consistency. Signed-off-by: Lexi Robinson <lexi@lexi.org.uk>
f1a4c87 to
cac3175
Compare
Contributor
Author
|
Sure thing, how's this? |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
I wrote a significantly cruder version of this for a project and then realised that other people might find it useful so I spent a few hours writing a nicer one with tests and docs and so on.
I'm sure you don't want to have custom exporters for every http library under the sun but I figured since it's a pretty widely used library it'd be ok. Feel free to close if I was wrong.
cc @csmarchbanks