Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
Add Custom Metrics Manually to CircleCI Server
# This script is a workaround to a Replicated issue in which the configuration sections do not appear in the admin console.
# It should be run on the services box from a new/clean directory where a backup will be created.
if [ ! -f metrics.txt ];then
echo "Please run this script in a clean directory with a 'metrics.txt' file containing desired telegraf config"
exit 1
# install JQ, a json manipulation tool (must be version 1.5+)
curl -L -o jq
chmod a+x jq
sudo mv jq /usr/bin
jq --version
# backup existing config, augment with metrics, and pipe back into config import
replicatedctl app-config export | tee backup.json | jq --arg metrics "$(<metrics.txt)" '. += {"custom_metrics_enabled": {"value": "1"},"custom_telegraf_config": {"value":$metrics}}' | replicatedctl app-config import
region = 'us-east-2'
namespace = 'eddies-autoscale-metrics'
namepass = [
apikey = 'YOURKEY'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.