-
Notifications
You must be signed in to change notification settings - Fork 2.5k
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
[exporter/signalfx] Translate metrics together instead of individually #13170
[exporter/signalfx] Translate metrics together instead of individually #13170
Conversation
@crobert-1 PTAL at the linter failures |
It looks like tests are setting up resource metrics in unsupported formats, so that aggregation isn't working as expected. The extra checks would take care of this, but assuming proper metric format causes these to fail. I'll update the test format (resource metrics should all have the same time stamp, rather than scope metrics within resource metrics having different timestamps) unless anyone disagrees with my findings. |
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.
Where is the actual change now? :)
The change at this point is just updating test data format. It could go with another PR that will update translation rules, but I figure it would be good to have the format change attached to the discussion we've had on this PR. |
but we still apply |
I don't know why, but I got mixed around with this review. You're right, we want to apply it at the I'll update the description again and move translateAndFilter call. |
Translation rules were originally done on metrics individually. This means that only datapoints within the same metric could be operated on together. This is insufficient for the new host metrics format removing the direction dimension. To properly form metrics to match their previous format, translations must be done across metrics, especially aggregations.
- Remove unecessary aggregation checks - Move translate and filter call to be for each resource metric
- Undo change to aggregation methodology - Fix tests to properly follow metric format
Translate and filter should be done at the ScopeMetrics level. This will allow metrics to be aggregated within a ScopeMetrics, if translation rules modify them to be the same name.
8df8a3d
to
79ed0c8
Compare
I've added a benchmark test that takes hostmetrics and times how long it takes to run Here's the performance comparison before and after this change on the same dataset:
After:
I believe this shows there is a slight performance improvement for the signalfx exporter with the new functionality. |
@crobert-1 thanks for adding the benchmark 👍 Can you please post before and after results? |
Nice! Seems like there is a clear improvement. I believe we can merge it regardless of |
Description:
Translation rules were originally done on metrics individually. This means that only datapoints within the same metric could be operated on together. This is insufficient for the new host metrics format removing the direction dimension. To properly form metrics to match their previous format, translations must be done across metrics, especially aggregations. This only changes the fact that multiple MTS will be operated on at the same time, it doesn't change any translation rules. The solution is to do aggregations at the
ScopeMetric
metric level, so metrics within the sameScopeMetric
can be aggregated.This change also properly changes test metric data to be their proper format, moving metrics into corresponding
ResourceMetrics
andScopeMetrics
, instead of all being lumped into the same slices.This is an internal refactoring and testing change that should not impact any input or output data. Because of this, I don't think there should be any CHANGELOG entry.
Link to tracking Issue:
This PR is the first step to solving issue #12641
Testing:
Ensured existing tests pass, data being emitted is the same as before change.
Documentation:
NA since this is a refactor without any external impact.