Open emerkle826 opened 1 year ago
Note: the constant has moved to vector/vector.go since the creation of this ticket.
Maybe the code has changed, but I don't see a strong need to change the type.
The public-facing telemetry.Vector.ScrapeInterval
uses a duration, but we truncate it to seconds when we convert it to the internal vector.VectorConfig.ScrapeInterval
-- which makes sense since it's eventually used to fill scrape_interval_secs
in the text config. DefaultScrapeInterval
provides the default for the latter, for example in stargate/vector.go
:
var scrapeInterval int32 = vector.DefaultScrapeInterval
if telemetrySpec.Vector.ScrapeInterval != nil {
scrapeInterval = int32(telemetrySpec.Vector.ScrapeInterval.Seconds())
}
config := vector.VectorConfig{
Sinks: vectorConfigToml,
ScrapePort: stargatepkg.MetricsPort,
ScrapeInterval: scrapeInterval,
}
If we change the type of DefaultScrapeInterval
, we'd have to immediately apply an int32()
conversion on the first line.
The Vector default scrape interval is defined as an
int32
. It would be better to define it as typetime.Duration
┆Issue is synchronized with this Jira Story by Unito