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

Commit

Permalink
Update prometheus Dockerfile
Browse files Browse the repository at this point in the history
  • Loading branch information
Rados13 committed Aug 29, 2023
1 parent 55743d4 commit 9a85bd6
Show file tree
Hide file tree
Showing 8 changed files with 16 additions and 31 deletions.
3 changes: 2 additions & 1 deletion .github/workflows/test_build_and_deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,8 @@ jobs:
SERVER_API_TOKEN=${{secrets.SERVER_API_TOKEN}}
SECRET_KEY_BASE=${{secrets.SECRET_KEYBASE}}
JELLYFISH_ADDRESS=${{env.JELLYFISH_ADDRESS}}
JELLYFISH_ADDRESSES=${{secrets.SANDBOX_HOST}}:5002 ${{secrets.SANDBOX2_HOST}}:4000
JELLYFISH_ADDRESSES=${{env.JELLYFISH_ADDRESS}} ${{secrets.SANDBOX2_HOST}}:4000
PROMETHEUS_TARGETS=${{secrets.SANDBOX_HOST}}:9568,${{secrets.SANDBOX2_HOST}}:9568
BACKEND_ADDRESS=${{env.BACKEND_ADDRESS}}
BEAM_PORT=9000
GF_SECURITY_ADMIN_PASSWORD=${{secrets.GF_SECURITY_ADMIN_PASSWORD}}
Expand Down
8 changes: 3 additions & 5 deletions docker-compose-deploy.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@ services:
- "5002:5002"
- "49999:49999"
- "4369:4369" # EPMD
- "9000:9000"
- "50000-50500:50000-50500/udp"

# jellyfish2:
Expand Down Expand Up @@ -78,7 +77,7 @@ services:
container_name: backend
environment:
SECRET_KEY_BASE: ${SECRET_KEY_BASE}
JELLYFISH_ADDRESSES: ${JELLYFISH_ADDRESSES:-${EXTERNAL_IP}:5002 ${JELLYFISH2_IP}:4000}
JELLYFISH_ADDRESSES: ${JELLYFISH_ADDRESSES:-$EXTERNAL_IP:5002 $JELLYFISH2_IP:4000}
SECURE_CONNECTION_JELLYFISH: ${SECURE_CONNECTION:-false}
JELLYFISH_API_TOKEN: ${SERVER_API_TOKEN}
PHX_SERVER: "true"
Expand All @@ -94,16 +93,15 @@ services:
build:
context: ./prometheus
dockerfile: Dockerfile
args:
JELLYFISH2_IP: $JELLYFISH2_IP
environment:
TARGETS: ${PROMETHEUS_TARGETS:-jellyfish1:9568,jellyfish2:9568}
container_name: prometheus
restart: on-failure
command:
- --config.file=/etc/prometheus/prometheus.yml
- --storage.tsdb.path=/prometheus
- '--web.console.libraries=/usr/share/prometheus/console_libraries'
- '--web.console.templates=/usr/share/prometheus/consoles'
# - '--enable-feature=expand-external-labels'
volumes:
- prometheus_data:/prometheus
depends_on:
Expand Down
2 changes: 2 additions & 0 deletions docker-compose-distributed-metrics.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,8 @@ services:
build:
context: ./prometheus
dockerfile: Dockerfile
environment:
TARGETS: ${PROMETHEUS_TARGETS:-jellyfish1:9568,jellyfish2:9568}
container_name: prometheus
restart: on-failure
command:
Expand Down
16 changes: 2 additions & 14 deletions docker-compose-metrics.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -33,19 +33,6 @@ services:
- "49999:49999"
- "50000-50500:50000-50500/udp"

jellyfish2:
<<: *jellyfish-template
container_name: jellyfish2
environment:
<<: *jellyfish-environment
INTEGRATED_TURN_PORT_RANGE: "50501-51000"
INTEGRATED_TCP_TURN_PORT: "499998"
PORT: 5003
ports:
- "5003:5003"
- "49998:49998"
- "50501-51000:50501-51000/udp"

