Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add timeout parameter for HTTP client in Azure Log Analytics and Prometheus scalers #1548

Merged
merged 5 commits into from
Mar 26, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion content/docs/2.17/operate/cluster.md
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ Some scalers issue HTTP requests to external servers (i.e. cloud services). Each

You can override this default by setting the `KEDA_HTTP_DEFAULT_TIMEOUT` environment variable on the KEDA operator deployment to your desired timeout in milliseconds.

> ⚠️ All applicable scalers will use this timeout and setting this on a per-scaler is currently not supported.
> ⚠️ All applicable scalers will use this timeout, although some scalers allow you to override this global setting via the `timeout` parameter in the trigger metadata.

## HTTP Connection: Disable Keep Alive

Expand Down
3 changes: 3 additions & 0 deletions content/docs/2.17/scalers/azure-log-analytics.md
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,8 @@ triggers:
activeDirectoryEndpoint: https://login.airgap.example/
# Optional (Default: false)
unsafeSsl: "false"
# Optional. Custom timeout for the HTTP client used in this scaler
timeout: 1000
```

**Parameter list:**
Expand All @@ -72,6 +74,7 @@ triggers:
- `logAnalyticsResourceURL` - Log Analytics REST API URL of the cloud environment. (Required when `cloud` is set to `Private`, e.g. `https://api.loganalytics.azure.cn/` for `AzureChinaCloud`).
- `activeDirectoryEndpoint` - Active Directory endpoint of the cloud environment. (Required when `cloud` is set to `Private`, e.g. `https://login.chinacloudapi.cn/` for `AzureChinaCloud`).
- `unsafeSsl` - Determines whether or not KEDA will verify the server certificate's chain and host name. (Default: `false`, Optional, This value can be a bool)
- `timeout` - Timeout in milliseconds **for this specific trigger**. This value will override the value defined in `KEDA_HTTP_DEFAULT_TIMEOUT`. (Optional)


The authentication parameters could be provided using environmental variables, instead of setting them directly in metadata. Here is a list of parameters you can use to retrieve values from environment variables:
Expand Down
3 changes: 2 additions & 1 deletion content/docs/2.17/scalers/prometheus.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ triggers:
ignoreNullValues: false # Default is `true`, which means ignoring the empty value list from Prometheus. Set to `false` the scaler will return error when Prometheus target is lost
queryParameters: key-1=value-1,key-2=value-2
unsafeSsl: "false" # Default is `false`, Used for skipping certificate check when having self-signed certs for Prometheus endpoint

timeout: 1000 # Optional. Custom timeout for the HTTP client used in this scaler
```

**Parameter list:**
Expand All @@ -40,6 +40,7 @@ triggers:
- `ignoreNullValues` - Value to reporting error when Prometheus target is lost (Values: `true`,`false`, Default: `true`, Optional)
- `queryParameters` - A comma-separated list of query Parameters to include while querying the Prometheus endpoint. (Optional)
- `unsafeSsl` - Used for skipping certificate check e.g: using self-signed certs (Values: `true`,`false`, Default: `false`, Optional)
- `timeout` - Timeout in milliseconds **for this specific trigger**. This value will override the value defined in `KEDA_HTTP_DEFAULT_TIMEOUT`. (Optional)

### Authentication Parameters

Expand Down
3 changes: 2 additions & 1 deletion content/docs/2.17/scalers/rabbitmq-queue.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ triggers:
usernameFromEnv: RABBITMQ_USERNAME # Optional. You can use this instead of TriggerAuthentication
passwordFromEnv: RABBITMQ_PASSWORD # Optional. You can use this instead of TriggerAuthentication
unsafeSsl: true
timeout: 1000 # Optional. Custom timeout for the HTTP client used in this scaler
```

**Parameter list:**
Expand All @@ -43,7 +44,7 @@ triggers:
- `useRegex` - This parameter allows to use regex (in `queueName` parameter) to select queue instead of full name. (Values: `true`, `false`, Default: `false`, Optional, Only applies to hosts that use the `http` protocol)
- `pageSize` - This parameter allows setting page size. (Default: `100`, Optional, Only applies when `useRegex` is `true`)
- `operation` - Operation that will be applied to compute the number of messages in case of `useRegex` enabled. Either `sum` (default),`max`, or `avg`. (Optional)
- `timeout` - Timeout **for this specific trigger**. This value will override the value defined in `KEDA_HTTP_DEFAULT_TIMEOUT`. (Optional, Only applies to hosts that use the `http` protocol)
- `timeout` - Timeout in milliseconds **for this specific trigger**. This value will override the value defined in `KEDA_HTTP_DEFAULT_TIMEOUT`. (Optional, Only applies to hosts that use the `http` protocol)
- `excludeUnacknowledged` - Set to `true` to specify that the `QueueLength` value should exclude unacknowledged messages (Ready messages only). (Values: `true`, `false`, Default: `false`, Optional, Only applies to hosts that use the `http` protocol)
- `unsafeSsl` - Whether to allow unsafe SSL (Values: `true`, `false`, Default: `false` )

Expand Down
Loading