sparse-leather-70336
12/07/2022, 10:49 PMexport const errorOccuredPolicy = new gcp.monitoring.AlertPolicy(
'some_error_occured',
{
combiner: 'OR',
conditions: [
{
conditionThreshold: {
comparison: 'COMPARISON_GT',
thresholdValue: 0,
duration: '60s',
filter: `
resource.type="metric" AND
resource.labels.project_id="my_project_id" AND
resource.labels.name="<http://logging.googleapis.com/user/MY_USER_DEFINED_METRIC|logging.googleapis.com/user/MY_USER_DEFINED_METRIC>"
`,
},
displayName:
'an error of some type has occured',
},
],
displayName: pulumi.interpolate`${stack}: some error occured`,
notificationChannels: [opsgenieNotificationChannel.id],
}
);
* Error creating AlertPolicy: googleapi: Error 400: The provided filter matches more than one metric. TimeSeries data are limited to a single metric per request
resource.labels.name
references a single custom metric that does exist (I can see it in GCP gui/metric explorer)