// Copyright 2013 The Prometheus Authors // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. package io.prometheus; // A label/value pair suitable for attaching to timeseries. message LabelPair { // The name of the label. Must adhere to the regex "[a-zA-Z_][a-zA-Z0-9_]*". optional string name = 1; // The value of the label. May contain any characters. optional string value = 2; } // A set of label/value pairs. message LabelPairs { repeated LabelPair label = 1; } // The global Prometheus configuration section. message GlobalConfig { // How frequently to scrape targets by default. Must be a valid Prometheus // duration string in the form "[0-9]+[smhdwy]". optional string scrape_interval = 1 [default = "1m"]; // How frequently to evaluate rules by default. Must be a valid Prometheus // duration string in the form "[0-9]+[smhdwy]". optional string evaluation_interval = 2 [default = "1m"]; // The labels to add to any timeseries that this Prometheus instance scrapes. optional LabelPairs labels = 3; // The list of file names of rule files to load. repeated string rule_file = 4; } // A labeled group of targets to scrape for a job. message TargetGroup { // The list of endpoints to scrape via HTTP. repeated string target = 1; // The labels to add to any timeseries scraped for this target group. optional LabelPairs labels = 2; } // The configuration for DNS based service discovery. message DNSConfig { // The list of DNS-SD service names pointing to SRV records // containing endpoint information. repeated string name = 1; // Discovery refresh period when using DNS-SD to discover targets. Must be a // valid Prometheus duration string in the form "[0-9]+[smhdwy]". optional string refresh_interval = 2 [default = "30s"]; } // The configuration for relabeling of target label sets. message RelabelConfig { // A list of labels from which values are taken and concatenated // with the configured separator in order. repeated string source_label = 1; // Regex against which the concatenation is matched. required string regex = 2; // The label to which the resulting string is written in a replacement. optional string target_label = 3; // Replacement is the regex replacement pattern to be used. optional string replacement = 4; // Separator is the string between concatenated values from the source labels. optional string separator = 5 [default = ";"]; // Action is the action to be performed for the relabeling. enum Action { REPLACE = 0; // Performs a regex replacement. KEEP = 1; // Drops targets for which the input does not match the regex. DROP = 2; // Drops targets for which the input does match the regex. } optional Action action = 6 [default = REPLACE]; } // The configuration for a Prometheus job to scrape. // // The next field no. is 11. message ScrapeConfig { // The job name. Must adhere to the regex "[a-zA-Z_][a-zA-Z0-9_-]*". required string job_name = 1; // How frequently to scrape targets from this job. Overrides the global // default. Must be a valid Prometheus duration string in the form // "[0-9]+[smhdwy]". optional string scrape_interval = 2; // Per-target timeout when scraping this job. Must be a valid Prometheus // duration string in the form "[0-9]+[smhdwy]". optional string scrape_timeout = 7 [default = "10s"]; // List of DNS service discovery configurations. repeated DNSConfig dns_config = 9; // List of labeled target groups for this job. repeated TargetGroup target_group = 5; // List of relabel configurations. repeated RelabelConfig relabel_config = 10; // The HTTP resource path on which to fetch metrics from targets. optional string metrics_path = 6 [default = "/metrics"]; // The URL scheme with which to fetch metrics from targets. optional string scheme = 8 [default = "http"]; } // The top-level Prometheus configuration. message PrometheusConfig { // Global Prometheus configuration options. If omitted, an empty global // configuration with default values (see GlobalConfig definition) will be // created. optional GlobalConfig global = 1; // The list of scrape configs. repeated ScrapeConfig scrape_config = 3; }