Skip to content

Commit

Permalink
Introduce environment variables for basic auth
Browse files Browse the repository at this point in the history
  • Loading branch information
robertlemke committed Feb 11, 2022
1 parent 5fc92bf commit 374de14
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 6 deletions.
14 changes: 8 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,12 +28,14 @@ controlled through environment variables.
### Environment variables
| Variable Name | Type | Default | Description |
| ------------------------- | ------ | ---------------------------------------- | ----------------------------------------------------------- |
| PROMTAIL_CLIENT_URL | string | http://loki_loki_1:3100/loki/api/v1/push | URL pointing to the Loki push endpoint |
| PROMTAIL_LABEL_HOST | string | $(hostname) | Value of the label "host" which is added to all log entries |
| PROMTAIL_LABEL_JOB | string | beach | Value of the label "job" which is added to all log entries |
| PROMTAIL_CLIENT_TENANT_ID | string | | An optional tenant id to sent as the `X-Scope-OrgID`-header |
| Variable Name | Type | Default | Description |
| ---------------------------- | ------ | ---------------------------------------- | ----------------------------------------------------------- |
| PROMTAIL_CLIENT_URL | string | http://loki_loki_1:3100/loki/api/v1/push | URL pointing to the Loki push endpoint |
| PROMTAIL_LABEL_HOST | string | $(hostname) | Value of the label "host" which is added to all log entries |
| PROMTAIL_LABEL_JOB | string | beach | Value of the label "job" which is added to all log entries |
| PROMTAIL_CLIENT_TENANT_ID | string | | An optional tenant id to sent as the `X-Scope-OrgID`-header |
| PROMTAIL_BASIC_AUTH_USERNAME | string | | Username to use for basic auth, if required by Loki |
| PROMTAIL_BASIC_AUTH_PASSWORD | string | | Password to use for basic auth, if required by Loki |

## Security aspects

Expand Down
2 changes: 2 additions & 0 deletions root-files/opt/flownative/lib/promtail.sh
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,8 @@ export PROMTAIL_CLIENT_URL="${PROMTAIL_CLIENT_URL:-http://loki:3100/loki/api/v1/
export PROMTAIL_LABEL_JOB="${PROMTAIL_LABEL_JOB:-beach}"
export PROMTAIL_LABEL_HOST="${PROMTAIL_LABEL_HOST:-$(hostname)}"
export PROMTAIL_CLIENT_TENANT_ID="${PROMTAIL_CLIENT_TENANT_ID:-}"
export PROMTAIL_BASIC_AUTH_USERNAME="${PROMTAIL_BASIC_AUTH_USERNAME:-}"
export PROMTAIL_BASIC_AUTH_PASSWORD="${PROMTAIL_BASIC_AUTH_PASSWORD:-}"
export PATH="${PATH}:${PROMTAIL_BASE_PATH}/bin"
EOF
Expand Down
4 changes: 4 additions & 0 deletions root-files/opt/flownative/promtail/etc/config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -27,3 +27,7 @@ clients:
timeout: 10s
tenant_id: ${PROMTAIL_CLIENT_TENANT_ID}
stream_lag_labels: filename

basic_auth:
username: ${PROMTAIL_BASIC_AUTH_USERNAME}
password: ${PROMTAIL_BASIC_AUTH_PASSWORD}

0 comments on commit 374de14

Please sign in to comment.