-
Notifications
You must be signed in to change notification settings - Fork 218
Add exponential histogram support to CloudWatch PMD Exporter #1677
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
base: main
Are you sure you want to change the base?
Conversation
49857cf
to
97c4271
Compare
not quite complete. need more unit tests
* Move OTLP implementation to separate file * Simplify map key sorting
97c4271
to
995902e
Compare
return d.AddEntryWithUnit(value, weight, "") | ||
} | ||
|
||
func (d *ExpHistogramDistribution) AddDistribution(other *ExpHistogramDistribution) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Are we trying to match the Distribution
interface? It doesn't look like this would satisfy the interface as it is now. We would have to make the Distribution
interface generic.
@@ -82,7 +83,7 @@ func ConvertOtelNumberDataPoints( | |||
unit string, | |||
scale float64, | |||
entity cloudwatch.Entity, | |||
) []*aggregationDatum { | |||
) []*aggregationDatum { //nolint:revive |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: Instead of ignoring the lint, can we just not export the function? It doesn't look like it's used outside of this package.
} | ||
// Assume function pointer is valid. | ||
ad.expHistDistribution = exph.NewExpHistogramDistribution() | ||
ad.expHistDistribution.ConvertFromOtel(dp, unit) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: If we store the unit in the MetricDatum already, why do we need to store it in the distribution?
return datums | ||
} | ||
|
||
func (c *CloudWatch) buildMetricDataumExph(metric *aggregationDatum, dimensionsList [][]*cloudwatch.Dimension) []*cloudwatch.MetricDatum { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: Typo
func (c *CloudWatch) buildMetricDataumExph(metric *aggregationDatum, dimensionsList [][]*cloudwatch.Dimension) []*cloudwatch.MetricDatum { | |
func (c *CloudWatch) buildMetricDatumExph(metric *aggregationDatum, dimensionsList [][]*cloudwatch.Dimension) []*cloudwatch.MetricDatum { |
This PR was marked stale due to lack of activity. |
Description of the issue
The Cloudwatch/PMD exporter currently drops all exponential histogram metrics.
Description of changes
Adds support for exponential histogram to the CloudWatch/PMD exporter
License
By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.
Tests
Setup something to what our OTLP -> AMP test does (see test repo).
Agent config:
Use OTLP metrics and OTLP pusher from test repo to generate exponential histogram metrics.
In CloudWatch, we can see:
Requirements
Before commit the code, please do the following steps.
make fmt
andmake fmt-sh
make lint