Skip to content

Commit

Permalink
- Update job label to be templated
Browse files Browse the repository at this point in the history
  • Loading branch information
elipe17 committed Sep 25, 2024
1 parent 2428d41 commit e949849
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
2 changes: 2 additions & 0 deletions scripts/deploy-backend.sh
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,9 @@ prepare_promtail() {
pushd tdrs-backend/plg/promtail
CONFIG=config.yml
yq eval -i ".scrape_configs[0].job_name = \"system-$backend_app_name\"" $CONFIG
yq eval -i ".scrape_configs[0].static_configs[0].labels.job = \"system-$backend_app_name\"" $CONFIG
yq eval -i ".scrape_configs[1].job_name = \"backend-$backend_app_name\"" $CONFIG
yq eval -i ".scrape_configs[1].static_configs[0].labels.job = \"backend-$backend_app_name\"" $CONFIG
popd
}

Expand Down
4 changes: 2 additions & 2 deletions tdrs-backend/plg/promtail/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,12 @@ scrape_configs:
- targets:
- localhost
labels:
job: varlogs
job: {{ system_env_name }}
__path__: /var/log/*log
- job_name: {{ backend_env_name }}
static_configs:
- targets:
- localhost
labels:
job: django
job: {{ backend_env_name }}
__path__: /home/vcap/app/django.log

0 comments on commit e949849

Please sign in to comment.