Notification Channel Test Message to Pub Sub is different as the real one

Hi Team,

 

If you could please check the Testing message that you sent when you are creating a notification pubsub channel, since is in a different format to the one that is sending the real monitoring as an incident. 

I was always asking myself why is the format different and the reason is that the test pubsub message is in another format :

 

{
insertId"000000-7e937a8e-2f79-466e-9524-2dabcff24010"
jsonPayload{
incident{1}
version"test"
}
labels{1}
logName"projects/notifications/logs/cloudfunctions.googleapis.com%2Fcloud-functions"
receiveTimestamp"2021-12-14T15:15:58.905813884Z"
resource{2}
timestamp"2021-12-14T15:15:48.774Z"
trace"projects/notifications/traces/9809285a9026f676d02255702281ff43"
}
 
and the real one 
 
{
"incident": {
"incident_id": "0.opqiw61fsv7p",
"scoping_project_id": "internal-project",
"scoping_project_number": 12345,
"url": "https://console.cloud.google.com/monitoring/alerting/incidents/0.lxfiw61fsv7p?project=internal-proje...",
"started_at": 1577840461,
"ended_at": 1577877071,
"state": "closed",
"resource_id": "11223344",
"resource_name": "internal-project gke-cluster-1-default-pool-e2df4cbd-dgp3",
"resource_display_name": "gke-cluster-1-default-pool-e2df4cbd-dgp3",
"resource_type_display_name": "VM Instance",
"resource": {
"type": "gce_instance",
"labels": {
"instance_id": "11223344",
"project_id": "internal-project",
"zone": "us-central1-c"
}
},
"metric": {
"type": "compute.googleapis.com/instance/cpu/utilization",
"displayName": "CPU utilization",
"labels": {
"instance_name": "the name of the VM instance"
}
},
"metadata": {
"system_labels": { "labelkey": "labelvalue" },
"user_labels": { "labelkey": "labelvalue" }
},
"policy_name": "Monitor-Project-Cluster",
"policy_user_labels" : {
"user-label-1" : "important label",
"user-label-2" : "another label"
},
"condition_name": "VM Instance - CPU utilization [MAX]",
"threshold_value": "0.9",
"observed_value": "0.835",
"condition": {
"name": "projects/internal-project/alertPolicies/1234567890123456789/conditions/1234567890123456789",
"displayName": "VM Instance - CPU utilization [MAX]",
"conditionThreshold": {
"filter": "",
"aggregations": [
{
"alignmentPeriod": "120s",
"perSeriesAligner": "ALIGN_MEAN"
}
],
"comparison": "COMPARISON_GT",
"thresholdValue": 0.9,
"duration": "0s",
"trigger": {
"count": 1
}
}
},
"documentation": {
"content": "TEST ALERT\n\npolicy.name=projects/internal-project/alertPolicies/1234567890123456789\n\npolicy.display_name=Monitored-Project-NO-GROUPBY\n\ncondition.name=projects/nternal-project/alertPolicies/1234567890123456789/conditions/1234567890123456789\n\ncondition.display_name=VM Instance - CPU utilization [MAX]\n\nproject=internal-project\n\nresrouce.project=internal-project \n\nDONE\n",
"mime_type": "text/markdown"
},
"summary": "CPU utilization for internal-project gke-cluster-1-16-default-pool-e2df4cbd-dgp3 with metric labels {instance_name=gke-cluster-1-default-pool-e2df4cbd-dgp3} and system labels {state=ACTIVE} returned to normal with a value of 0.835."
},
"version": "1.2"
}
0 2 692
2 REPLIES 2

Hi friveros,

Thank you for your post. We're looking into this now and we're working to reproduce the issue. We may reach out if we have questions, but the goal is to have the test and the actual message match. 

Hi friveros,

We weren't able to replicate your response, would you be able to email us at cloud-alerting-feedback@google.com with your setup to help us replicate and assist you further? 

 

Thanks,

Alisa

Top Solution Authors