Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use netapp harvester metrics #631

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
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
9 changes: 4 additions & 5 deletions internal/liquids/manila/liquid.go
Original file line number Diff line number Diff line change
Expand Up @@ -215,48 +215,47 @@
snapshotCapacityQuery = `sum by (availability_zone_name, project_id, share_type_id) (max by (availability_zone_name, id, project_id, share_id, share_type_id) (last_over_time(openstack_manila_snapshot_size_gauge[15m])))`

// queries for netapp-exporter metrics
sharePhysicalUsageQuery = `sum by (availability_zone, project_id, share_type) (max by (availability_zone, project_id, share_id, share_type) (last_over_time(netapp_volume_used_bytes {project_id!="",share_type!="",volume_type!="dp",volume_state="online"}[15m])))`
snapshotPhysicalUsageQuery = `sum by (availability_zone, project_id, share_type) (max by (availability_zone, project_id, share_id, share_type) (last_over_time(netapp_volume_snapshot_used_bytes{project_id!="",share_type!="",volume_type!="dp",volume_state="online"}[15m])))`
snapmirrorUsageQuery = `sum by (availability_zone, project_id, share_type) (max by (availability_zone, project_id, share_id, share_type) (last_over_time(netapp_volume_total_bytes {project_id!="",share_type!="",volume_type!="dp",volume_state="online",snapshot_policy="EC2_Backups"}[15m])))`
snapmirrorPhysicalUsageQuery = `sum by (availability_zone, project_id, share_type) (max by (availability_zone, project_id, share_id, share_type) (last_over_time(netapp_volume_used_bytes {project_id!="",share_type!="",volume_type!="dp",volume_state="online",snapshot_policy="EC2_Backups"}[15m])))`
)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This final bracket should stay, belongs to const ( on line 208

sharePhysicalUsageQuery = `sum by (project_id, availability_zone, share_type) (max by (availability_zone, project_id, share_id, share_type) (last_over_time(netapp_volume_size_used{app="netapp-harvest-exporter-manila"}[15m]) * on(app, volume) group_left() max by (app, volume) (netapp_volume_labels{project_id!="",share_type!="",volume_type!="dp",state="online"})))`
snapshotPhysicalUsageQuery = `sum by (project_id, availability_zone, share_type) (max by (availability_zone, project_id, share_id, share_type) (last_over_time(netapp_volume_snapshots_size_used{app="netapp-harvest-exporter-manila"}[15m]) * on(app, volume) group_left() max by (app, volume) (netapp_volume_labels{project_id!="",share_type!="",volume_type!="dp",state="online"})))`
snapmirrorUsageQuery = `sum by (project_id, availability_zone, share_type) (max by (availability_zone, project_id, share_id, share_type) (last_over_time(netapp_volume_size_total{app="netapp-harvest-exporter-manila"}[15m]) * on(app, volume) group_left() max by (app, volume) (netapp_volume_labels{project_id!="",share_type!="",volume_type!="dp",state="online",snapshot_policy="EC2_Backups"})))`
snapmirrorPhysicalUsageQuery = `sum by (project_id, availability_zone, share_type) (max by (availability_zone, project_id, share_id, share_type) (last_over_time(netapp_volume_size_used{app="netapp-harvest-exporter-manila"}[15m]) * on(app, volume) group_left() max by (app, volume) (netapp_volume_labels{project_id!="",share_type!="",volume_type!="dp",state="online",snapshot_policy="EC2_Backups"})))`

type azMetricsKey struct {

Check failure on line 223 in internal/liquids/manila/liquid.go

View workflow job for this annotation

GitHub Actions / Checks

syntax error: unexpected type, expected name

Check failure on line 223 in internal/liquids/manila/liquid.go

View workflow job for this annotation

GitHub Actions / Checks

expected 'IDENT', found 'type' (typecheck)

Check failure on line 223 in internal/liquids/manila/liquid.go

View workflow job for this annotation

GitHub Actions / CodeQL

syntax error: unexpected type, expected name

Check failure on line 223 in internal/liquids/manila/liquid.go

View workflow job for this annotation

GitHub Actions / Build

syntax error: unexpected type, expected name
AvailabilityZone liquid.AvailabilityZone
ProjectUUID string
ShareTypeID string
}

Check failure on line 227 in internal/liquids/manila/liquid.go

View workflow job for this annotation

GitHub Actions / Checks

syntax error: unexpected } after top level declaration (typecheck)

Check failure on line 227 in internal/liquids/manila/liquid.go

View workflow job for this annotation

GitHub Actions / CodeQL

syntax error: unexpected } after top level declaration

Check failure on line 227 in internal/liquids/manila/liquid.go

View workflow job for this annotation

GitHub Actions / Build

syntax error: unexpected } after top level declaration

func azMetricsKeyer(sample *model.Sample) azMetricsKey {
return azMetricsKey{

Check failure on line 230 in internal/liquids/manila/liquid.go

View workflow job for this annotation

GitHub Actions / Checks

expected 'IDENT', found 'return' (typecheck)
AvailabilityZone: liquid.AvailabilityZone(sample.Metric["availability_zone_name"]),
ProjectUUID: string(sample.Metric["project_id"]),
ShareTypeID: string(sample.Metric["share_type_id"]),
}
}

type netappMetricsKey struct {

Check failure on line 237 in internal/liquids/manila/liquid.go

View workflow job for this annotation

GitHub Actions / Checks

expected 'IDENT', found 'type' (typecheck)
AvailabilityZone liquid.AvailabilityZone
ProjectUUID string
ShareTypeName RealShareType
}

func netappMetricsKeyer(sample *model.Sample) netappMetricsKey {
return netappMetricsKey{

Check failure on line 244 in internal/liquids/manila/liquid.go

View workflow job for this annotation

GitHub Actions / Checks

expected 'IDENT', found 'return' (typecheck)
AvailabilityZone: liquid.AvailabilityZone(sample.Metric["availability_zone"]),
ProjectUUID: string(sample.Metric["project_id"]),
ShareTypeName: RealShareType(sample.Metric["share_type"]),
}
}

type azMetrics struct {

Check failure on line 251 in internal/liquids/manila/liquid.go

View workflow job for this annotation

GitHub Actions / Checks

expected 'IDENT', found 'type' (typecheck)
ShareCount uint64
ShareCapacityGiB uint64
SnapshotCount uint64
SnapshotCapacityGiB uint64
}

type netappMetrics struct {

Check failure on line 258 in internal/liquids/manila/liquid.go

View workflow job for this annotation

GitHub Actions / Checks

expected 'IDENT', found 'type' (typecheck)
// all in GiB
SharePhysicalUsage uint64
SnapshotPhysicalUsage uint64
Expand All @@ -264,8 +263,8 @@
SnapmirrorPhysicalUsage uint64
}

var (

Check failure on line 266 in internal/liquids/manila/liquid.go

View workflow job for this annotation

GitHub Actions / Checks

expected 'IDENT', found 'var' (typecheck)
azMetricsQueries = []promquery.BulkQuery[azMetricsKey, azMetrics]{

Check failure on line 267 in internal/liquids/manila/liquid.go

View workflow job for this annotation

GitHub Actions / Checks

expected ')', found '=' (typecheck)
{
Query: shareCountQuery,
Description: "shares usage data",
Expand Down
Loading