Skip to content

Commit

Permalink
victoria-metrics: migrate to dedicated ./scripts
Browse files Browse the repository at this point in the history
  • Loading branch information
Eli Mallon committed Oct 18, 2023
1 parent 5824866 commit 0ee12e3
Show file tree
Hide file tree
Showing 5 changed files with 100 additions and 3 deletions.
2 changes: 2 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,8 @@ RUN apt update && apt install -yqq \
"$(if [ "$BUILD_TARGET" != "stripped" ]; then echo "gdb"; fi)" \
&& rm -rf /var/lib/apt/lists/*

# Most of ./scripts is for livepeer-in-a-box except livepeer-vmagent, which is used in production in Catalyst proper
ADD ./scripts/livepeer-vmagent /usr/local/bin
COPY --from=catalyst-build /opt/bin/ /usr/local/bin/
COPY --from=node-build /app/go-tools/w3 /opt/local/lib/livepeer-w3
RUN ln -s /opt/local/lib/livepeer-w3/livepeer-w3.js /usr/local/bin/livepeer-w3 && \
Expand Down
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ ffmpeg:
cd ../go-livepeer && ./install_ffmpeg.sh $(buildpath)

.PHONY: mistserver
mistserver: build/sysroot-aarch64-gnu-linux
mistserver:
set -x \
&& mkdir -p ./build/mistserver \
&& cd ./build/mistserver \
Expand Down
4 changes: 2 additions & 2 deletions manifest.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ box:
darwin-arm64: victoria-metrics-darwin-arm64-v1.79.1.tar.gz
linux-amd64: victoria-metrics-linux-amd64-v1.79.1.tar.gz
linux-arm64: victoria-metrics-linux-arm64-v1.79.1.tar.gz
outputPath: livepeer-victoria-metrics
outputPath: lp-victoria-metrics
skipManifestUpdate: true
- name: vmagent
strategy:
Expand All @@ -119,5 +119,5 @@ box:
darwin-arm64: vmutils-darwin-arm64-v1.80.0.tar.gz
linux-amd64: vmutils-linux-amd64-v1.80.0.tar.gz
linux-arm64: vmutils-linux-arm64-v1.80.0.tar.gz
outputPath: livepeer-vmagent
outputPath: lp-vmagent
skipManifestUpdate: true
37 changes: 37 additions & 0 deletions scripts/livepeer-victoria-metrics
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
#!/bin/bash

set -euo pipefail

if [[ $* == *-j* ]]; then
echo '{
"name": "Livepeer Victoria Metrics",
"desc": "Livepeer-in-a-Box packaged Victoria Metrics. Comes with some built-in scrape configs for dev.",
"friendly": "Livepeer-in-a-Box packaged Victoria Metrics",
"optional": {
"envflag.enable": {
"name": "envflag.enable",
"help": "Whether to enable reading flags from environment variables additionally to command line. Command line flag values have priority over values from environment vars. Flags are read only from command line if this flag is not set. See https://docs.victoriametrics.com/#environment-variables for more details",
"option": "-envflag.enable",
"default": "true"
},
"envflag.prefix": {
"name": "envflag.prefix",
"help": "Prefix for environment variables if -envflag.enable is set",
"option": "-envflag.prefix",
"default": "VM_",
"type": "str"
},
"promscrape.config": {
"name": "promscrape.config",
"help": "Location of promscape.config file",
"option": "-promscrape.config",
"default": "./config/scrape_config.yaml",
"type": "str"
}
},
"version": "0.0.1"
}'
exit 0
fi

exec lp-victoria-metrics "$@"
58 changes: 58 additions & 0 deletions scripts/livepeer-vmagent
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
#!/bin/bash

set -euo pipefail

if [[ $* == *-j* ]]; then
echo '{
"name": "Livepeer Victoria Metrics Agent",
"desc": "Livepeer-in-a-Box packaged Victoria Metrics. Useful for remote writing metrics.",
"friendly": "Livepeer-in-a-Box packaged Victoria Metrics Agent (exporter)",
"optional": {
"envflag.enable": {
"name": "envflag.enable",
"help": "Whether to enable reading flags from environment variables additionally to command line. Command line flag values have priority over values from environment vars. Flags are read only from command line if this flag is not set. See https://docs.victoriametrics.com/#environment-variables for more details",
"option": "-envflag.enable",
"default": "true"
},
"envflag.prefix": {
"name": "envflag.prefix",
"help": "Prefix for environment variables if -envflag.enable is set",
"option": "-envflag.prefix",
"default": "VM_",
"type": "str"
},
"loggerLevel": {
"name": "loggerLevel",
"help": "Minimum level of errors to log. Possible values: INFO, WARN, ERROR, FATAL, PANIC (default INFO)",
"option": "-loggerLevel",
"default": "FATAL",
"type": "str"
},
"promscrape.config": {
"name": "promscrape.config",
"help": "Location of promscape.config file",
"option": "-promscrape.config",
"default": "./config/scrape_config.yaml",
"type": "str"
},
"remoteWrite.label": {
"name": "remoteWrite.label",
"help": "array of labels to add to metrics example label=value,label2=value2",
"option": "-remoteWrite.label",
"default": "region=dev",
"type": "str"
},
"remoteWrite.url": {
"name": "remoteWrite.url",
"help": "array of urls of the Victoria Metrics remote endpoint",
"option": "-remoteWrite.url",
"default": "http://localhost/",
"type": "str"
}
},
"version": "0.0.1"
}'
exit 0
fi

exec lp-vmagent "$@"

0 comments on commit 0ee12e3

Please sign in to comment.