Skip to content

Commit 025b19d

Browse files
Change label aggregation in Moanrch to MAX (#845) (#851)
Use max for timestamp to get the latest; Use max for duration distribution to get the longest; Use sum for count to get the total of one time serie.
1 parent 482525e commit 025b19d

File tree

2 files changed

+16
-16
lines changed

2 files changed

+16
-16
lines changed

pkg/metrics/otel.go

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -184,98 +184,98 @@ processors:
184184
- action: aggregate_labels
185185
# label_set is the allowlist of labels to keep after aggregation
186186
label_set: [status, operation]
187-
aggregation_type: sum
187+
aggregation_type: max
188188
- include: declared_resources
189189
action: update
190190
new_name: current_declared_resources
191191
operations:
192192
- action: aggregate_labels
193193
label_set: []
194-
aggregation_type: sum
194+
aggregation_type: max
195195
- include: kcc_resource_count
196196
action: update
197197
operations:
198198
- action: aggregate_labels
199199
label_set: [resourcegroup]
200-
aggregation_type: sum
200+
aggregation_type: max
201201
- include: reconciler_errors
202202
action: update
203203
new_name: last_reconciler_errors
204204
operations:
205205
- action: aggregate_labels
206206
label_set: [component, errorclass]
207-
aggregation_type: sum
207+
aggregation_type: max
208208
- include: reconcile_duration_seconds
209209
action: update
210210
operations:
211211
- action: aggregate_labels
212212
label_set: [status]
213-
aggregation_type: sum
213+
aggregation_type: max
214214
- include: rg_reconcile_duration_seconds
215215
action: update
216216
operations:
217217
- action: aggregate_labels
218218
label_set: [stallreason]
219-
aggregation_type: sum
219+
aggregation_type: max
220220
- include: last_sync_timestamp
221221
action: update
222222
operations:
223223
- action: aggregate_labels
224224
label_set: [status]
225-
aggregation_type: sum
225+
aggregation_type: max
226226
- include: parser_duration_seconds
227227
action: update
228228
operations:
229229
- action: aggregate_labels
230230
label_set: [status, source, trigger]
231-
aggregation_type: sum
231+
aggregation_type: max
232232
- include: pipeline_error_observed
233233
action: update
234234
new_name: last_pipeline_error_observed
235235
operations:
236236
- action: aggregate_labels
237237
label_set: [name, component, reconciler]
238-
aggregation_type: sum
238+
aggregation_type: max
239239
- include: apply_operations_total
240240
action: update
241241
new_name: apply_operations_count
242242
operations:
243243
- action: aggregate_labels
244244
label_set: [controller, operation, status]
245-
aggregation_type: sum
245+
aggregation_type: max
246246
- include: apply_duration_seconds
247247
action: update
248248
operations:
249249
- action: aggregate_labels
250250
label_set: [status]
251-
aggregation_type: sum
251+
aggregation_type: max
252252
- include: resource_fights_total
253253
action: update
254254
new_name: resource_fights_count
255255
operations:
256256
- action: aggregate_labels
257257
label_set: [name, component, reconciler]
258-
aggregation_type: sum
258+
aggregation_type: max
259259
- include: resource_conflicts_total
260260
action: update
261261
new_name: resource_conflicts_count
262262
operations:
263263
- action: aggregate_labels
264264
label_set: []
265-
aggregation_type: sum
265+
aggregation_type: max
266266
- include: internal_errors_total
267267
action: update
268268
new_name: internal_errors_count
269269
operations:
270270
- action: aggregate_labels
271271
label_set: []
272-
aggregation_type: sum
272+
aggregation_type: max
273273
- include: remediate_duration_seconds
274274
action: update
275275
operations:
276276
- action: aggregate_labels
277277
label_set: [status]
278-
aggregation_type: sum
278+
aggregation_type: max
279279
extensions:
280280
health_check:
281281
service:

pkg/reconcilermanager/controllers/otel_controller_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ const (
4646
// otel-collector ConfigMap.
4747
// See `CollectorConfigGooglecloud` in `pkg/metrics/otel.go`
4848
// Used by TestOtelReconcilerGooglecloud.
49-
depAnnotationGooglecloud = "c3b8f7c8647aa20b219d141081ed7f6f"
49+
depAnnotationGooglecloud = "de02e5c1da70cff63a1cfb565141899a"
5050
// depAnnotationGooglecloud is the expected hash of the custom
5151
// otel-collector ConfigMap test artifact.
5252
// Used by TestOtelReconcilerCustom.

0 commit comments

Comments
 (0)