logdna / logdna/python

Getting this to work with FastAPI or another Async Backend

オープン
#112 コメント 1 件 リアクション 0 件 担当者 0 名 GitHub で見る

まだ誰も着手していません。

主要言語
Python
スター
49
フォーク
36
PR マージ指標
30日以内にマージされた PR はありません

説明

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") 

コントリビューションガイド

コントリビューションガイドを開く

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

調査の方向性

まず、issue に示されている FastAPI のセットアップを再現し、requests.post 周辺の LogDNAHandler のパスを調査します。実行がどこでブロックするかを確認し、非同期バックエンドからのロギングに期待される動作を明らかにします。バックエンドをハングさせずにリクエストが完了し、ハンドラーのリクエストパスを観測できれば完了です。

索引モデルが issue の本文から書いたものです。

評価

技術スタック
fastapi, python
領域
backend
issue の種類
バグ
難易度
4/5
見積もり時間
3〜5日
活発さ
停滞
明瞭さ
説明が足りない
初心者へのやさしさ
35/100

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。