We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
Default behavior when using documentation will show the /metrics endpoint in open-api autogenerated page as returning application/json
/metrics
application/json
instrumentator.instrument(app).expose(app)
Result:
This can be resolved by using:
from starlette.responses import PlainTextResponse instrumentator.instrument(app).expose(app, response_class=PlainTextResponse)
Another way of doint that would be:
from starlette.responses import Response class PrometheusResponse(Response): media_type = prometheus_client.CONTENT_TYPE_LATEST instrumentator.instrument(app).expose(app, response_class=PrometheusResponse)
Probably there are more ways to resolve, but I suggest that this would at least be included in docs.
The text was updated successfully, but these errors were encountered:
Any idea on how we can customize the Example Value?
Sorry, something went wrong.
Thanks, doing this for custom examples.
instrumentator.instrument(app).expose( app, response_class= PlainTextResponse, responses= { 200: { "content": { "text/plain": { "example": '# Your sample response\n' '# Goes here' }, }, }, } )
No branches or pull requests
Default behavior when using documentation will show the
/metrics
endpoint in open-api autogenerated page as returningapplication/json
Result:
This can be resolved by using:
Another way of doint that would be:
Probably there are more ways to resolve, but I suggest that this would at least be included in docs.
The text was updated successfully, but these errors were encountered: