Getting this to work with FastAPI or another Async Backend
Nobody has claimed this yet.
Assessment
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Newbie friendliness
- 35/100
Research direction
Start by reproducing the FastAPI setup shown in the issue and inspect the LogDNAHandler path around requests.post. Confirm where execution blocks and establish expected behavior for logging from an async backend; done means the request completes without hanging the backend and the handler's request path can be observed.
Written by the indexing model from the issue text.
Description
When attempting to do this in my FastAPI backend. I am noticing that the request is getting blocked.
handler = LogDNAHandler(key='')
logging.getLogger().addHandler(handler)
logging.info("Checking to see if it works!")
Looking at the library. I included the print "Request Sent". It never gets printed, the request does not execute, the backend sits there and I need to restart the entire app.
try:
headers = {
'user-agent': self.user_agent,
'apikey': self.key
}
response = requests.post(url=self.url,
json=data,
params={
'hostname': self.hostname,
'ip': self.ip,
'mac': self.mac,
'tags': self.tags,
'now': int(time.time() * 1000)
},
stream=True,
allow_redirects=True,
timeout=self.request_timeout,
headers=headers)
print("Request Sent")
- Dominant language
- Python
- Stars
- 49
- Forks
- 36
- PR merge metrics
- No merged PRs in 30d
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from logdna/python
-
Difficulty 3/5 1-2 days Newbie friendliness 25/100
-
enhancement
Difficulty 4/5 3-5 days Newbie friendliness 20/100
Similar issues
-
Add: hunch Open
Difficulty 2/5 1-3 hours Newbie friendliness 74/100
AbdelStark/awesome-typesafe#104 ·
-
enhancement
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
DiamondLightSource/dodal#2211 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
openml/openml-python#1749 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
sipyourdrink-ltd/bernstein#6191 ·