diff --git a/tdrs-backend/manifest.buildpack.yml b/tdrs-backend/manifest.buildpack.yml index fc9d1460c..ee228307b 100755 --- a/tdrs-backend/manifest.buildpack.yml +++ b/tdrs-backend/manifest.buildpack.yml @@ -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 diff --git a/tdrs-backend/plg/promtail/config.yml b/tdrs-backend/plg/promtail/config.yml index 8971f3876..f2894d926 100644 --- a/tdrs-backend/plg/promtail/config.yml +++ b/tdrs-backend/plg/promtail/config.yml @@ -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 @@ -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 diff --git a/tdrs-frontend/manifest.buildpack.yml b/tdrs-frontend/manifest.buildpack.yml index d8a134a87..2185ece6c 100755 --- a/tdrs-frontend/manifest.buildpack.yml +++ b/tdrs-frontend/manifest.buildpack.yml @@ -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 diff --git a/tdrs-frontend/promtail.config.yml b/tdrs-frontend/promtail.config.yml new file mode 100644 index 000000000..ef2396b01 --- /dev/null +++ b/tdrs-frontend/promtail.config.yml @@ -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'