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
put metric action #400
Comments
Are you envisioning something like this: policies:
- name: track-bucket-size
resource: s3
comment: |
Put the sum of the size of all keys in an S3 bucket into CloudWatch Metrics
filter:
- Name: metric-tracked-bucket
actions:
- type: put-metric
key: Contents[].Size
metric_name: Bucket Size
op: sum Or something like this: - name: track-attached-ebs
resource: ec2
comment: |
Put the count of the number of EBS attached disks to an instance
filter:
- Name: tracked-ec2-instance
actions:
- type: put-metric
key: Reservations[].Instances[].BlockDeviceMappings[].DeviceName
metric_name: Attached Disks
op: count The action can figure out based on the resource, operation and the key handed to it what to put into CloudWatch. Operations could be:
|
That looks good to me, thanks |
Count, Sum and Average are definitely doable as Operations. Duration is really a question of the units for the value being recorded. I think the right thing to do here is to add one more key to the action calls 'units' and accept values of durations
bytes
bits
rates
other
` Cloud watch can also record statistical values at a point in time. In that case, rather than a value, it accepts statistical metadata about a sample set ( min, max, sum, and sample count ). I've not used that yet, but we could support that style as an additional op value called 'stats'. |
* inital draft of put metric action * Build the schema for PutMetric and register the PutMetric action as 'put-metric'a * Adding PutMetricAction operations for count, distinct_count, average, and sum. * Adding all of the putmetric units supprted by AWS. * This is the meat of the aws cloudwatch PutMetricData action, put-metric. * Moved the imports, switched some print-logging to real logging. * PutMetrics tests and placebo tests data. * Updates per Kapil ( logging instead of prints, using the project's safe loader, metric dimensions passing through. ) * Updated placebo test data for latest ec2 put-metrics test with dimensions. * PutMetric schema adjustment and added a test in response to a travis ci failure I ran into after the previous changes.
for given expression evaluate and publish per resource metric for given attribute, or the collection's aggregate attributes (size, etc).
The text was updated successfully, but these errors were encountered: