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

update postgres scaler docs with metricName #313

Merged
merged 2 commits into from
Dec 2, 2020
Merged
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
7 changes: 5 additions & 2 deletions content/docs/2.1/scalers/postgresql.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,9 @@ Finally, a user inserts a query that returns the desired value

- `query:` What query to poll postgresql with. Query must return an integer.
- `targetQueryValue` - a threshold that is used as `targetAverageValue` in HPA.
- `metricName` - an optional name to assign to the metric. If not set KEDA will generate a name based on either the connection string if set or the db name. If using more than one trigger it is required that all metricNames be unique.

This is an example of using a full connection string:
This is an example of using a full connection string with `AIRFLOW_CONN_AIRFLOW_DB` set as `postgresql://test@localhost`:

```yaml
triggers:
Expand All @@ -43,6 +44,7 @@ triggers:
connectionFromEnv: AIRFLOW_CONN_AIRFLOW_DB
query: "SELECT ceil(COUNT(*)::decimal / 16) FROM task_instance WHERE state='running' OR state='queued'"
targetQueryValue: 1
metricName: backlog_process_count #optional. Generated value would be `postgresql-postgresql---test@localhost`
```

While this is an example of specifying each parameter:
Expand All @@ -56,10 +58,11 @@ triggers:
host: postgres-svc.namespace.cluster.local #use the cluster-wide namespace as KEDA
#lives in a different namespace from your postgres
port: "5432"
dbName: postgresql
dbName: test_db_name
sslmode: disable
query: "SELECT ceil(COUNT(*)::decimal / 16) FROM task_instance WHERE state='running' OR state='queued'"
targetQueryValue: 1
metricName: backlog_process_count #optional. Generated value would be `postgresql-test_db_name`
```

### Authentication Parameters
Expand Down