frontend:
build:
context: ./assets
Expand Down Expand Up @@ -87,6 +74,8 @@ services:
build:
context: ./prometheus
dockerfile: Dockerfile
environment:
TARGETS: ${PROMETHEUS_TARGETS:-jellyfish1:9568,jellyfish2:9568}
container_name: prometheus
restart: on-failure
command:
Expand All @@ -98,7 +87,6 @@ services:
- prometheus_data:/prometheus
depends_on:
- jellyfish1
- jellyfish2

grafana:
build:
Expand Down
3 changes: 1 addition & 2 deletions mix.exs
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,7 @@ defmodule Videoroom.MixProject do
{:cors_plug, "~> 2.0"},

# Jellyfish deps
{:jellyfish_server_sdk,
github: "jellyfish-dev/elixir_server_sdk", branch: "extend_create_room"},
{:jellyfish_server_sdk, github: "jellyfish-dev/elixir_server_sdk"},

# Dev
{:credo, ">= 0.0.0", only: :dev, runtime: false},
Expand Down
4 changes: 2 additions & 2 deletions mix.lock
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,14 @@
"cowboy_telemetry": {:hex, :cowboy_telemetry, "0.4.0", "f239f68b588efa7707abce16a84d0d2acf3a0f50571f8bb7f56a15865aae820c", [:rebar3], [{:cowboy, "~> 2.7", [hex: :cowboy, repo: "hexpm", optional: false]}, {:telemetry, "~> 1.0", [hex: :telemetry, repo: "hexpm", optional: false]}], "hexpm", "7d98bac1ee4565d31b62d59f8823dfd8356a169e7fcbb83831b8a5397404c9de"},
"cowlib": {:hex, :cowlib, "2.12.1", "a9fa9a625f1d2025fe6b462cb865881329b5caff8f1854d1cbc9f9533f00e1e1", [:make, :rebar3], [], "hexpm", "163b73f6367a7341b33c794c4e88e7dbfe6498ac42dcd69ef44c5bc5507c8db0"},
"credo": {:hex, :credo, "1.7.0", "6119bee47272e85995598ee04f2ebbed3e947678dee048d10b5feca139435f75", [:mix], [{:bunt, "~> 0.2.1", [hex: :bunt, repo: "hexpm", optional: false]}, {:file_system, "~> 0.2.8", [hex: :file_system, repo: "hexpm", optional: false]}, {:jason, "~> 1.0", [hex: :jason, repo: "hexpm", optional: false]}], "hexpm", "6839fcf63d1f0d1c0f450abc8564a57c43d644077ab96f2934563e68b8a769d7"},
"dialyxir": {:hex, :dialyxir, "1.3.0", "fd1672f0922b7648ff9ce7b1b26fcf0ef56dda964a459892ad15f6b4410b5284", [:mix], [{:erlex, ">= 0.2.6", [hex: :erlex, repo: "hexpm", optional: false]}], "hexpm", "00b2a4bcd6aa8db9dcb0b38c1225b7277dca9bc370b6438715667071a304696f"},
"dialyxir": {:hex, :dialyxir, "1.4.0", "6b698401c16de79e8596b73dca63762255e70e4bbe26423530e173917220d5fc", [:mix], [{:erlex, ">= 0.2.6", [hex: :erlex, repo: "hexpm", optional: false]}], "hexpm", "c7ecaa1da27debae488ab09d9827ec58a0161c7821972b6d2cb26c1614648849"},
"divo": {:hex, :divo, "1.3.2", "3a5ce880a1fe930ea804361d1b57b5144129e79e1c856623d923a6fab6d539a1", [:mix], [{:jason, "~> 1.1", [hex: :jason, repo: "hexpm", optional: false]}, {:patiently, "~> 0.2", [hex: :patiently, repo: "hexpm", optional: false]}], "hexpm", "4bd035510838959709db2cacd28edd2eda7948d0e7f1b0dfa810a134c913a88a"},
"elixir_uuid": {:hex, :elixir_uuid, "1.2.1", "dce506597acb7e6b0daeaff52ff6a9043f5919a4c3315abb4143f0b00378c097", [:mix], [], "hexpm", "f7eba2ea6c3555cea09706492716b0d87397b88946e6380898c2889d68585752"},
"erlex": {:hex, :erlex, "0.2.6", "c7987d15e899c7a2f34f5420d2a2ea0d659682c06ac607572df55a43753aa12e", [:mix], [], "hexpm", "2ed2e25711feb44d52b17d2780eabf998452f6efda104877a3881c2f8c0c0c75"},
"file_system": {:hex, :file_system, "0.2.10", "fb082005a9cd1711c05b5248710f8826b02d7d1784e7c3451f9c1231d4fc162d", [:mix], [], "hexpm", "41195edbfb562a593726eda3b3e8b103a309b733ad25f3d642ba49696bf715dc"},
"hpax": {:hex, :hpax, "0.1.2", "09a75600d9d8bbd064cdd741f21fc06fc1f4cf3d0fcc335e5aa19be1a7235c84", [:mix], [], "hexpm", "2c87843d5a23f5f16748ebe77969880e29809580efdaccd615cd3bed628a8c13"},
"jason": {:hex, :jason, "1.4.1", "af1504e35f629ddcdd6addb3513c3853991f694921b1b9368b0bd32beb9f1b63", [:mix], [{:decimal, "~> 1.0 or ~> 2.0", [hex: :decimal, repo: "hexpm", optional: true]}], "hexpm", "fbb01ecdfd565b56261302f7e1fcc27c4fb8f32d56eab74db621fc154604a7a1"},
"jellyfish_server_sdk": {:git, "https://github.com/jellyfish-dev/elixir_server_sdk.git", "79a05de2b8e93931a219eb777fe684b517d51e1b", [branch: "extend_create_room"]},
"jellyfish_server_sdk": {:git, "https://github.com/jellyfish-dev/elixir_server_sdk.git", "1fd4ff3dbdef7c0b145ba0c31d13fdc7f2d1df1f", []},
"mime": {:hex, :mime, "2.0.5", "dc34c8efd439abe6ae0343edbb8556f4d63f178594894720607772a041b04b02", [:mix], [], "hexpm", "da0d64a365c45bc9935cc5c8a7fc5e49a0e0f9932a761c55d6c52b142780a05c"},
"mint": {:hex, :mint, "1.5.1", "8db5239e56738552d85af398798c80648db0e90f343c8469f6c6d8898944fb6f", [:mix], [{:castore, "~> 0.1.0 or ~> 1.0", [hex: :castore, repo: "hexpm", optional: true]}, {:hpax, "~> 0.1.1", [hex: :hpax, repo: "hexpm", optional: false]}], "hexpm", "4a63e1e76a7c3956abd2c72f370a0d0aecddc3976dea5c27eccbecfa5e7d5b1e"},
"open_api_spex": {:hex, :open_api_spex, "3.18.0", "f9952b6bc8a1bf14168f3754981b7c8d72d015112bfedf2588471dd602e1e715", [:mix], [{:jason, "~> 1.0", [hex: :jason, repo: "hexpm", optional: true]}, {:plug, "~> 1.7", [hex: :plug, repo: "hexpm", optional: false]}, {:poison, "~> 3.0 or ~> 4.0 or ~> 5.0", [hex: :poison, repo: "hexpm", optional: true]}, {:ymlr, "~> 2.0 or ~> 3.0 or ~> 4.0", [hex: :ymlr, repo: "hexpm", optional: true]}], "hexpm", "37849887ab67efab052376401fac28c0974b273ffaecd98f4532455ca0886464"},
Expand Down
7 changes: 2 additions & 5 deletions prometheus/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,10 +1,7 @@
FROM prom/prometheus:v2.22.0

LABEL version="1.0.0"

RUN echo " - job_name: 'jellyfish2'" >> ./prometheus.yaml
RUN echo " static_configs:" >> ./prometheus.yaml
RUN echo " - targets: ['$JELLYFISH2_IP:9568']" >> ./prometheus.yaml
ARG TARGETS

COPY ./prometheus.yaml /etc/prometheus/prometheus.yml

RUN sed -i 's/$TARGETS/'"$TARGETS"'/' /etc/prometheus/prometheus.yml
4 changes: 2 additions & 2 deletions prometheus/prometheus.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,6 @@ global:
monitor: 'codelab-monitor'

scrape_configs:
- job_name: 'jellyfish1'
- job_name: 'jellyfishes'
static_configs:
- targets: ['jellyfish1:9568']
- targets: [$TARGETS]

0 comments on commit 9a85bd6

Please sign in to comment.