Ask AI

Prometheus (dagster-prometheus)

dagster_prometheus.PrometheusResource ResourceDefinition[source]

Config Schema:
gateway (dagster.StringSource):

The url for your push gateway. Either of the form ‘http://pushgateway.local’, or ‘pushgateway.local’. Scheme defaults to ‘http’ if none is provided

timeout (Union[dagster.IntSource, None], optional):

is how long delete will attempt to connect before giving up. Defaults to 30s.

Default Value: 30

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.

Legacy

dagster_prometheus.prometheus_resource ResourceDefinition[source]

Config Schema:
gateway (dagster.StringSource):

The url for your push gateway. Either of the form ‘http://pushgateway.local’, or ‘pushgateway.local’. Scheme defaults to ‘http’ if none is provided

timeout (Union[dagster.IntSource, None], optional):

is how long delete will attempt to connect before giving up. Defaults to 30s.

Default Value: 30