Giter Club home page Giter Club logo

cwopencensusexporter's Introduction

cwopencensusexporter

Build Status GoDoc Coverage Status

cwopencensusexporter implements the opencensus Exporter API and allows you to send open census metrics to cloudwatch.

Example

	awsClient := cloudwatch.New(session.Must(session.NewSession()))
	exporter, sender := cwopencensusexporter.DefaultExporter(awsClient)
	go sender.Run()
	defer sender.Shutdown(context.Background())
	ir, err := metricexport.NewIntervalReader(&metricexport.Reader{}, exporter)
	if err != nil {
		panic(err)
	}
	if err := ir.Start(); err != nil {
		panic(err)
	}
	defer ir.Stop()

Limitations

The open census API does not fully allow first class CloudWatch support. There are a few limitations causing this.

  1. CloudWatch expects to send aggregations of Max or Min across a time window. For example, the PutMetricData API for CloudWatch, when working on aggregations, wants you to specify the maximum and minimum value seen in a 60 second time window. This is not possible with the input data of metricdata.Distribution. While I can try to estimate a minimum or maximum value given the buckets, this isn't the true min or max that could otherwise be aggregated easily as points are ingested.
  2. CloudWatch wants values aggregated inside a time window. For example with 60 second aggregations, a point seen at 59.9 seconds should be in an aggregation for time window 0, while a point seen at 60.1 seconds should be in an aggregation for time window 1. The API for metricexport.Exporter does not split aggregations across time windows. The best I can do is try to align calls to Exporter.ExportMetrics to a time boundary (call at exactly 60 seconds then exactly at 120 seconds, etc). This is unlikely to handle corner cases. The best way to get data with the most fidelity would be to aggregate calls into buckets when they are added to stats.Record.
  3. Some types, like metricdata.Summary, do not translate to CloudWatch metrics and I am unable to provide a good user experience for data submitted to cwopencensusexporter.Exporter.ExportMetrics that are of type metricdata.Summary. An ideal experience for CloudWatch users would be to never let data get put into a metricdata.Summary and instead bucket them at the level of stats.Record.
  4. The layers of abstraction inside opencensus create unnecessary memory allocation that could be avoided with a system designed for CloudWatch's aggregation API.
  5. Open census buckets include the concept of [...inf] as the last range in their buckets. There's no way to represent this range for CloudWatch. Ideally open census would be able to track maximum (and minimum) values inside a time window so that I could use the min (or max) in the range of my buckets, rather than just assume infinity.

Contributing

Make sure your tests pass CI/CD pipeline which includes running make fix lint test locally.

cwopencensusexporter's People

Contributors

cep21 avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar  avatar

Forkers

isabella232

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.