Skip to content

Commit

Permalink
fix: added promtail for gateway and gateway DB
Browse files Browse the repository at this point in the history
  • Loading branch information
krishnath.poologanathan authored and krishnath.poologanathan committed Oct 2, 2024
1 parent e022981 commit 1afb1ec
Show file tree
Hide file tree
Showing 2 changed files with 89 additions and 0 deletions.
44 changes: 44 additions & 0 deletions .github/workflows/manual-deploy-obscuro-gateway-database.yml
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,50 @@ jobs:
&& curl -fsSL https://get.docker.com -o get-docker.sh && sh ./get-docker.sh \
&& git clone --depth 1 -b ${{ env.BRANCH_NAME }} https://github.com/ten-protocol/go-ten.git /home/obscuro/go-obscuro \
&& docker network create --driver bridge node_network || true \
&& mkdir -p /home/obscuro/promtail \
&& echo "
server:
http_listen_port: 9080
grpc_listen_port: 0
positions:
filename: /tmp/positions.yaml
clients:
- url: ${{ vars.METRICS_URI }}
batchwait: 3s
batchsize: 1048576
tls_config:
insecure_skip_verify: true
basic_auth:
username: ${{ secrets.LOKI_USER }}
password: ${{ secrets.LOKI_PASSWORD }}
scrape_configs:
- job_name: flog_scrape
docker_sd_configs:
- host: unix:///var/run/docker.sock
refresh_interval: 5s
relabel_configs:
- source_labels: [\"__meta_docker_container_name\"]
regex: \"/(.*)\"
target_label: \"container\"
- source_labels: [\"__meta_docker_container_log_stream\"]
target_label: \"logstream\"
- source_labels: [\"__meta_docker_container_label_logging_jobname\"]
target_label: \"job\"
- replacement: ${{ github.event.inputs.testnet_type }}-OG-MariaDB-${{ GITHUB.RUN_NUMBER }}
target_label: "node_name"
" > /home/obscuro/promtail/promtail-config.yaml \
&& docker run -d --name promtail \
--network node_network \
-e HOSTNAME=${{ github.event.inputs.testnet_type }}-OG-MariaDB-${{ GITHUB.RUN_NUMBER }} \
-v /var/log:/var/log \
-v /home/obscuro/promtail:/etc/promtail \
-v /var/lib/docker/containers:/var/lib/docker/containers:ro \
-v /var/run/docker.sock:/var/run/docker.sock \
grafana/promtail:latest \
-config.file=/etc/promtail/promtail-config.yaml -config.expand-env=true \
&& cd /home/obscuro/go-obscuro/ \
&& docker run -d --name ${{ github.event.inputs.testnet_type }}-OG-MariaDB-${{ GITHUB.RUN_NUMBER }} \
-p 3306:3306 \
Expand Down
45 changes: 45 additions & 0 deletions .github/workflows/manual-deploy-obscuro-gateway.yml
Original file line number Diff line number Diff line change
Expand Up @@ -217,7 +217,52 @@ jobs:
&& curl -fsSL https://get.docker.com -o get-docker.sh && sh ./get-docker.sh \
&& git clone --depth 1 -b ${{ env.BRANCH_NAME }} https://github.com/ten-protocol/go-ten.git /home/obscuro/go-obscuro \
&& docker network create --driver bridge node_network || true \
&& mkdir -p /home/obscuro/promtail \
&& echo "
server:
http_listen_port: 9080
grpc_listen_port: 0
positions:
filename: /tmp/positions.yaml
clients:
- url: ${{ vars.METRICS_URI }}
batchwait: 3s
batchsize: 1048576
tls_config:
insecure_skip_verify: true
basic_auth:
username: ${{ secrets.LOKI_USER }}
password: ${{ secrets.LOKI_PASSWORD }}
scrape_configs:
- job_name: flog_scrape
docker_sd_configs:
- host: unix:///var/run/docker.sock
refresh_interval: 5s
relabel_configs:
- source_labels: [\"__meta_docker_container_name\"]
regex: \"/(.*)\"
target_label: \"container\"
- source_labels: [\"__meta_docker_container_log_stream\"]
target_label: \"logstream\"
- source_labels: [\"__meta_docker_container_label_logging_jobname\"]
target_label: \"job\"
- replacement: ${{ env.VM_NAME }}
target_label: "node_name"
" > /home/obscuro/promtail/promtail-config.yaml \
&& docker run -d --name promtail \
--network node_network \
-e HOSTNAME=${{ env.VM_NAME }} \
-v /var/log:/var/log \
-v /home/obscuro/promtail:/etc/promtail \
-v /var/lib/docker/containers:/var/lib/docker/containers:ro \
-v /var/run/docker.sock:/var/run/docker.sock \
grafana/promtail:latest \
-config.file=/etc/promtail/promtail-config.yaml -config.expand-env=true \
&& cd /home/obscuro/go-obscuro/ \
&& mkdir -p /home/obscuro/promtail \
&& docker run -d -p 80:80 -p 81:81 --name "${{ env.VM_NAME }}" \
-e OBSCURO_GATEWAY_VERSION="${{ GITHUB.RUN_NUMBER }}-${{ GITHUB.SHA }}" \
--log-opt max-file=3 --log-opt max-size=10m \
Expand Down

0 comments on commit 1afb1ec

Please sign in to comment.