Versions (relevant - OpenSearch/Dashboard/Server OS/Browser):
opensearch 2.16version
this is below is my hits in alert
{
"_shards": {
"total": 1,
"failed": 0,
"successful": 1,
"skipped": 0
},
"hits": {
"hits": [
{
"_index": "ss4o_metrics-otel-2024.08.29",
"_source": {
"unit": "{cpu}",
"exemplars": [],
"kind": "GAUGE",
"name": "k8s.pod.cpu.usage",
"flags": 0,
"description": "Total CPU usage (sum of all cores per second) averaged over the sample window",
"startTime": "2024-08-29T05:29:48Z",
"attributes": {
"instrumentationScope.name": "otelcol/kubeletstatsreceiver",
"resource.attributes.k8s@pod@uid": "7a65a103-6cea-46d4-8363-c1c154a09e49",
"resource.attributes.k8s@namespace@name": "default",
"resource.attributes.k8s@node@name": "minikube",
"resource.attributes.k8s@deployment@name": "custommvc-open",
"resource.attributes.k8s@pod@start_time": "2024-08-29T05:29:35Z",
"resource.attributes.k8s@pod@name": "custommvc-open-85fd6ddd9-hp944",
"instrumentationScope.version": "0.106.1"
},
"time": "2024-08-29T08:40:30.643429481Z",
"serviceName": null,
"value": 0.540842557,
"schemaUrl": ""
},
"_id": "BaRLnZEBrIfLV-3HG99U",
"_score": 9.211788
}
],
"total": {
"value": 1,
"relation": "eq"
},
"max_score": 9.211788
},
"took": 12,
"timed_out": false
}
i want to get notification in attributes in resource.attributes.k8s@deployment@name and
resource.attributes.k8s@pod@name
i am try like this below but this not working pod name and deployment there are show empty in mail
{{#ctx.results.0.hits.hits}}
- name: {{_source.name}}
- cpu_usage: {{_source.value}}
- pod: {{_source.attributes.resource.attributes.k8s@pod@name}}
- deployment: {{_source.attributes.resource.attributes.k8s@deployment@name}}
{{/ctx.results.0.hits.hits}}