firehol/netdata

View on GitHub
src/go/plugin/go.d/modules/prometheus/config_schema.json

Summary

Maintainability
Test Coverage
{
  "jsonSchema": {
    "$schema": "http://json-schema.org/draft-07/schema#",
    "title": "Prometheus collector configuration.",
    "type": "object",
    "properties": {
      "update_every": {
        "title": "Update every",
        "description": "Data collection interval, measured in seconds.",
        "type": "integer",
        "minimum": 1,
        "default": 10
      },
      "url": {
        "title": "URL",
        "description": "The URL of the Prometheus metrics endpoint.",
        "type": "string",
        "format": "uri"
      },
      "timeout": {
        "title": "Timeout",
        "description": "The timeout in seconds for the HTTP request.",
        "type": "number",
        "minimum": 0.5,
        "default": 10
      },
      "not_follow_redirects": {
        "title": "Not follow redirects",
        "description": "If set, the client will not follow HTTP redirects automatically.",
        "type": "boolean"
      },
      "expected_prefix": {
        "title": "Expected prefix",
        "description": "If an endpoint does not return at least one metric with the specified prefix, the data is not processed.",
        "type": "string"
      },
      "label_prefix": {
        "title": "Label prefix",
        "description": "An optional prefix that will be added to all labels of all charts. If set, the label names will be automatically formatted as `prefix_name` (the prefix followed by an underscore and the original name).",
        "type": "string"
      },
      "app": {
        "title": "Application",
        "description": "If set, this value will be used in the chart context as 'prometheus.{app}.{metric_name}'.",
        "type": "string"
      },
      "selector": {
        "title": "Selectors",
        "description": "Configuration for selecting and filtering a set of time series using Prometheus selectors. If left empty, no filtering is applied.",
        "type": [
          "object",
          "null"
        ],
        "properties": {
          "allow": {
            "title": "Allow",
            "description": "Allow time series that match any of the specified [selectors](https://github.com/netdata/netdata/tree/master/src/go/plugin/go.d/pkg/prometheus/selector#readme).",
            "type": [
              "array",
              "null"
            ],
            "items": {
              "title": "Selector",
              "type": "string"
            },
            "uniqueItems": true
          },
          "deny": {
            "title": "Deny",
            "description": "Deny time series that match any of the specified [selectors](https://github.com/netdata/netdata/tree/master/src/go/plugin/go.d/pkg/prometheus/selector#readme).",
            "type": [
              "array",
              "null"
            ],
            "items": {
              "title": "Selector",
              "type": "string"
            },
            "uniqueItems": true
          }
        }
      },
      "max_time_series": {
        "title": "Time series limit",
        "description": "If an endpoint returns more time series than this limit, the data is not processed. Set to 0 for no limit.",
        "type": "integer",
        "minimum": 0,
        "default": 2000
      },
      "max_time_series_per_metric": {
        "title": "Time series per metric limit",
        "description": "Metrics with more time series than this limit are skipped. Set to 0 for no limit.",
        "type": "integer",
        "minimum": 0,
        "default": 200
      },
      "fallback_type": {
        "title": "Untyped metrics fallback",
        "description": "Process Untyped metrics as Counter or Gauge instead of ignoring them.",
        "type": [
          "object",
          "null"
        ],
        "properties": {
          "gauge": {
            "title": "As Gauge",
            "description": "Untyped metrics matching any [pattern](https://golang.org/pkg/path/filepath/#Match) will be processed as Gauge.",
            "type": [
              "array",
              "null"
            ],
            "items": {
              "title": "Pattern",
              "type": "string"
            },
            "uniqueItems": true
          },
          "Counter": {
            "title": "As Counter",
            "description": "Untyped metrics matching any [pattern](https://golang.org/pkg/path/filepath/#Match) will be processed as Counter.",
            "type": [
              "array",
              "null"
            ],
            "items": {
              "title": "Pattern",
              "type": "string"
            },
            "uniqueItems": true
          }
        }
      },
      "username": {
        "title": "Username",
        "description": "The username for basic authentication.",
        "type": "string",
        "sensitive": true
      },
      "password": {
        "title": "Password",
        "description": "The password for basic authentication.",
        "type": "string",
        "sensitive": true
      },
      "bearer_token_file": {
        "title": "Bearer token file",
        "description": "The path to the file with Bearer token.",
        "type": "string"
      },
      "proxy_url": {
        "title": "Proxy URL",
        "description": "The URL of the proxy server.",
        "type": "string"
      },
      "proxy_username": {
        "title": "Proxy username",
        "description": "The username for proxy authentication.",
        "type": "string",
        "sensitive": true
      },
      "proxy_password": {
        "title": "Proxy password",
        "description": "The password for proxy authentication.",
        "type": "string",
        "sensitive": true
      },
      "headers": {
        "title": "Headers",
        "description": "Additional HTTP headers to include in the request.",
        "type": [
          "object",
          "null"
        ],
        "additionalProperties": {
          "type": "string"
        }
      },
      "tls_skip_verify": {
        "title": "Skip TLS verification",
        "description": "If set, TLS certificate verification will be skipped.",
        "type": "boolean"
      },
      "tls_ca": {
        "title": "TLS CA",
        "description": "The path to the CA certificate file for TLS verification.",
        "type": "string",
        "pattern": "^$|^/"
      },
      "tls_cert": {
        "title": "TLS certificate",
        "description": "The path to the client certificate file for TLS authentication.",
        "type": "string",
        "pattern": "^$|^/"
      },
      "tls_key": {
        "title": "TLS key",
        "description": "The path to the client key file for TLS authentication.",
        "type": "string",
        "pattern": "^$|^/"
      },
      "body": {
        "title": "Body",
        "type": "string"
      },
      "method": {
        "title": "Method",
        "type": "string"
      }
    },
    "required": [
      "url"
    ],
    "additionalProperties": false,
    "patternProperties": {
      "^name$": {}
    }
  },
  "uiSchema": {
    "uiOptions": {
      "fullPage": true
    },
    "ui:flavour": "tabs",
    "ui:options": {
      "tabs": [
        {
          "title": "Base",
          "fields": [
            "update_every",
            "url",
            "timeout",
            "not_follow_redirects",
            "expected_prefix",
            "app"
          ]
        },
        {
          "title": "Selectors",
          "fields": [
            "selector"
          ]
        },
        {
          "title": "Limits",
          "fields": [
            "max_time_series",
            "max_time_series_per_metric"
          ]
        },
        {
          "title": "Untyped fallback",
          "fields": [
            "fallback_type"
          ]
        },
        {
          "title": "Auth",
          "fields": [
            "username",
            "password",
            "bearer_token_file"
          ]
        },
        {
          "title": "TLS",
          "fields": [
            "tls_skip_verify",
            "tls_ca",
            "tls_cert",
            "tls_key"
          ]
        },
        {
          "title": "Proxy",
          "fields": [
            "proxy_url",
            "proxy_username",
            "proxy_password"
          ]
        },
        {
          "title": "Headers",
          "fields": [
            "headers"
          ]
        }
      ]
    },
    "url": {
      "ui:placeholder": "http://203.0.113.0"
    },
    "timeout": {
      "ui:help": "Accepts decimals for precise control (e.g., type 1.5 for 1.5 seconds)."
    },
    "selector": {
      "ui:help": "The logic is as follows: `(allow1 OR allow2) AND !(deny1 OR deny2)`."
    },
    "username": {
      "ui:widget": "password"
    },
    "proxy_username": {
      "ui:widget": "password"
    },
    "password": {
      "ui:widget": "password"
    },
    "proxy_password": {
      "ui:widget": "password"
    },
    "body": {
      "ui:widget": "hidden"
    },
    "method": {
      "ui:widget": "hidden"
    }
  }
}