GithubHelp home page GithubHelp logo

app.metrics.reporting.cloudwatch's People

Contributors

andrewclarkemis avatar ondator avatar

Watchers

 avatar  avatar

app.metrics.reporting.cloudwatch's Issues

Metric Namespace and Tag/Dimension queries

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

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.