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 exporters/nova_trait.go
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ func (e *NovaTraitUsageExporter) collectMetrics(ch chan<- prometheus.Metric) {
var projectID string
var totalVcpus float64
var totalInstances float64
if err := rows.Scan(&projectID, &totalVcpus, &totalInstances); err != nil {
if err := rows.Scan(&projectID, &totalInstances, &totalVcpus); err != nil {
log.Println("Error scanning Nova row:", err)
continue
}
Expand Down
4 changes: 2 additions & 2 deletions exporters/nova_trait_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,11 +28,11 @@ func TestNovaTraitUsageExporter(t *testing.T) {
expectedMetrics := `
# HELP openstack_project_instances_trait__custom_trait Total number of instances per OpenStack project with image trait CUSTOM_TRAIT
# TYPE openstack_project_instances_trait__custom_trait gauge
openstack_project_instances_trait__custom_trait{project_id="6ee08ba2-2ca1-4c91-b139-4bf0dbaa4096"} 5
openstack_project_instances_trait__custom_trait{project_id="6ee08ba2-2ca1-4c91-b139-4bf0dbaa4096"} 4
openstack_project_instances_trait__custom_trait{project_id="c352b0ed-30ca-4634-9c2d-1947efc29096"} 0
# HELP openstack_project_vcpus_trait__custom_trait Total number of vcpus per OpenStack project for instances with image trait CUSTOM_TRAIT
# TYPE openstack_project_vcpus_trait__custom_trait gauge
openstack_project_vcpus_trait__custom_trait{project_id="6ee08ba2-2ca1-4c91-b139-4bf0dbaa4096"} 4
openstack_project_vcpus_trait__custom_trait{project_id="6ee08ba2-2ca1-4c91-b139-4bf0dbaa4096"} 5
openstack_project_vcpus_trait__custom_trait{project_id="c352b0ed-30ca-4634-9c2d-1947efc29096"} 0

`
Expand Down
Loading