Skip to content

Commit

Permalink
Merge pull request #11 from ivx/add-ebs-support
Browse files Browse the repository at this point in the history
Add ebs support
  • Loading branch information
tsupertramp authored Aug 7, 2018
2 parents 1662eac + e6d0efc commit d20c529
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 1 deletion.
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@ Currently in quick iteration mode which will probably break things in next versi
- elb - elastic load balancers
- efs - elastic file system
- s3 - object storage
- efs - elastic file system
- ebs - elastic block storage

## Image
* `quay.io/invisionag/yet-another-cloudwatch-exporter:x.x.x` e.g. 10.1.3
Expand Down
4 changes: 4 additions & 0 deletions src/aws_cloudwatch.go
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,8 @@ func getNamespace(service *string) *string {
ns = "AWS/S3"
case "efs":
ns = "AWS/EFS"
case "ebs":
ns = "AWS/EBS"
default:
log.Fatal("Not implemented namespace for cloudwatch metric:" + *service)
}
Expand Down Expand Up @@ -117,6 +119,8 @@ func getDimensions(service *string, resourceArn *string) (dimensions []*cloudwat
dimensions = append(dimensions, buildDimension("StorageType", "AllStorageTypes"))
case "efs":
dimensions = buildBaseDimension(arnParsed.Resource, "FileSystemId", "file-system/")
case "ebs":
dimensions = buildBaseDimension(arnParsed.Resource, "VolumeId", "volume/")
default:
log.Fatal("Not implemented cloudwatch metric:" + *service)
}
Expand Down
3 changes: 3 additions & 0 deletions src/aws_tags.go
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,9 @@ func (iface tagsInterface) get(discovery discovery) (resources []*tagsData, err
case "efs":
hotfix := aws.String("elasticfilesystem:file-system")
filter = append(filter, hotfix)
case "ebs":
hotfix := aws.String("ec2:volume")
filter = append(filter, hotfix)
default:
log.Fatal("Not implemented resources:" + discovery.Type)
}
Expand Down
2 changes: 1 addition & 1 deletion src/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ var (
addr = flag.String("listen-address", ":5000", "The address to listen on.")
configFile = flag.String("config.file", "config.yml", "Path to configuration file.")
version = flag.Bool("v", false, "prints current yace version")
supportedServices = []string{"rds", "ec2", "elb", "es", "ec", "s3", "efs"}
supportedServices = []string{"rds", "ec2", "elb", "es", "ec", "s3", "efs", "ebs"}
config = conf{}
)

Expand Down

0 comments on commit d20c529

Please sign in to comment.