Skip to main content

Fastapi Middleware to work with skywalking

Project description

Wrapper para trabalhar com a API do Cloud Logging

Procedimento para upload no Pypi

Pré requisitos

Instalar pacotes python python3 -m pip install --upgrade setuptools build wheel twine

Build e enviar ao PYPI

python3 -m build

python3 -m twine upload dist/*

Instalar o pacote no projeto

pip install fastapi-skywalking-trace

Utilização da biblioteca

Essa biblioteca espera que você passe o schema dos dados da tabela

Aconselho criar um arquivo de schema.py ou model.py onde seja definido a estrutura de dados da tabela.

Instanciar o Middleware

Com o schema definido, você deve instanciar um classe

from starlette.middleware import Middleware
from fastapi_skywalking_trace.middleware import SkywalkingMiddleware
middlewares = [
    Middleware(
        SkywalkingMiddleware,
        service_name='extractor',
        collector_address='35.266.138.244:15870',
        protocol = 'http'
    )
]

app = FastAPI(
    title='Iris Typification', 
    openapi_url="/api/v1/openapi.json",
    middleware=middlewares
    )

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

fastapi-skywalking-trace-0.0.1.tar.gz (3.3 kB view hashes)

Uploaded Source

Built Distribution

fastapi_skywalking_trace-0.0.1-py3-none-any.whl (3.8 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page