Ignore vaa older than 30 days for vaa_count metric (#1212)

This commit is contained in:
ftocal 2024-03-12 12:21:13 -03:00 committed by GitHub
parent 5cc4dca96e
commit 83a64b758a
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 6 additions and 0 deletions

View File

@ -180,6 +180,12 @@ func (m *Metric) vaaCountMeasurement(ctx context.Context, p *Params) error {
return nil
}
// Ignore vaa older than 30 days
thirtyDaysBefore := time.Now().AddDate(0, 0, -30)
if p.Vaa.Timestamp.Before(thirtyDaysBefore) {
return nil
}
// Write the point to influx
err = m.apiBucket30Days.WritePoint(ctx, point)
if err != nil {