Cannot startup fastapi with apm
See original GitHub issueWith start apm in docker, I just set up agent in fastapi. Then I run app with uvicorn, it hangs. To Reproduce
- Start Service with docker compose Reference
- Test apm status
- Run the following simple FastAPI app:
from fastapi import FastAPI
from elasticapm.contrib.starlette import make_apm_client, ElasticAPM
import uvicorn
apm = make_apm_client({'SERVICE_NAME': 'test', 'SERVER_URL': 'http://0.0.0.0:8200'})
app = FastAPI()
app.add_middleware(ElasticAPM, client=apm)
@app.get("/")
def read_root():
return {"Hello": "World"}
if __name__ == '__main__':
uvicorn.run(app, host='0.0.0.0', port=8000)
- Result
Environment
- OS: Mac
- Python version:
3.7.10
- Framework and version:
fastapi==0.66.0
- APM Server version:
image: docker.elastic.co/apm/apm-server:7.13.2
- Agent version:
elastic-apm==6.3.0
Issue Analytics
- State:
- Created 2 years ago
- Reactions:1
- Comments:5 (3 by maintainers)
Top Results From Across the Web
Starlette/FastAPI Support | APM Python Agent ... - Elastic
Incorporating Elastic APM into your Starlette project only requires a few easy steps. Installationedit. Install the Elastic APM agent using pip: $ pip...
Read more >Monitoring Python Applications with Elastic APM
A guide to monitoring Flask, FastAPI and Python Applications with Elastic APM and Kibana.
Read more >tiangolo/fastapi - Gitter
Hi together, I have some problems to get a solution regarding the dependency ... But elasticsearch-apm officially supports fastapi as of a few...
Read more >[Python] New Relic with fastapi - Agents
Hi All I am trying to use newrelic with fastapi in python, i have the same setup for the Flask app which is...
Read more >FastAPI is not quitting when pressing Ctr+c - Stack Overflow
I've read about this problem in using uvicorn and I found the below code snippet to ... CTRL^C doesn't work while startup in...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Hi @alexcc4! Thanks for opening the issue and providing a test case! I opened a PR with a fix in #1185. We’ll make a release with this fix ASAP!
@beniwohli OK~