collectorenv.go 902 B

123456789101112131415161718192021222324252627282930313233
  1. package env
  2. import (
  3. "github.com/opencost/opencost/core/pkg/env"
  4. )
  5. const (
  6. NetworkPortEnvVar = "NETWORK_PORT"
  7. Collector10mResolutionRetention = "COLLECTOR_10M_RESOLUTION_RETENTION"
  8. Collector1hResolutionRetention = "COLLECTOR_1H_RESOLUTION_RETENTION"
  9. Collection1dResolutionRetention = "COLLECTOR_1D_RESOLUTION_RETENTION"
  10. CollectorScrapeInterval = "COLLECTOR_SCRAPE_INTERVAL"
  11. )
  12. func GetNetworkPort() int {
  13. return env.GetInt(NetworkPortEnvVar, 3001)
  14. }
  15. func GetCollector10mResolutionRetention() int {
  16. return env.GetInt(Collector10mResolutionRetention, 36)
  17. }
  18. func GetCollector1hResolutionRetention() int {
  19. return env.GetInt(Collector1hResolutionRetention, 49)
  20. }
  21. func GetCollection1dResolutionRetention() int {
  22. return env.GetInt(Collection1dResolutionRetention, 15)
  23. }
  24. func GetCollectorScrapeIntervalSeconds() string {
  25. return env.Get(CollectorScrapeInterval, "30s")
  26. }