You are viewing an outdated version of the documentation.

This documentation is for an older version (1.4.7) of Dagster. You can view the version of this page from our latest release below.

Prometheus (dagster-prometheus)

class dagster_prometheus.PrometheusResource(*, gateway, timeout=30)[source]

This resource is used to send metrics to a Prometheus Pushgateway.

Example:

from dagster_prometheus import PrometheusResource
from dagster import Definitions, job, op

@op
def example_prometheus_op(prometheus: PrometheusResource):
    prometheus.push_to_gateway(job="my_job")

@job
def my_job():
    example_prometheus_op()

defs = Definitions(
    jobs=[my_job],
    resources={"prometheus": PrometheusResource(gateway="http://pushgateway.local")},
)
class dagster_prometheus.resources.PrometheusClient[source]

Integrates with Prometheus via the prometheus_client library.

dagster_prometheus.prometheus_resource ResourceDefinition[source]