ondator / app.metrics.reporting.cloudwatch Goto Github PK
View Code? Open in Web Editor NEWCloudWatch App.Metrics reporter
License: Apache License 2.0
CloudWatch App.Metrics reporter
License: Apache License 2.0
Hi @ondator
Many thanks for uploading this source code. It is very useful.
Is this repo something that you will actively maintain?
Are you open to feedback regarding possible changes?
So far I have a couple of ideas on changes I would like to make.
AWS Namespace value that determines where the metrics are stored in Cloudwatch
There is the below code. Would you be open for the namespace value to be a property within the CloudWatchReporter class so the value could be passed in from calling code?
await _client.PutMetricDataAsync(new PutMetricDataRequest
{
MetricData = data,
Namespace = "App.Metrics"
});
Tags / Dimensions
Within the Translate method (CloudWatchReporter), there is the below code:
if (source.ReportSetItems)
{
mt.Dimensions = source
.Value
.Items
.Select(x => new Dimension { Name = x.Item, Value = x.Count.ToString() })
.ToList();
}
However I've not found that it meets my need. I need to incorporate app metrics tags in order for the metrics to have effective dimensions in cloudwatch. Like the below. This may be rough code, but i just want get your thoughts on the issue.
Or am I wrong? Should the current code be able to handle tags?
if (source.ReportSetItems)
{
mt.Dimensions = source
.Value
.Items
.Select(x => new Dimension { Name = x.Item, Value = x.Count.ToString() })
.ToList();
AddDimensions(mt, source);
}
private static void AddDimensions(MetricDatum mt, CounterValueSource source)
{
// TO DO - Refine code
int a = 0;
foreach (string i in source.Tags.Keys)
{
Console.WriteLine("CONSOLE Tags:" + i + " Value:" + source.Tags.Values[a] + " end");
mt.Dimensions.Add(new Dimension { Name = i, Value = source.Tags.Values[a]});
a++;
}
}
Thanks
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.