Skip to content

Commit

Permalink
Change label aggregation in Moanrch to MAX (#845) (#851)
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
tiffanny29631 authored Aug 31, 2023
1 parent 482525e commit 025b19d
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 16 deletions.
30 changes: 15 additions & 15 deletions pkg/metrics/otel.go
Original file line number Diff line number Diff line change
Expand Up @@ -184,98 +184,98 @@ processors:
- action: aggregate_labels
# label_set is the allowlist of labels to keep after aggregation
label_set: [status, operation]
aggregation_type: sum
aggregation_type: max
- include: declared_resources
action: update
new_name: current_declared_resources
operations:
- action: aggregate_labels
label_set: []
aggregation_type: sum
aggregation_type: max
- include: kcc_resource_count
action: update
operations:
- action: aggregate_labels
label_set: [resourcegroup]
aggregation_type: sum
aggregation_type: max
- include: reconciler_errors
action: update
new_name: last_reconciler_errors
operations:
- action: aggregate_labels
label_set: [component, errorclass]
aggregation_type: sum
aggregation_type: max
- include: reconcile_duration_seconds
action: update
operations:
- action: aggregate_labels
label_set: [status]
aggregation_type: sum
aggregation_type: max
- include: rg_reconcile_duration_seconds
action: update
operations:
- action: aggregate_labels
label_set: [stallreason]
aggregation_type: sum
aggregation_type: max
- include: last_sync_timestamp
action: update
operations:
- action: aggregate_labels
label_set: [status]
aggregation_type: sum
aggregation_type: max
- include: parser_duration_seconds
action: update
operations:
- action: aggregate_labels
label_set: [status, source, trigger]
aggregation_type: sum
aggregation_type: max
- include: pipeline_error_observed
action: update
new_name: last_pipeline_error_observed
operations:
- action: aggregate_labels
label_set: [name, component, reconciler]
aggregation_type: sum
aggregation_type: max
- include: apply_operations_total
action: update
new_name: apply_operations_count
operations:
- action: aggregate_labels
label_set: [controller, operation, status]
aggregation_type: sum
aggregation_type: max
- include: apply_duration_seconds
action: update
operations:
- action: aggregate_labels
label_set: [status]
aggregation_type: sum
aggregation_type: max
- include: resource_fights_total
action: update
new_name: resource_fights_count
operations:
- action: aggregate_labels
label_set: [name, component, reconciler]
aggregation_type: sum
aggregation_type: max
- include: resource_conflicts_total
action: update
new_name: resource_conflicts_count
operations:
- action: aggregate_labels
label_set: []
aggregation_type: sum
aggregation_type: max
- include: internal_errors_total
action: update
new_name: internal_errors_count
operations:
- action: aggregate_labels
label_set: []
aggregation_type: sum
aggregation_type: max
- include: remediate_duration_seconds
action: update
operations:
- action: aggregate_labels
label_set: [status]
aggregation_type: sum
aggregation_type: max
extensions:
health_check:
service:
Expand Down
2 changes: 1 addition & 1 deletion pkg/reconcilermanager/controllers/otel_controller_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ const (
// otel-collector ConfigMap.
// See `CollectorConfigGooglecloud` in `pkg/metrics/otel.go`
// Used by TestOtelReconcilerGooglecloud.
depAnnotationGooglecloud = "c3b8f7c8647aa20b219d141081ed7f6f"
depAnnotationGooglecloud = "de02e5c1da70cff63a1cfb565141899a"
// depAnnotationGooglecloud is the expected hash of the custom
// otel-collector ConfigMap test artifact.
// Used by TestOtelReconcilerCustom.
Expand Down

0 comments on commit 025b19d

Please sign in to comment.