From 58502da310756fa055c5a222de16858c73452ae6 Mon Sep 17 00:00:00 2001 From: Ana Ivanov Date: Mon, 23 Sep 2024 16:39:44 +0200 Subject: [PATCH] fix template variables --- csp-mixin/signals/gcpce.libsonnet | 4 ++-- csp-mixin/signals/gcpceOverview.libsonnet | 22 ++++++++++++---------- 2 files changed, 14 insertions(+), 12 deletions(-) diff --git a/csp-mixin/signals/gcpce.libsonnet b/csp-mixin/signals/gcpce.libsonnet index 59698707d..b24ee5c46 100644 --- a/csp-mixin/signals/gcpce.libsonnet +++ b/csp-mixin/signals/gcpce.libsonnet @@ -3,8 +3,8 @@ function(this) { local s = self, filteringSelector: 'job!=""', - groupLabels: ['instance_name'], - instanceLabels: [], + groupLabels: ['job', 'project_id'], + instanceLabels: ['instance_name'], aggLevel: 'instance', discoveryMetric: { stackdriver: 'stackdriver_gce_instance_compute_googleapis_com_instance_cpu_utilization', diff --git a/csp-mixin/signals/gcpceOverview.libsonnet b/csp-mixin/signals/gcpceOverview.libsonnet index c6dc9d42e..3d848ecc8 100644 --- a/csp-mixin/signals/gcpceOverview.libsonnet +++ b/csp-mixin/signals/gcpceOverview.libsonnet @@ -3,7 +3,7 @@ function(this) { local s = self, filteringSelector: 'job!=""', - groupLabels: this.groupLabels, + groupLabels: ['job', 'project_id'], instanceLabels: [], aggLevel: 'instance', discoveryMetric: { @@ -113,8 +113,8 @@ function(this) }, memoryUsed: { - name: 'Memory Utilization', - description: 'Memory Utilization', + name: 'Memory Utilization2', + description: 'Memory used', type: 'raw', unit: 'bytes', sources: { @@ -128,27 +128,29 @@ function(this) packetsSent: { name: 'Total packets count sent/received', description: 'Count of packets sent/received over the network. Sampled every 60 seconds', - type: 'gauge', + type: 'counter', unit: 'short', + aggFunction: 'sum', sources: { stackdriver: { expr: 'stackdriver_gce_instance_compute_googleapis_com_instance_network_sent_packets_count{%(queriesSelector)s}', legendCustomTemplate: 'Sent', - exprWrappers: [['sum(', ')']], + // exprWrappers: [['sum(', ')']], }, }, }, packetsReceived: { - name: 'Total packets count sent/received', + name: 'Total packets count received', description: 'Count of packets sent/received over the network. Sampled every 60 seconds', - type: 'gauge', + type: 'counter', unit: 'short', + aggFunction: 'sum', sources: { stackdriver: { expr: 'stackdriver_gce_instance_compute_googleapis_com_instance_network_received_packets_count{%(queriesSelector)s}', legendCustomTemplate: 'Received', - exprWrappers: [['sum(', ')']], + // exprWrappers: [['sum(', ')']], }, }, }, @@ -168,7 +170,7 @@ function(this) }, networkReceived: { - name: 'Network throughput Sent/Received', + name: 'Network throughput Received', description: 'Count of bytes sent/received over the network. Sampled every 60 seconds', type: 'gauge', unit: 'bytes', @@ -196,7 +198,7 @@ function(this) }, diskBytesWrite: { - name: 'Total Bytes count read/write', + name: 'Total Bytes count write', description: 'Total count of bytes read/write from disk. Sampled every 60 seconds', type: 'gauge', unit: 'bytes',