Skip to content

Commit

Permalink
Updated documentation and defaults
Browse files Browse the repository at this point in the history
  • Loading branch information
wolfeidau committed Jun 5, 2024
1 parent 711eec1 commit c3e9a57
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ To adjust timeouts, and connection pooling in the HTTP client use the following

- `BUILDKITE_AGENT_METRICS_TIMEOUT` : Timeout, in seconds, TLS handshake and idle connections, for HTTP requests, to Buildkite API (default 15).
- `BUILDKITE_AGENT_METRICS_MAX_IDLE_CONNS` : Maximum number of idle (keep-alive) HTTP connections
for Buildkite Agent API. Zero means no limit, -1 disables pooling (default 0).
for Buildkite Agent API. Zero means no limit, -1 disables pooling (default 100).

Additionally, one of the following groups of environment variables must be set
in order to define how the Lambda function should obtain the required Buildkite
Expand Down Expand Up @@ -162,7 +162,7 @@ Usage of buildkite-agent-metrics:
-interval duration
Update metrics every interval, rather than once
-max-idle-conns int
Maximum number of idle (keep-alive) HTTP connections for Buildkite Agent API. Zero means no limit, -1 disables pooling.
Maximum number of idle (keep-alive) HTTP connections for Buildkite Agent API. Zero means no limit, -1 disables connection reuse. (default 100)
-newrelic-app-name string
New Relic application name for metric events
-newrelic-license-key string
Expand Down
2 changes: 1 addition & 1 deletion lambda/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ func Handler(ctx context.Context, evt json.RawMessage) (string, error) {
}

if maxIdleConns == "" {
maxIdleConns = "0" // default to unlimited
maxIdleConns = "100" // Default to 100 in line with http.DefaultTransport
}

configuredTimeout, err := strconv.Atoi(timeout)
Expand Down
2 changes: 1 addition & 1 deletion main.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ func main() {
dryRun = flag.Bool("dry-run", false, "Whether to only print metrics")
endpoint = flag.String("endpoint", "https://agent.buildkite.com/v3", "A custom Buildkite Agent API endpoint")
timeout = flag.Int("timeout", 15, "Timeout, in seconds, TLS handshake and idle connections, for HTTP requests, to Buildkite API")
maxIdleConns = flag.Int("max-idle-conns", 0, "Maximum number of idle (keep-alive) HTTP connections for Buildkite Agent API. Zero means no limit, -1 disables pooling.")
maxIdleConns = flag.Int("max-idle-conns", 100, "Maximum number of idle (keep-alive) HTTP connections for Buildkite Agent API. Zero means no limit, -1 disables connection reuse.")

// backend config
backendOpt = flag.String("backend", "cloudwatch", "Specify the backend to use: cloudwatch, newrelic, prometheus, stackdriver, statsd")
Expand Down

0 comments on commit c3e9a57

Please sign in to comment.