Skip to content

Commit

Permalink
warn if outside range
Browse files Browse the repository at this point in the history
  • Loading branch information
katiehockman committed Sep 22, 2022
1 parent 7db53d2 commit 45a3b8a
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions internal/telemetry/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ import (

"gopkg.in/DataDog/dd-trace-go.v1/internal"
"gopkg.in/DataDog/dd-trace-go.v1/internal/globalconfig"
"gopkg.in/DataDog/dd-trace-go.v1/internal/log"
"gopkg.in/DataDog/dd-trace-go.v1/internal/osinfo"
"gopkg.in/DataDog/dd-trace-go.v1/internal/version"
)
Expand Down Expand Up @@ -207,6 +208,7 @@ func (c *Client) Start(integrations []Integration, configuration []Configuration

heartbeat := internal.IntEnv("DD_TELEMETRY_HEARTBEAT_INTERVAL", defaultHeartbeatInterval)
if heartbeat < 1 || heartbeat > 3600 {
log.Warn("DD_TELEMETRY_HEARTBEAT_INTERVAL=%d not in [1,3600] range, setting to default of %d", heartbeat, defaultHeartbeatInterval)
heartbeat = defaultHeartbeatInterval
}
c.heartbeatInterval = time.Duration(heartbeat) * time.Second
Expand Down

0 comments on commit 45a3b8a

Please sign in to comment.