Skip to content

Latest commit

 

History

History
35 lines (21 loc) · 765 Bytes

README.md

File metadata and controls

35 lines (21 loc) · 765 Bytes

graphene-prometheus

📊 Prometheus exporter middleware for the Graphene GraphQL framework.

This is still under development. Use at your own risk.

Usage

Install using pip install graphene-prometheus or poetry add graphene-prometheus.

Graphene

import graphene_prometheus

schema.execute("THE QUERY", middleware=[graphene_prometheus.PrometheusMiddleware()])

See https://docs.graphene-python.org/en/latest/execution/middleware/#middleware for more information.

Django

In settings.py:

GRAPHENE = {
    "MIDDLEWARE": ["graphene_prometheus.PrometheusMiddleware"],
}

See https://docs.graphene-python.org/projects/django/en/latest/settings/#middleware for more information.

FastAPI / Starlette

Coming soon.