Skip to content

Commit

Permalink
- Initial update for promtail sidecars
Browse files Browse the repository at this point in the history
  • Loading branch information
elipe17 committed Sep 19, 2024
1 parent 1440b7f commit c6edd4a
Show file tree
Hide file tree
Showing 4 changed files with 56 additions and 12 deletions.
10 changes: 9 additions & 1 deletion tdrs-backend/manifest.buildpack.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,12 @@ applications:
buildpacks:
- https://github.com/cloudfoundry/apt-buildpack
- https://github.com/cloudfoundry/python-buildpack.git#v1.8.3
command: "./gunicorn_start.sh"
- https://github.com/cloudfoundry/binary-buildpack
processes:
- type: web
command: "./gunicorn_start.sh"
- type: worker
command: |
wget https://github.com/grafana/loki/releases/download/v3.1.1/promtail-linux-amd64.zip &&
unzip -a promtail-linux-amd64.zip && rm -rf promtail-linux-amd64.zip &&
./promtail-linux-amd64 -config.file=./plg/promtail/config.yml
11 changes: 2 additions & 9 deletions tdrs-backend/plg/promtail/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ positions:
filename: /tmp/positions.yaml

clients:
- url: {{ loki_push_url }}
- url: http://loki.apps.internal:8080/loki/api/v1/push

scrape_configs:
- job_name: system
Expand All @@ -16,20 +16,13 @@ scrape_configs:
labels:
job: varlogs
__path__: /var/log/*log
- job_name: {{ backend_env_name }}
- job_name: backend-raft
static_configs:
- targets:
- localhost
labels:
job: django
__path__: /logs/django.log
- job_name: {{ frontend_env_name }}
static_configs:
- targets:
- localhost
labels:
job: nginx
__path__: /var/log/nginx/*log
- job_name: flog_scrape
docker_sd_configs:
- host: unix:///var/run/docker.sock
Expand Down
11 changes: 9 additions & 2 deletions tdrs-frontend/manifest.buildpack.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,17 @@
version: 1
applications:
- name: tdp-frontend
buildpacks:
- https://github.com/cloudfoundry/nginx-buildpack.git#v1.2.6
memory: 256M
instances: 1
disk_quota: 256M
timeout: 180
buildpacks:
- https://github.com/cloudfoundry/nginx-buildpack.git#v1.2.6
- https://github.com/cloudfoundry/binary-buildpack
processes:
- type: worker
command: |
wget https://github.com/grafana/loki/releases/download/v3.1.1/promtail-linux-amd64.zip &&
unzip -a promtail-linux-amd64.zip && rm -rf promtail-linux-amd64.zip &&
./promtail-linux-amd64 -config.file=./promtail.config.yml
36 changes: 36 additions & 0 deletions tdrs-frontend/promtail.config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
server:
http_listen_port: 9080
grpc_listen_port: 0

positions:
filename: /tmp/positions.yaml

clients:
- url: http://loki.apps.internal:8080/loki/api/v1/push

scrape_configs:
- job_name: {{ system_env }}
static_configs:
- targets:
- localhost
labels:
job: varlogs
__path__: /var/log/*log
- job_name: {{ frontend_env_name }}
static_configs:
- targets:
- localhost
labels:
job: nginx
__path__: /var/log/nginx/*log
- job_name: flog_scrape
docker_sd_configs:
- host: unix:///var/run/docker.sock
refresh_interval: 5s
filters:
- name: name
values: [flog]
relabel_configs:
- source_labels: ['__meta_docker_container_name']
regex: '/(.*)'
target_label: 'container'

0 comments on commit c6edd4a

Please sign in to comment.