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
feat(filter,cli): add remove future metrics in cli and discarding metrics written into the future #1012
base: master
Are you sure you want to change the base?
Conversation
log.Info().Msg("Cleanup of outdated metrics finished") | ||
} | ||
|
||
if *cleanupFutureMetrics { |
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.
тоже спрошу, не хотим ли мы все это сразу в отчистку метрик добавить, чтобы не плодить ключики?
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.
Мне кажется, это не нужно, тк операция удаления метрик в будущее довольно тяжелая, тк требует прохода по всем метрикам, в идеале 1 раз удалить метрики, уже записанные, а все новые, пишущиеcя в будущее, и так будут откидываться
c := *connector.client | ||
result, err := c.ZRemRangeByScore(connector.context, metricDataKey(metric), "-inf", strconv.FormatInt(toTime, 10)).Result() | ||
result, err := c.ZRemRangeByScore(connector.context, metricDataKey(metric), from, to).Result() |
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.
погоди, ты теперь удаляешь четко в интервале от до
а если метрика супер старая и она была супер в прошлом, кажется, ведь этот случай теперь сломан?
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.
так я передаю "-inf", только делаю это на уровне выше, идея была в переиспользовании этой функции
/build |
Build and push Docker images with tag: fix-remove-future-metrics.2024-04-18.25406f9 |
1 similar comment
Build and push Docker images with tag: fix-remove-future-metrics.2024-04-18.25406f9 |
Codecov ReportAttention: Patch coverage is
❗ Your organization needs to install the Codecov GitHub app to enable full functionality. Additional details and impacted files@@ Coverage Diff @@
## master #1012 +/- ##
==========================================
- Coverage 67.92% 67.82% -0.11%
==========================================
Files 212 212
Lines 12024 12098 +74
==========================================
+ Hits 8167 8205 +38
- Misses 3359 3388 +29
- Partials 498 505 +7 ☔ View full report in Codecov by Sentry. |
Add remove future metrics in cli and discarding metrics written into the future
Added ability to delete metrics via
--cleanup-future-metrics
command in cli with specifyingcleanup_future_metrics_duration
parameter in config, starting from which metrics written to the future will be deletedAlso added discarding metrics whose timestamp is greater than
now() + dropMetricsTTL
to avoid writing garbage to the databaseAnd accelerated tests by 8 seconds by replacing
time.Sleep
withmetricsCache.Flush
.