Using Prometheous with the two-container setup

Are there any steps that need to be adjusted for using the multiple container setup that splites out redis/postgres in to data and the rest in to web_only? I’ve only added the plugin to the web_only container config.

I have the official dashboard set up in grafana and Redis RSS and Postgres Size are both N/A.

Container CPU usage and Container Memory Usage are No data but that might be from missing cadvisor on the host?

My yaml:

  - job_name: 'discourse_prometheus'
    scrape_interval: 1s
    metrics_path: /metrics
    scheme: https
    static_configs:
      - targets: ['<redact>:443']

That seems correct - bash needs the $ to be escaped.

1 Like

Not necessarily, but I guess it depends on what you are using to do the regex comparison.

#!/usr/bin/env bash

TARGET="10.20.20.5"
TARGET2="10.20.20.50"

if [[ "^10.20.20.5$" =~ $TARGET ]]; then
        echo "TARGET Matched Non-escaped"
fi

if [[ "^10.20.20.5\$" =~ $TARGET ]]; then
        echo "TARGET Matched escaped"
fi


if [[ "^10.20.20.5$" =~ $TARGET2 ]]; then
        echo "TARGET2 Matched Non-escaped"
fi

if [[ "^10.20.20.5\$" =~ $TARGET2 ]]; then
        echo "TARGET2 Matched escaped"
fi
+ TARGET=10.20.20.5
+ TARGET2=10.20.20.50
+ [[ ^10.20.20.5$ =~ 10.20.20.5 ]]
+ echo 'TARGET Matched Non-escaped'
TARGET Matched Non-escaped
+ [[ ^10.20.20.5$ =~ 10.20.20.5 ]]
+ echo 'TARGET Matched escaped'
TARGET Matched escaped
+ [[ ^10.20.20.5$ =~ 10.20.20.50 ]]
+ [[ ^10.20.20.5$ =~ 10.20.20.50 ]]