Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion helm/bundles/cortex-cinder/templates/alerts.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -196,7 +196,7 @@ spec:
time the service will have a less recent view of the datacenter.

- alert: CortexCinderSyncObjectsDroppedToZero
expr: cortex_sync_objects{service="cortex-cinder-metrics"} == 0 and (cortex_sync_objects{service="cortex-cinder-metrics"} offset 1h > 0)
expr: cortex_sync_objects{service="cortex-cinder-metrics"} == 0 and (max_over_time(cortex_sync_objects{service="cortex-cinder-metrics"}[1w]) > 0)
for: 60m
labels:
{{- if .Values.alerts.persesDashboardBaseURL }}
Expand Down
2 changes: 1 addition & 1 deletion helm/bundles/cortex-manila/templates/alerts.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -200,7 +200,7 @@ spec:
time the service will have a less recent view of the datacenter.

- alert: CortexManilaSyncObjectsDroppedToZero
expr: cortex_sync_objects{service="cortex-manila-metrics"} == 0 and (cortex_sync_objects{service="cortex-manila-metrics"} offset 1h > 0)
expr: cortex_sync_objects{service="cortex-manila-metrics"} == 0 and (max_over_time(cortex_sync_objects{service="cortex-manila-metrics"}[1w]) > 0)
for: 60m
labels:
{{- if .Values.alerts.persesDashboardBaseURL }}
Expand Down
46 changes: 44 additions & 2 deletions helm/bundles/cortex-nova/templates/alerts.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -219,7 +219,7 @@ spec:
time the service will have a less recent view of the datacenter.

- alert: CortexNovaSyncObjectsDroppedToZero
expr: cortex_sync_objects{service="cortex-nova-metrics", datasource!="openstack_migrations"} == 0 and (cortex_sync_objects{service="cortex-nova-metrics", datasource!="openstack_migrations"} offset 1h > 0)
expr: cortex_sync_objects{service="cortex-nova-metrics", datasource!="openstack_migrations"} == 0 and (max_over_time(cortex_sync_objects{service="cortex-nova-metrics", datasource!="openstack_migrations"}[1w]) > 0)
for: 60m
labels:
{{- if .Values.alerts.persesDashboardBaseURL }}
Expand Down Expand Up @@ -722,7 +722,7 @@ spec:
- alert: CortexNovaCommittedResourceCapacityDroppedToZero
expr: |
(cortex_committed_resource_reported_capacity{service="cortex-nova-metrics"} == 0)
and on(resource, az, unit_size) (cortex_committed_resource_reported_capacity{service="cortex-nova-metrics"} offset 30m > 0)
and on(resource, az, unit_size) (max_over_time(cortex_committed_resource_reported_capacity{service="cortex-nova-metrics"}[1w]) > 0)
for: 5m
labels:
{{- if .Values.alerts.persesDashboardBaseURL }}
Expand All @@ -741,6 +741,48 @@ spec:
This may mean hypervisors in that AZ are fully utilized for the corresponding
flavor group and no further committed resources can be placed there.

- alert: CortexNovaFlavorBecameUnplaceable
expr: |
cortex_committed_resource_capacity_vm_slots_empty_datacenter{service="cortex-nova-metrics"} == 0
and on(flavor_group, az, flavor_name)
(max_over_time(cortex_committed_resource_capacity_vm_slots_empty_datacenter{service="cortex-nova-metrics"}[1w]) > 0)
for: 5m
labels:
{{- if .Values.alerts.persesDashboardBaseURL }}
persesDashboard: "{{ .Values.alerts.persesDashboardBaseURL }}/cortex_status?var-service=cortex-nova-metrics"
{{- end }}
context: committed-resource-capacity
service: cortex
severity: warning
support_group: workload-management
playbook: docs/support/playbook/cortex/alerts/committed-resource-capacity
annotations:
summary: "Nova flavor {{ "{{" }} $labels.flavor_name {{ "}}" }} in group {{ "{{" }} $labels.flavor_group {{ "}}" }} AZ {{ "{{" }} $labels.az {{ "}}" }} became unplaceable"
description: >
The flavor had placeable slots within the last week but now reports 0 slots on an empty datacenter.
This indicates a broken flavor configuration.

- alert: CortexNovaFlavorGroupSmallestFlavorBroken
expr: |
cortex_committed_resource_capacity_vm_slots_empty_datacenter{is_smallest="true", service="cortex-nova-metrics"} == 0
and on(flavor_group, az)
(max_over_time(cortex_committed_resource_capacity_vm_slots_empty_datacenter{is_smallest="true", service="cortex-nova-metrics"}[1w]) > 0)
for: 5m
labels:
{{- if .Values.alerts.persesDashboardBaseURL }}
persesDashboard: "{{ .Values.alerts.persesDashboardBaseURL }}/cortex_status?var-service=cortex-nova-metrics"
{{- end }}
context: committed-resource-capacity
service: cortex
severity: warning
support_group: workload-management
playbook: docs/support/playbook/cortex/alerts/committed-resource-capacity
annotations:
summary: "Nova flavor group {{ "{{" }} $labels.flavor_group {{ "}}" }} in AZ {{ "{{" }} $labels.az {{ "}}" }} smallest flavor became unplaceable"
description: >
The smallest flavor of this group had placeable slots within the last week but now reports 0 slots on an empty datacenter.
This indicates broken capacity for the entire flavor group.

- alert: CortexNovaCommittedResourceCapacityNotReady
expr: |
cortex_committed_resource_capacity_ready{service="cortex-nova-metrics"} == 0
Expand Down
8 changes: 7 additions & 1 deletion internal/scheduling/reservations/capacity/metrics.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ import (

var (
capacityLabels = []string{"flavor_group", "az"}
capacityFlavorLabels = []string{"flavor_group", "az", "flavor_name"}
capacityFlavorLabels = []string{"flavor_group", "az", "flavor_name", "is_smallest"}
)

// Monitor provides Prometheus metrics for FlavorGroupCapacity CRDs.
Expand Down Expand Up @@ -175,6 +175,7 @@ func (m *Monitor) Collect(ch chan<- prometheus.Metric) {
"flavor_group": crd.Spec.FlavorGroup,
"az": crd.Spec.AvailabilityZone,
"flavor_name": crd.Status.SmallestFlavorName,
"is_smallest": "true",
}
m.committedCapacityGiB.With(groupAZLabels).Set(float64(crd.Status.CommittedCapacityBytes) / (1024 * 1024 * 1024))
m.committedReservations.With(groupAZLabels).Set(float64(crd.Status.CommittedCapacity))
Expand Down Expand Up @@ -207,10 +208,15 @@ func (m *Monitor) Collect(ch chan<- prometheus.Metric) {
m.readyGauge.With(groupAZLabels).Set(readyVal)

for _, f := range crd.Status.Flavors {
isSmallest := "false"
if f.FlavorName == crd.Status.SmallestFlavorName {
isSmallest = "true"
}
flavorLabels := prometheus.Labels{
"flavor_group": crd.Spec.FlavorGroup,
"az": crd.Spec.AvailabilityZone,
"flavor_name": f.FlavorName,
"is_smallest": isSmallest,
}
m.vmSlotsEmpty.With(flavorLabels).Set(float64(f.TotalCapacityVMSlots))
m.vmSlotsPlaceable.With(flavorLabels).Set(float64(f.PlaceableVMs))
Expand Down