-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
a42f66d
commit 69e0656
Showing
1 changed file
with
36 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,44 @@ | ||
locals { | ||
metric_labels = [ | ||
{ | ||
key = "job_name" | ||
description = "The name of the job." | ||
}, | ||
{ | ||
key = "location" | ||
description = "The dagster user location of the job." | ||
}, | ||
{ | ||
key = "dagster_backfill" | ||
description = "The dagster backfill of the job, if value is created by a backfill job run." | ||
}, | ||
{ | ||
key = "dagster_partition" | ||
description = "The dagster partition of the job, if value is created by a partitioned job run." | ||
}, | ||
{ | ||
key = "environment" | ||
description = "The environment in which the job ran." | ||
}, | ||
{ | ||
key = "dagster_schedule_name" | ||
description = "The name of the schedule that triggered the job, if value is created by a scheduled job." | ||
} | ||
] | ||
} | ||
|
||
resource "google_monitoring_metric_descriptor" "dagster_jobs" { | ||
description = "Successful dagster jobs." | ||
display_name = "dagster-jobs" | ||
type = "custom.googleapis.com/dagster/job_success" | ||
metric_kind = "GAUGE" | ||
value_type = "BOOL" | ||
labels { | ||
key = "job_name" | ||
value_type = "STRING" | ||
description = "The name of the job." | ||
dynamic "labels" { | ||
for_each = local.metric_labels | ||
content { | ||
key = labels.value["key"] | ||
value_type = "STRING" | ||
description = labels.value["description"] | ||
} | ||
} | ||
} |