Skip to content

HTTP REST Api endpoint config

hwassman edited this page Nov 12, 2026 · 1 revision
  • /config

    • Supported for both: OpenTSDB API and Prometheus API (the endpoint is served on the same port as the API and is protected by the same HTTP Basic Authentication as all other bridge endpoints).
    • Allows to read the current bridge configuration, and to update selected configuration parameters while the bridge is running.
    • Parameters are grouped by their config.ini section name. Parameters that are commented-out in config.ini are returned with the value "disabled". Secret values (password, apiKeyValue) are never returned or accepted.
    • Some parameters take effect immediately (e.g. logLevel, rawCounters, includeDiskData, retryDelay), others are only written to the config file and require a bridge restart (e.g. port, prometheus, protocol, TLS settings).
    • Changes are persisted only if a custom config file exists. Use POST /config/init to create it.
    • For a detailed description of the key categories, response formats, and step-by-step examples refer to How to change config at runtime.

Available sub-endpoints:

Method URL Description
GET /config All non-secret settings, grouped by INI section
GET /config?key=<name> A single setting (flat {key: value})
PATCH /config Batch-update one or more writable keys
PUT /config?key=<name> Update a single writable key. Body: {"value": <value>}
GET /config/sections List available INI section names
GET /config/section/<section> All non-secret keys in one INI section
PATCH /config/section/<section> Update writable keys scoped to one INI section
POST /config/init Create the custom config file so writes are persisted. Optional body: {"path": "<file>"}
GET /config/validate Validate the current live configuration
POST /config/validate Dry-run: validate a proposed change without applying it

Invalid requests (malformed JSON body, missing key or value, unknown key or section) are answered with HTTP status 400 or 404.

Example output:

Read the whole configuration:

# curl http://10.88.0.178:4242/config -u scale_admin:TXlWZXJ5U3Ryb25nUGFzc3cwcmQhCg== | jq .
{
  "basic_auth": {
    "enabled": true,
    "username": "scale_admin"
  },
  "connection": {
    "protocol": "http"
  },
  "logging": {
    "cpAccessLog": "on",
    "cpAccessLogBackups": 10,
    "logFile": "zserver.log",
    "logLevel": 15,
    "logPath": "/var/log/ibm_bridge_for_grafana"
  },
  "opentsdb_plugin": {
    "opentsdbBindIp": "0.0.0.0",
    "port": 4242
  },
  "prometheues_exporter_plugin": {
    "promBindIp": "0.0.0.0",
    "prometheus": "disabled",
    "rawCounters": true
  },
  "query": {
    "includeDiskData": false
  },
  "server": {
    "apiKeyName": "scale_grafana",
    "caCertPath": false,
    "retryDelay": 60,
    "server": "localhost",
    "serverPort": 9980
  },
  "tls": {
    "tlsCertFile": "disabled",
    "tlsKeyFile": "disabled",
    "tlsKeyPath": "disabled"
  }
}

Read a single parameter:

# curl "http://10.88.0.178:4242/config?key=logLevel" -u scale_admin:TXlWZXJ5U3Ryb25nUGFzc3cwcmQhCg==
{"logLevel": 15}

Update a single parameter (applied immediately):

# curl -X PUT -H "Content-Type: application/json" -d '{"value": 5}' "http://10.88.0.178:4242/config?key=logLevel" -u scale_admin:TXlWZXJ5U3Ryb25nUGFzc3cwcmQhCg==
{
  "updated": {"logLevel": 5},
  "restart_required": {},
  "rejected": {},
  "persisted": true
}

Update multiple parameters at once:

# curl -X PATCH -H "Content-Type: application/json" -d '{"rawCounters": false, "retryDelay": 30}' http://10.88.0.178:4242/config -u scale_admin:TXlWZXJ5U3Ryb25nUGFzc3cwcmQhCg==
{
  "updated": {"rawCounters": false, "retryDelay": 30},
  "restart_required": {},
  "rejected": {},
  "persisted": true
}

Write response fields:

Field Description
updated Keys applied to the running process immediately
restart_required Keys written to the config file, but requiring a bridge restart to take effect
rejected Keys refused entirely (secret, unknown or not belonging to the addressed section), with a reason for each
persisted true = written to the config file; false = I/O error; a string = reason why writing was skipped (e.g. no custom config file exists)

/config/sections

Lists the available INI section names.

# curl http://10.88.0.178:4242/config/sections -u scale_admin:TXlWZXJ5U3Ryb25nUGFzc3cwcmQhCg==
{"sections": ["basic_auth", "connection", "logging", "opentsdb_plugin", "prometheues_exporter_plugin", "query", "server", "tls"]}

/config/section/<section>

Reads (GET) or updates (PATCH) the keys of a single INI section. Keys that do not belong to the addressed section are rejected.

# curl http://10.88.0.178:4242/config/section/prometheues_exporter_plugin -u scale_admin:TXlWZXJ5U3Ryb25nUGFzc3cwcmQhCg==
{"promBindIp": "0.0.0.0", "prometheus": "disabled", "rawCounters": true}

/config/init

Creates the custom config file, so that changes done through the PUT and PATCH requests are persisted. Without a request body the file is created at the default location /etc/grafanabridge/config.ini. Returns 201 Created if the file was created and 200 OK if it already exists.

# curl -X POST http://10.88.0.178:4242/config/init -u scale_admin:TXlWZXJ5U3Ryb25nUGFzc3cwcmQhCg==
{"created": true, "path": "/etc/grafanabridge/config.ini"}

/config/validate

GET validates the current live configuration. POST merges the keys sent in the JSON body into a copy of the live configuration and validates the result. Nothing is applied or written to disk.

# curl http://10.88.0.178:4242/config/validate -u scale_admin:TXlWZXJ5U3Ryb25nUGFzc3cwcmQhCg==
{"valid": true}
# curl -X POST -H "Content-Type: application/json" -d '{"protocol": "https"}' http://10.88.0.178:4242/config/validate -u scale_admin:TXlWZXJ5U3Ryb25nUGFzc3cwcmQhCg==
{"valid": false, "errors": ["Missing certificates in the specified keyPath directory, quitting"], "candidate": {"...": "..."}}

User Guide

Planning your Monitoring Setup

Installation

Configuration

Maintenance

Troubleshooting

Use cases

Designing dashboards

Developer Guide

Clone this wiki locally