Skip to content
This repository has been archived by the owner on Dec 6, 2024. It is now read-only.

Commit

Permalink
fix: migrate old static config to flow config (#158)
Browse files Browse the repository at this point in the history
  • Loading branch information
taco-paco authored Jul 29, 2024
1 parent 04c526b commit 82ce4a7
Show file tree
Hide file tree
Showing 4 changed files with 27 additions and 24 deletions.
8 changes: 3 additions & 5 deletions DockerfileRocket
Original file line number Diff line number Diff line change
Expand Up @@ -28,14 +28,13 @@ RUN apt-get install grafana-agent-flow
RUN npm install -g yarn && npm install -g n
RUN n lts

WORKDIR /opt/app
COPY . /opt/app

RUN curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- --default-toolchain stable -y
ENV PATH="/root/.cargo/bin:${PATH}"

RUN whoami

ENV PATH="/root/.cargo/bin:${PATH}"
WORKDIR /opt/app
COPY . /opt/app

WORKDIR /opt/app/api/hardhat_env
RUN yarn install
Expand All @@ -45,6 +44,5 @@ RUN cargo build --release
RUN chmod +x ./docker_run.sh

EXPOSE 8000
WORKDIR /opt/app/api

ENTRYPOINT [ "./docker_run.sh" ]
23 changes: 23 additions & 0 deletions api/configs/grafana-logs.config.river
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
local.file_match "logs" {
path_targets = [{
__address__ = "localhost",
__path__ = env("PROMTAIL_BASE_DIR") + "/logs/*",
host = "localhost",
job = "zksync-remix-docker-logs",
}]
}

loki.source.file "logs" {
targets = local.file_match.logs.targets
forward_to = [loki.write.logs.receiver]
}

loki.write "logs" {
endpoint {
url = "https://logs-prod-us-central1.grafana.net/loki/api/v1/push"
basic_auth {
username = env("PROMTAIL_USERNAME")
password = env("PROMTAIL_PASSWORD")
}
}
}
17 changes: 0 additions & 17 deletions api/configs/grafana-logs.config.yaml

This file was deleted.

3 changes: 1 addition & 2 deletions api/docker_run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@

# Note: This script needs to run from inside /api dir
export PROMTAIL_BASE_DIR=$(pwd)

grafana-agent-flow --config.expand-env=true --config.file ./configs/grafana-logs.config.yaml &
grafana-agent-flow run ./configs/grafana-logs.config.river

cargo run --release

0 comments on commit 82ce4a7

Please sign in to comment.