Skip to content
This repository was archived by the owner on Mar 8, 2023. It is now read-only.

Get all metrics without selecting by dimension #3

@jangrewe

Description

@jangrewe

I thought i'd open a separate issue to not hijack my previous ticket, sooo...

I haven't actually double-checked, but i think with the "official" cloudwatch-exporter it's possible to omit aws_dimension_select and just get all metrics for a specific dimension.
The config for this would look like the following:

---
tasks:
- name: vpn
  metrics:
  - aws_namespace: "AWS/VPN"
    aws_metric_name: TunnelState
    aws_dimensions: [VpnId]
    aws_statistics: [Average]

Unfortunately this crashes the exporter:

CloudWatch exporter started...
InvalidParameter: 1 validation error(s) found.
- minimum field size of 1, GetMetricStatisticsInput.Dimensions[0].Value.

panic: inconsistent label cardinality

goroutine 349 [running]:
github.com/Technofy/cloudwatch_exporter/vendor/github.com/prometheus/client_golang/prometheus.MustNewConstMetric(0xc420139490, 0x2, 0x3fe0000000000000, 0xc420316920, 0x1, 0x2, 0x0, 0x1)
	/home/jan/go/src/github.com/Technofy/cloudwatch_exporter/vendor/github.com/prometheus/client_golang/prometheus/value.go:172 +0xb0
main.scrape(0xc420326c80, 0xc4205689c0)
	/home/jan/go/src/github.com/Technofy/cloudwatch_exporter/aws.go:100 +0x1047
main.(*cwCollector).Collect(0xc420326c80, 0xc4205689c0)
	/home/jan/go/src/github.com/Technofy/cloudwatch_exporter/collector.go:111 +0x59
github.com/Technofy/cloudwatch_exporter/vendor/github.com/prometheus/client_golang/prometheus.(*Registry).Gather.func2(0xc420313840, 0xc4205689c0, 0x9dc1e0, 0xc420326c80)
	/home/jan/go/src/github.com/Technofy/cloudwatch_exporter/vendor/github.com/prometheus/client_golang/prometheus/registry.go:433 +0x61
created by github.com/Technofy/cloudwatch_exporter/vendor/github.com/prometheus/client_golang/prometheus.(*Registry).Gather
	/home/jan/go/src/github.com/Technofy/cloudwatch_exporter/vendor/github.com/prometheus/client_golang/prometheus/registry.go:434 +0x2ec

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions