-
Notifications
You must be signed in to change notification settings - Fork 2.4k
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
[processor/spanmetrics] use LRU cache for metricKeyToDimensions
#6503
Conversation
metricKeyToDimensions
metricKeyToDimensions
81caa62
to
0ac8a38
Compare
e4f6af4
to
5b0bc7f
Compare
metricKeyToDimensions
metricKeyToDimensions
lgtm |
Another thing, why is the name of the PR |
metricKeyToDimensions
metricKeyToDimensions
0fa4224
to
e6018b3
Compare
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.
I'm happy the changes made are safe to added back to the collector.
There seem to be merge conflicts for this PR. |
Hey @jpkrohling , it should be ready to be merged now. Thanks! |
Co-authored-by: Albert <26584478+albertteoh@users.noreply.github.com>
Co-authored-by: Albert <26584478+albertteoh@users.noreply.github.com>
Co-authored-by: Albert <26584478+albertteoh@users.noreply.github.com>
Co-authored-by: Albert <26584478+albertteoh@users.noreply.github.com>
metricKeyToDimensions
metricKeyToDimensions
Once the last points are sorted out, ping me again to review/merge this one. |
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.
LGTM
@jpkrohling Could you please merge it? Thanks. |
m, err := p.buildMetrics() | ||
if err != nil { | ||
return err | ||
} | ||
|
||
// Firstly, export metrics to avoid being impacted by downstream trace processor errors/latency. | ||
if err := p.metricsExporter.ConsumeMetrics(ctx, *m); err != nil { |
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.
Why not consider periodic build and consume metric here?
Each trace goes to export metrics ( for example: remote write、otlp exporter ), will the cost be slightly higher?
* prepare release 0.64.0 * Prepare stable for version v0.64.0 * Prepare beta for version v0.64.0 * add multimod changes * changelog entries Signed-off-by: Juraci Paixão Kröhling <juraci@kroehling.de> Signed-off-by: Juraci Paixão Kröhling <juraci@kroehling.de>
Description:
Adding a feature - use LRU cache for
metricKeyToDimensions
. Hence its memory usage will be boundedLink to tracking Issue:
It partially addresses the issue: #2179
Testing:
New unit tests for the cache implementation.
Existing unit tests are updated to verify existing processing logic is still as expected.
Documentation:
The usage of
metric_key_to_dimensions_cache_size
configuration field is added in README.md