edasque / cloudwatch2graphite Goto Github PK
View Code? Open in Web Editor NEWBring Amazon AWS Cloudwatch metrics into Graphite
License: Apache License 2.0
Bring Amazon AWS Cloudwatch metrics into Graphite
License: Apache License 2.0
All the results of running the cw2graphite.js file spits empty results even though I know there is data available from cloudwatch. Basically, here is the output of running "node cw2graphite.js"
WARNING ! no data point available for metric........
Here is the snippet of metrics.json file
{
"Namespace": "AWS/EC2",
"MetricName": "CPUUtilization",
"Statistics.member.1":"Average",
"Unit": "Percent",
"Dimensions.member.1.Name":"ImageId",
"Dimensions.member.1.Value":"ami-xxxxxx",
"Dimensions.member.2.Name":"InstanceId",
"Dimensions.member.2.Value":"i-xxxxxx"
}
Not sure if anyone else if facing this issue.
I have the following in my MetricsConfig:
"metricsConfig": {
"metrics": [
{
"Namespace": "AWS/ELB",
"MetricName": "Latency",
"Period": 60,
"Statistics": [
"Average"
],
"Dimensions": [
{
"Name": "LoadBalancerName",
"Value":"WebLB"
}
]
},
{
"Namespace": "AWS/ELB",
"MetricName": "RequestCount",
"Period": 60,
"Statistics": [
"Sum"
],
"Dimensions": [
{
"Name": "LoadBalancerName",
"Value":"WebLB"
}
]
}
],
"carbonNameSpacePrefix": "cloudwatch"
But I noticed for the Latency metric, I don't get anything back:
root@cloudwatchAPI:/opt/cloudwatch2graphite# nodejs cw2graphite.js
AWS.ELB.WebLB.Latency undefined 1439574600
AWS.ELB.WebLB.Latency undefined 1439574660
AWS.ELB.WebLB.RequestCount 1994 1439574600
AWS.ELB.WebLB.RequestCount 2014 1439574660
Looking into the code:
for (var point in sorted_data) {
console.log("%s %s %s", getMetricStatistics_param.Namespace.replace("/", ".") + dimension_prefix + "." + getMetricStatistics_param.MetricName, sorted_data[point].Sum, parseInt(new Date(sorted_data[point].Timestamp).getTime() / 1000.0));
}
Looks like it assumes you only want the Sum metric.
Added:
console.log("Data: %j", sorted_data[point]);
And I get the following:
root@cloudwatchAPI:/opt/cloudwatch2graphite# nodejs cw2graphite.js
AWS.ELB.WebLB.RequestCount 2299 1441036860
Data: {"Timestamp":"2015-08-31T16:01:00.000Z","Sum":2299,"Unit":"Count"}
AWS.ELB.WebLB.RequestCount 2553 1441036920
Data: {"Timestamp":"2015-08-31T16:02:00.000Z","Sum":2553,"Unit":"Count"}
AWS.ELB.WebLB.RequestCount 2515 1441036980
AWS.ELB.WebLB.Latency undefined 1441036860
Data: {"Timestamp":"2015-08-31T16:01:00.000Z","Average":0.46592221139772605,"Unit":"Seconds"}
AWS.ELB.WebLB.Latency undefined 1441036920
Data: {"Timestamp":"2015-08-31T16:02:00.000Z","Average":0.4260947892958166,"Unit":"Seconds"}
AWS.ELB.WebLB.Latency undefined 1441036980
root@cloudwatchAPI:/opt/cloudwatch2graphite#
Hi,
I am trying to use the same setup for AWS China. Can you help me out with the correct region name for AWS China.
Thanks
Manik Dham
Hello,
I am curious to know if you were able to get cloudwatch S3 metrics from cloudwatch.
I cannot get any data from S3 (no problem with sqs, rds, ...)
Here is an example
{
"awsCredentials": {
"accessKeyId": "KEY",
"secretAccessKey": "SECRET",
"region": "us-east-1"
},
"metricsConfig": {
"metrics": [
{
"Namespace": "AWS/S3",
"MetricName": "BucketSizeBytes",
"Period": 60,
"Statistics": [
"Average"
],
"Dimensions": [
{
"Name": "BucketName",
"Value": "BUCKET_NAME"
},
{
"Name": "StorageType",
"Value": "StandardStorage"
}
]
}
],
"carbonNameSpacePrefix": "cloudwatch2graphite"
}
}
Is there a way to get it working with AWS instance IAM role? IAM users try to avoid putting AWS keys in code/configuration files.
I'm getting this error when I try to run the application:
Error : aws credential file is missing or invalid : ./conf/credentials.json
It doesn't make sense because the credentials are stored in /etc/creds.json
and I'm passing it in as
--credentials /etc/c2g/creds.json
; but just to make sure I copied the credentials file into the ./conf
folder relative to cloudwatch2graphite.js
and renamed it to credentials.json
but it's still erroring.
Why is it bleating that it can't find the credentials?
Hi,
Sample output:
aws.dynamodb.rad_impressions.throttledrequests.updateitem.sum.count 28.0 1359407920
aws.elb.radimp.requestcount.sum.count 933.0 1359407920
aws.dynamodb.rad_impressions.consumedwritecapacityunits.sum.count 890.0 1359407920
I can get the data normally.
But from https://github.com/etsy/statsd/#usage
the usage is :|
example:
echo "foo:1|c" | nc -u -w0 127.0.0.1 8125
So "node cw2graphite.js | nc host 2003" doesn't work.
Any advise?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.