Project: Prometheus (Observability and Analysis / Observability)
File: configuration.md

title: Configuration sort_rank: 1 Prometheus is configured via command-line flags and a configuration file. While the command-line flags configure immutable system parameters (such as storage locations, amount of data to keep on disk and in memory, etc.), the configuration file defines everything related to scraping [jobs and their instances](https://prometheus.io/docs/concepts/jobs_instances/), as well as which . To view all available command-line flags, run `./prometheus -h`. Prometheus can reload its configuration at runtime. If the new configuration is not well-formed, the changes will not be applied. A configuration reload is triggered by sending a `SIGHUP` to the Prometheus process or sending a HTTP POST request to the `/-/reload` endpoint (when the `--web.enable-lifecycle` flag is enabled). This will also reload any configured rule files. To specify which configuration file to load, use the `--config.file` flag. The file is written in , defined by the scheme described below. Brackets indicate that a parameter is optional. For non-list parameters the value is set to the specified default. Generic placeholders are defined as follows: `<boolean>`: a boolean that can take the values `true` or `false` `<duration>`: a duration matching the regular expression `((([0-9]+)y)?(([0-9]+)w)?(([0-9]+)d)?(([0-9]+)h)?(([0-9]+)m)?(([0-9]+)s)?(([0-9]+)ms)?|0)`, e.g. `1d`, `1h30m`, `5m`, `10s` `<filename>`: a valid path in the current working directory `<float>`: a floating-point number `<host>`: a valid string consisting of a hostname or IP followed by an optional port number `<int>`: an integer value `<labelname>`: a string matching the regular expression ``. Any other unsupported character in the source label should be converted to an underscore. For example, the label `app.kubernetes.io/name` should be written as `appkubernetesio_name`. `<labelvalue>`: a string of unicode characters `<path>`: a valid URL path `<scheme>`: a string that can take the values `http` or `https` `<secret>`: a regular string that is a secret, such as a password `<string>`: a regular string `<size>`: a size in bytes, e.g. `512MB`. A unit is required. Supported units: B, KB, MB, GB, TB, PB, EB. `<tmpl_string>`: a string which is template-expanded before usage The other placeholders are specified separately. A valid example file can be found . The global configuration specifies parameters that are valid in all other configuration contexts. They also serve as defaults for other configuration sections. ```yaml global: [ scrape_interval: <duration> | default = 1m ] [ scrape_timeout: <duration> | default = 10s ] [ scrape_protocols: [<string>, ...] | default = [ OpenMetricsText1.0.0, OpenMetricsText0.0.1, PrometheusText0.0.4 ] ] [ evaluation_interval: <duration> | default = 1m ] external_labels: [ <labelname>: <labelvalue> ... ] [ querylogfile: <string> ] [ bodysizelimit: <size> | default = 0 ] [ sample_limit: <int> | default = 0 ] [ label_limit: <int> | default = 0 ] [ labelnamelength_limit: <int> | default = 0 ] [ labelvaluelength_limit: <int> | default = 0 ] [ target_limit: <int> | default = 0 ] [ keepdroppedtargets: <int> | default = 0 ] rule_files: [ - <filepath_glob> ... ] scrapeconfigfiles: [ - <filepath_glob> ... ] scrape_configs: [ - <scrape_config> ... ] alerting: alertrelabelconfigs: [ - <relabel_config> ... ] alertmanagers: [ - <alertmanager_config> ... ] remote_write: [ - <remote_write> ... ] remote_read: [ - <remote_read> ... ] storage: [ tsdb: <tsdb> ] [ exemplars: <exemplars> ] tracing: [ <tracing_config> ] ``` A `scrape_config` section specifies a set of targets and parameters describing how to scrape them. In the general case, one scrape configuration specifies a single job. In advanced configurations, this may change. Targets may be statically configured via the `static_configs` parameter or dynamically discovered using one of the supported service-discovery mechanisms. Additionally, `relabel_configs` allow advanced modifications to any target and its labels before

```yaml jobname: <jobname> [ scrapeinterval: <duration> | default = <globalconfig.scrape_interval> ] [ scrapetimeout: <duration> | default = <globalconfig.scrape_timeout> ] [ scrapeprotocols: [<string>, ...] | default = <globalconfig.scrape_protocols> ] [ scrapeclassichistograms: <boolean> | default = false ] [ metrics_path: <path> | default = /metrics ] [ honor_labels: <boolean> | default = false ] [ honor_timestamps: <boolean> | default = true ] [ tracktimestampsstaleness: <boolean> | default = false ] [ scheme: <scheme> | default = http ] params: [ <string>: [<string>, ...] ] [ enable_compression: <boolean> | default = true ] basic_auth: [ username: <string> ] [ password: <secret> ] [ password_file: <string> ] authorization: [ type: <string> | default: Bearer ] [ credentials: <secret> ] [ credentials_file: <filename> ] oauth2: [ <oauth2> ] [ follow_redirects: <boolean> | default = true ] [ enable_http2: <boolean> | default: true ] tls_config: [ <tls_config> ] [ proxy_url: <string> ] [ no_proxy: <string> ] [ proxyfromenvironment: <boolean> | default: false ] [ proxyconnectheader: [ <string>: [<secret>, ...] ] ] azuresdconfigs: [ - <azuresdconfig> ... ] consulsdconfigs: [ - <consulsdconfig> ... ] digitaloceansdconfigs: [ - <digitaloceansdconfig> ... ] dockersdconfigs: [ - <dockersdconfig> ... ] dockerswarmsdconfigs: [ - <dockerswarmsdconfig> ... ] dnssdconfigs: [ - <dnssdconfig> ... ] ec2sdconfigs: [ - <ec2sdconfig> ... ] eurekasdconfigs: [ - <eurekasdconfig> ... ] filesdconfigs: [ - <filesdconfig> ... ] gcesdconfigs: [ - <gcesdconfig> ... ] hetznersdconfigs: [ - <hetznersdconfig> ... ] httpsdconfigs: [ - <httpsdconfig> ... ] ionossdconfigs: [ - <ionossdconfig> ... ] kubernetessdconfigs: [ - <kubernetessdconfig> ... ] kumasdconfigs: [ - <kumasdconfig> ... ] lightsailsdconfigs: [ - <lightsailsdconfig> ... ] linodesdconfigs: [ - <linodesdconfig> ... ] marathonsdconfigs: [ - <marathonsdconfig> ... ] nervesdconfigs: [ - <nervesdconfig> ... ] nomadsdconfigs: [ - <nomadsdconfig> ... ] openstacksdconfigs: [ - <openstacksdconfig> ... ] ovhcloudsdconfigs: [ - <ovhcloudsdconfig> ... ] puppetdbsdconfigs: [ - <puppetdbsdconfig> ... ] scalewaysdconfigs: [ - <scalewaysdconfig> ... ] serversetsdconfigs: [ - <serversetsdconfig> ... ] tritonsdconfigs: [ - <tritonsdconfig> ... ] uyunisdconfigs: [ - <uyunisdconfig> ... ] static_configs: [ - <static_config> ... ] relabel_configs: [ - <relabel_config> ... ] metricrelabelconfigs: [ - <relabel_config> ... ] [ bodysizelimit: <size> | default = 0 ] [ sample_limit: <int> | default = 0 ] [ label_limit: <int> | default = 0 ] [ labelnamelength_limit: <int> | default = 0 ] [ labelvaluelength_limit: <int> | default = 0 ] [ target_limit: <int> | default = 0 ] [ keepdroppedtargets: <int> | default = 0 ] [ nativehistogrambucket_limit: <int> | default = 0 ] [ nativehistogramminbucketfactor: <float> | default = 0 ] ``` Where `<job_name>` must be unique across all scrape configurations. A `tls_config` allows configuring TLS connections. ```yaml [ ca: <string> ] [ ca_file: <filename> ] [ cert: <string> ] [ cert_file: <filename> ] [ key: <secret> ] [ key_file: <filename> ] [ server_name: <string> ] [ insecureskipverify: <boolean> ] [ min_version: <string> ] [ max_version: <string> ] ``` OAuth 2.0 authentication using the client credentials grant type. Prometheus fetches an access token from the specified endpoint with the given client access and secret keys. ```yaml client_id: <string> [ client_secret: <secret> ] [ clientsecretfile: <filename> ] scopes: [ - <string> ... ] token_url: <string> endpoint_params: [ <string>: <string> ... ] tls_config: [ <tls_config> ] [ proxy_url: <string> ] [ no_proxy: <string> ] [ proxyfromenvironment: <boolean> | default: false ] [ proxyconnectheader: [ <string>: [<secret>, ...] ] ] ``` Azure SD configurations allow retrieving scrape targets from Azure

The following meta labels are available on targets during : `metaazuremachine_id`: the machine ID `metaazuremachine_location`: the location the machine runs in `metaazuremachine_name`: the machine name `metaazuremachinecomputername`: the machine computer name `metaazuremachineostype`: the machine operating system `metaazuremachineprivateip`: the machine's private IP `metaazuremachinepublicip`: the machine's public IP if it exists `metaazuremachineresourcegroup`: the machine's resource group `metaazuremachinetag<tagname>`: each tag value of the machine `metaazuremachinescaleset`: the name of the scale set which the vm is part of (this value is only set if you are using a ) `metaazuremachine_size`: the machine size `metaazuresubscription_id`: the subscription ID `metaazuretenant_id`: the tenant ID See below for the configuration options for Azure discovery: ```yaml [ environment: <string> | default = AzurePublicCloud ] [ authentication_method: <string> | default = OAuth] subscription_id: <string> [ tenant_id: <string> ] [ client_id: <string> ] [ client_secret: <secret> ] [ resource_group: <string> ] [ refresh_interval: <duration> | default = 300s ] [ port: <int> | default = 80 ] basic_auth: [ username: <string> ] [ password: <secret> ] [ password_file: <string> ] authorization: [ type: <string> | default: Bearer ] [ credentials: <secret> ] [ credentials_file: <filename> ] oauth2: [ <oauth2> ] [ proxy_url: <string> ] [ no_proxy: <string> ] [ proxyfromenvironment: <boolean> | default: false ] [ proxyconnectheader: [ <string>: [<secret>, ...] ] ] [ follow_redirects: <boolean> | default = true ] [ enable_http2: <boolean> | default: true ] tls_config: [ <tls_config> ] ``` Consul SD configurations allow retrieving scrape targets from Catalog API. The following meta labels are available on targets during : `metaconsuladdress`: the address of the target `metaconsuldc`: the datacenter name for the target `metaconsulhealth`: the health status of the service `metaconsulpartition`: the admin partition name where the service is registered `metaconsulmetadata_<key>`: each node metadata key value of the target `metaconsulnode`: the node name defined for the target `metaconsulservice_address`: the service address of the target `metaconsulservice_id`: the service ID of the target `metaconsulservicemetadata<key>`: each service metadata key value of the target `metaconsulservice_port`: the service port of the target `metaconsulservice`: the name of the service the target belongs to `metaconsultaggedaddress<key>`: each node tagged address key value of the target `metaconsultags`: the list of tags of the target joined by the tag separator ```yaml [ server: <host> | default = "localhost:8500" ] [ path_prefix: <string> ] [ token: <secret> ] [ datacenter: <string> ] [ namespace: <string> ] [ partition: <string> ] [ scheme: <string> | default = "http" ] [ username: <string> ] [ password: <secret> ] services: [ - <string> ] tags: [ - <string> ] [ node_meta: [ <string>: <string> ... ] ] [ tag_separator: <string> | default = , ] [ allow_stale: <boolean> | default = true ] [ refresh_interval: <duration> | default = 30s ] basic_auth: [ username: <string> ] [ password: <secret> ] [ password_file: <string> ] authorization: [ type: <string> | default: Bearer ] [ credentials: <secret> ] [ credentials_file: <filename> ] oauth2: [ <oauth2> ] [ proxy_url: <string> ] [ no_proxy: <string> ] [ proxyfromenvironment: <boolean> | default: false ] [ proxyconnectheader: [ <string>: [<secret>, ...] ] ] [ follow_redirects: <boolean> | default = true ] [ enable_http2: <boolean> | default: true ] tls_config: [ <tls_config> ] ``` Note that the IP number and port used to scrape the targets is assembled as `<meta_consul_address>:<metaconsulservice_port>`. However, in some Consul setups, the relevant address is in `metaconsulservice_address`. In those cases, you can use the feature to replace the special `address` label. The is the preferred and more powerful way to filter services or nodes for a service based on arbitrary labels. For users with thousands of services it can be more efficient to use the Consul API directly which has basic support for filtering nodes (currently by node metadata and a single

DigitalOcean SD configurations allow retrieving scrape targets from Droplets API. This service discovery uses the public IPv4 address by default, by that can be changed with relabeling, as demonstrated in [the Prometheus digitalocean-sd configuration file](/documentation/examples/prometheus-digitalocean.yml). The following meta labels are available on targets during : `metadigitaloceandroplet_id`: the id of the droplet `metadigitaloceandroplet_name`: the name of the droplet `metadigitaloceanimage`: the slug of the droplet's image `metadigitaloceanimage_name`: the display name of the droplet's image `metadigitaloceanprivate_ipv4`: the private IPv4 of the droplet `metadigitaloceanpublic_ipv4`: the public IPv4 of the droplet `metadigitaloceanpublic_ipv6`: the public IPv6 of the droplet `metadigitaloceanregion`: the region of the droplet `metadigitaloceansize`: the size of the droplet `metadigitaloceanstatus`: the status of the droplet `metadigitaloceanfeatures`: the comma-separated list of features of the droplet `metadigitaloceantags`: the comma-separated list of tags of the droplet `metadigitaloceanvpc`: the id of the droplet's VPC ```yaml basic_auth: [ username: <string> ] [ password: <secret> ] [ password_file: <string> ] authorization: [ type: <string> | default: Bearer ] [ credentials: <secret> ] [ credentials_file: <filename> ] oauth2: [ <oauth2> ] [ proxy_url: <string> ] [ no_proxy: <string> ] [ proxyfromenvironment: <boolean> | default: false ] [ proxyconnectheader: [ <string>: [<secret>, ...] ] ] [ follow_redirects: <boolean> | default = true ] [ enable_http2: <boolean> | default: true ] tls_config: [ <tls_config> ] [ port: <int> | default = 80 ] [ refresh_interval: <duration> | default = 60s ] ``` Docker SD configurations allow retrieving scrape targets from hosts. This SD discovers "containers" and will create a target for each network IP and port the container is configured to expose. Available meta labels: `metadockercontainer_id`: the id of the container `metadockercontainer_name`: the name of the container `metadockercontainernetworkmode`: the network mode of the container `metadockercontainerlabel<labelname>`: each label of the container, with any unsupported characters converted to an underscore `metadockernetwork_id`: the ID of the network `metadockernetwork_name`: the name of the network `metadockernetwork_ingress`: whether the network is ingress `metadockernetwork_internal`: whether the network is internal `metadockernetworklabel<labelname>`: each label of the network, with any unsupported characters converted to an underscore `metadockernetwork_scope`: the scope of the network `metadockernetwork_ip`: the IP of the container in this network `metadockerport_private`: the port on the container `metadockerport_public`: the external port if a port-mapping exists `metadockerportpublicip`: the public IP if a port-mapping exists See below for the configuration options for Docker discovery: ```yaml host: <string> [ proxy_url: <string> ] [ no_proxy: <string> ] [ proxyfromenvironment: <boolean> | default: false ] [ proxyconnectheader: [ <string>: [<secret>, ...] ] ] tls_config: [ <tls_config> ] [ port: <int> | default = 80 ] [ hostnetworkinghost: <string> | default = "localhost" ] [ filters: [ - name: <string> values: <string>, [...] ] [ refresh_interval: <duration> | default = 60s ] basic_auth: [ username: <string> ] [ password: <secret> ] [ password_file: <string> ] authorization: [ type: <string> | default: Bearer ] [ credentials: <secret> ] [ credentials_file: <filename> ] oauth2: [ <oauth2> ] [ follow_redirects: <boolean> | default = true ] [ enable_http2: <boolean> | default: true ] ``` The is the preferred and more powerful way to filter containers. For users with thousands of containers it can be more efficient to use the Docker API directly which has basic support for filtering containers (using `filters`). See for a detailed example of configuring Prometheus for Docker Engine. Docker Swarm SD configurations allow retrieving scrape targets from engine. One of the following roles can be configured to discover targets: The `services` role discovers all and exposes their ports as targets. For each published port of a service, a single target is

If a service has no published ports, a target per service is created using the `port` parameter defined in the SD configuration. Available meta labels: `metadockerswarmservice_id`: the id of the service `metadockerswarmservice_name`: the name of the service `metadockerswarmservice_mode`: the mode of the service `metadockerswarmserviceendpointport_name`: the name of the endpoint port, if available `metadockerswarmserviceendpointportpublishmode`: the publish mode of the endpoint port `metadockerswarmservicelabel<labelname>`: each label of the service, with any unsupported characters converted to an underscore `metadockerswarmservicetaskcontainer_hostname`: the container hostname of the target, if available `metadockerswarmservicetaskcontainer_image`: the container image of the target `metadockerswarmserviceupdatingstatus`: the status of the service, if available `metadockerswarmnetwork_id`: the ID of the network `metadockerswarmnetwork_name`: the name of the network `metadockerswarmnetwork_ingress`: whether the network is ingress `metadockerswarmnetwork_internal`: whether the network is internal `metadockerswarmnetworklabel<labelname>`: each label of the network, with any unsupported characters converted to an underscore `metadockerswarmnetwork_scope`: the scope of the network The `tasks` role discovers all and exposes their ports as targets. For each published port of a task, a single target is generated. If a task has no published ports, a target per task is created using the `port` parameter defined in the SD configuration. Available meta labels: `metadockerswarmcontainerlabel<labelname>`: each label of the container, with any unsupported characters converted to an underscore `metadockerswarmtask_id`: the id of the task `metadockerswarmtaskcontainerid`: the container id of the task `metadockerswarmtaskdesiredstate`: the desired state of the task `metadockerswarmtask_slot`: the slot of the task `metadockerswarmtask_state`: the state of the task `metadockerswarmtaskportpublish_mode`: the publish mode of the task port `metadockerswarmservice_id`: the id of the service `metadockerswarmservice_name`: the name of the service `metadockerswarmservice_mode`: the mode of the service `metadockerswarmservicelabel<labelname>`: each label of the service, with any unsupported characters converted to an underscore `metadockerswarmnetwork_id`: the ID of the network `metadockerswarmnetwork_name`: the name of the network `metadockerswarmnetwork_ingress`: whether the network is ingress `metadockerswarmnetwork_internal`: whether the network is internal `metadockerswarmnetworklabel<labelname>`: each label of the network, with any unsupported characters converted to an underscore `metadockerswarmnetwork_label`: each label of the network, with any unsupported characters converted to an underscore `metadockerswarmnetwork_scope`: the scope of the network `metadockerswarmnode_id`: the ID of the node `metadockerswarmnode_hostname`: the hostname of the node `metadockerswarmnode_address`: the address of the node `metadockerswarmnode_availability`: the availability of the node `metadockerswarmnodelabel<labelname>`: each label of the node, with any unsupported characters converted to an underscore `metadockerswarmnodeplatformarchitecture`: the architecture of the node `metadockerswarmnodeplatformos`: the operating system of the node `metadockerswarmnode_role`: the role of the node `metadockerswarmnode_status`: the status of the node The `metadockerswarmnetwork_*` meta labels are not populated for ports which are published with `mode=host`. The `nodes` role is used to discover . Available meta labels: `metadockerswarmnode_address`: the address of the node `metadockerswarmnode_availability`: the availability of the node `metadockerswarmnodeengineversion`: the version of the node engine `metadockerswarmnode_hostname`: the hostname of the node `metadockerswarmnode_id`: the ID of the node `metadockerswarmnodelabel<labelname>`: each label of the node, with any unsupported characters converted to an underscore `metadockerswarmnodemanageraddress`: the address of the manager component of the node `metadockerswarmnodemanagerleader`: the leadership status of the manager component of the node (true or false) `metadockerswarmnodemanagerreachability`: the reachability of the manager component of the node `metadockerswarmnodeplatformarchitecture`: the architecture of the node `metadockerswarmnodeplatformos`: the operating system of the node `metadockerswarmnode_role`: the role of the node `metadockerswarmnode_status`: the status of the node See below for the configuration options for Docker Swarm discovery: ```yaml host: <string> [ proxy_url: <string> ] [ no_proxy: <string> ] [ proxyfromenvironment: <boolean> | default: false ] [ proxyconnectheader: [ <string>: [<secret>, ...] ] ] tls_config: [ <tls_config> ] role: <string> [ port: <int> | default = 80 ] [ filters: [ - name: <string> values: <string>,

] [ refresh_interval: <duration> | default = 60s ] basic_auth: [ username: <string> ] [ password: <secret> ] [ password_file: <string> ] authorization: [ type: <string> | default: Bearer ] [ credentials: <secret> ] [ credentials_file: <filename> ] oauth2: [ <oauth2> ] [ follow_redirects: <boolean> | default = true ] [ enable_http2: <boolean> | default: true ] ``` The is the preferred and more powerful way to filter tasks, services or nodes. For users with thousands of tasks it can be more efficient to use the Swarm API directly which has basic support for filtering nodes (using `filters`). See for a detailed example of configuring Prometheus for Docker Swarm. A DNS-based service discovery configuration allows specifying a set of DNS domain names which are periodically queried to discover a list of targets. The DNS servers to be contacted are read from `/etc/resolv.conf`. This service discovery method only supports basic DNS A, AAAA, MX, NS and SRV record queries, but not the advanced DNS-SD approach specified in . The following meta labels are available on targets during : `metadnsname`: the record name that produced the discovered target. `metadnssrvrecordtarget`: the target field of the SRV record `metadnssrvrecordport`: the port field of the SRV record `metadnsmxrecordtarget`: the target field of the MX record `metadnsnsrecordtarget`: the target field of the NS record ```yaml names: [ - <string> ] [ type: <string> | default = 'SRV' ] [ port: <int>] [ refresh_interval: <duration> | default = 30s ] ``` EC2 SD configurations allow retrieving scrape targets from AWS EC2 instances. The private IP address is used by default, but may be changed to the public IP address with relabeling. The IAM credentials used must have the `ec2:DescribeInstances` permission to discover scrape targets, and may optionally have the `ec2:DescribeAvailabilityZones` permission if you want the availability zone ID available as a label (see below). The following meta labels are available on targets during : `metaec2ami`: the EC2 Amazon Machine Image `metaec2architecture`: the architecture of the instance `metaec2availability_zone`: the availability zone in which the instance is running `metaec2availabilityzoneid`: the in which the instance is running (requires `ec2:DescribeAvailabilityZones`) `metaec2instance_id`: the EC2 instance ID `metaec2instance_lifecycle`: the lifecycle of the EC2 instance, set only for 'spot' or 'scheduled' instances, absent otherwise `metaec2instance_state`: the state of the EC2 instance `metaec2instance_type`: the type of the EC2 instance `metaec2ipv6_addresses`: comma separated list of IPv6 addresses assigned to the instance's network interfaces, if present `metaec2owner_id`: the ID of the AWS account that owns the EC2 instance `metaec2platform`: the Operating System platform, set to 'windows' on Windows servers, absent otherwise `metaec2primarysubnetid`: the subnet ID of the primary network interface, if available `metaec2privatednsname`: the private DNS name of the instance, if available `metaec2private_ip`: the private IP address of the instance, if present `metaec2publicdnsname`: the public DNS name of the instance, if available `metaec2public_ip`: the public IP address of the instance, if available `metaec2region`: the region of the instance `metaec2subnet_id`: comma separated list of subnets IDs in which the instance is running, if available `metaec2tag_<tagkey>`: each tag value of the instance `metaec2vpc_id`: the ID of the VPC in which the instance is running, if available See below for the configuration options for EC2 discovery: ```yaml [ region: <string> ] [ endpoint: <string> ] [ access_key: <string> ] [ secret_key: <secret> ] [ profile: <string> ] [ role_arn: <string> ] [ refresh_interval: <duration> | default = 60s ] [ port: <int> | default = 80 ] filters: [ - name: <string> values: <string>,

] basic_auth: [ username: <string> ] [ password: <secret> ] [ password_file: <string> ] authorization: [ type: <string> | default: Bearer ] [ credentials: <secret> ] [ credentials_file: <filename> ] oauth2: [ <oauth2> ] [ proxy_url: <string> ] [ no_proxy: <string> ] [ proxyfromenvironment: <boolean> | default: false ] [ proxyconnectheader: [ <string>: [<secret>, ...] ] ] [ follow_redirects: <boolean> | default = true ] [ enable_http2: <boolean> | default: true ] tls_config: [ <tls_config> ] ``` The is the preferred and more powerful way to filter targets based on arbitrary labels. For users with thousands of instances it can be more efficient to use the EC2 API directly which has support for filtering instances. OpenStack SD configurations allow retrieving scrape targets from OpenStack Nova instances. One of the following `<openstack_role>` types can be configured to discover targets: The `hypervisor` role discovers one target per Nova hypervisor node. The target address defaults to the `host_ip` attribute of the hypervisor. The following meta labels are available on targets during : `metaopenstackhypervisorhostip`: the hypervisor node's IP address. `metaopenstackhypervisor_hostname`: the hypervisor node's name. `metaopenstackhypervisor_id`: the hypervisor node's ID. `metaopenstackhypervisor_state`: the hypervisor node's state. `metaopenstackhypervisor_status`: the hypervisor node's status. `metaopenstackhypervisor_type`: the hypervisor node's type. The `instance` role discovers one target per network interface of Nova instance. The target address defaults to the private IP address of the network interface. The following meta labels are available on targets during : `metaopenstackaddress_pool`: the pool of the private IP. `metaopenstackinstance_flavor`: the flavor of the OpenStack instance. `metaopenstackinstance_id`: the OpenStack instance ID. `metaopenstackinstance_image`: the ID of the image the OpenStack instance is using. `metaopenstackinstance_name`: the OpenStack instance name. `metaopenstackinstance_status`: the status of the OpenStack instance. `metaopenstackprivate_ip`: the private IP of the OpenStack instance. `metaopenstackproject_id`: the project (tenant) owning this instance. `metaopenstackpublic_ip`: the public IP of the OpenStack instance. `metaopenstacktag_<tagkey>`: each tag value of the instance. `metaopenstackuser_id`: the user account owning the tenant. See below for the configuration options for OpenStack discovery: ```yaml role: <openstack_role> region: <string> [ identity_endpoint: <string> ] [ username: <string> ] [ userid: <string> ] [ password: <secret> ] [ domain_name: <string> ] [ domain_id: <string> ] [ project_name: <string> ] [ project_id: <string> ] [ applicationcredentialname: <string> ] [ applicationcredentialid: <string> ] [ applicationcredentialsecret: <secret> ] [ all_tenants: <boolean> | default: false ] [ refresh_interval: <duration> | default = 60s ] [ port: <int> | default = 80 ] [ availability: <string> | default = "public" ] tls_config: [ <tls_config> ] ``` OVHcloud SD configurations allow retrieving scrape targets from OVHcloud's and using their . Prometheus will periodically check the REST endpoint and create a target for every discovered server. The role will try to use the public IPv4 address as default address, if there's none it will try to use the IPv6 one. This may be changed with relabeling. For OVHcloud's you can use the

`metaovhcloudvps_cluster`: the cluster of the server `metaovhcloudvps_datacenter`: the datacenter of the server `metaovhcloudvps_disk`: the disk of the server `metaovhcloudvpsdisplayname`: the display name of the server `metaovhcloudvps_ipv4`: the IPv4 of the server `metaovhcloudvps_ipv6`: the IPv6 of the server `metaovhcloudvps_keymap`: the KVM keyboard layout of the server `metaovhcloudvpsmaximumadditional_ip`: the maximum additional IPs of the server `metaovhcloudvpsmemorylimit`: the memory limit of the server `metaovhcloudvps_memory`: the memory of the server `metaovhcloudvpsmonitoringip_blocks`: the monitoring IP blocks of the server `metaovhcloudvps_name`: the name of the server `metaovhcloudvpsnetbootmode`: the netboot mode of the server `metaovhcloudvpsoffertype`: the offer type of the server `metaovhcloudvps_offer`: the offer of the server `metaovhcloudvps_state`: the state of the server `metaovhcloudvps_vcore`: the number of virtual cores of the server `metaovhcloudvps_version`: the version of the server `metaovhcloudvps_zone`: the zone of the server `metaovhclouddedicatedservercommercial_range`: the commercial range of the server `metaovhclouddedicatedserverdatacenter`: the datacenter of the server `metaovhclouddedicatedserveripv4`: the IPv4 of the server `metaovhclouddedicatedserveripv6`: the IPv6 of the server `metaovhclouddedicatedserverlink_speed`: the link speed of the server `metaovhclouddedicatedservername`: the name of the server `metaovhclouddedicatedserverno_intervention`: whether datacenter intervention is disabled for the server `metaovhclouddedicatedserveros`: the operating system of the server `metaovhclouddedicatedserverrack`: the rack of the server `metaovhclouddedicatedserverreverse`: the reverse DNS name of the server `metaovhclouddedicatedserverserver_id`: the ID of the server `metaovhclouddedicatedserverstate`: the state of the server `metaovhclouddedicatedserversupport_level`: the support level of the server See below for the configuration options for OVHcloud discovery: ```yaml application_key: <string> application_secret: <secret> consumer_key: <secret> service: <string> [ endpoint: <string> | default = "ovh-eu" ] [ refresh_interval: <duration> | default = 60s ] ``` PuppetDB SD configurations allow retrieving scrape targets from resources. This SD discovers resources and will create a target for each resource returned by the API. The resource address is the `certname` of the resource and can be changed during . The following meta labels are available on targets during : `metapuppetdbquery`: the Puppet Query Language (PQL) query `metapuppetdbcertname`: the name of the node associated with the resource `metapuppetdbresource`: a SHA-1 hash of the resources type, title, and parameters, for identification `metapuppetdbtype`: the resource type `metapuppetdbtitle`: the resource title `metapuppetdbexported`: whether the resource is exported (`"true"` or `"false"`) `metapuppetdbtags`: comma separated list of resource tags `metapuppetdbfile`: the manifest file in which the resource was declared `metapuppetdbenvironment`: the environment of the node associated with the resource `metapuppetdbparameter_<parametername>`: the parameters of the resource See below for the configuration options for PuppetDB discovery: ```yaml url: <string> query: <string> [ include_parameters: <boolean> | default = false ] [ refresh_interval: <duration> | default = 60s ] [ port: <int> | default = 80 ] tls_config: [ <tls_config> ] basic_auth: [ username: <string> ] [ password: <secret> ] [ password_file: <string> ] authorization: [ type: <string> | default: Bearer ] [ credentials: <secret> ] [ credentials_file: <filename> ] oauth2: [ <oauth2> ] [ proxy_url: <string> ] [ no_proxy: <string> ] [ proxyfromenvironment: <boolean> | default: false ] [ proxyconnectheader: [ <string>: [<secret>, ...] ] ] [ follow_redirects: <boolean> | default = true ] [ enable_http2: <boolean> | default: true ] ``` See for a detailed example of configuring Prometheus with PuppetDB. File-based service discovery provides a more generic way to configure static targets and serves as an interface to plug in custom service discovery mechanisms. It reads a set of files containing a list of zero or more `<static_config>`s. Changes to all defined files are detected via disk watches and applied immediately. Files may be provided in YAML or JSON format. Only changes resulting in well-formed target groups are applied. Files must contain a list of static configs, using these formats: JSON ```json [ { "targets": [ "<host>", ... ], "labels": { "<labelname>": "<labelvalue>", ... } }, ... ] ``` YAML ```yaml targets: [ - '<host>' ] labels: [ <labelname>: <labelvalue> ... ] ``` As a fallback, the file contents are also re-read periodically at the specified refresh interval. Each target has a meta label `meta_filepath` during the . Its value is set to the filepath from which the target was extracted. There is a list of with this discovery mechanism. ```yaml files: [ - <filename_pattern> ... ] [ refresh_interval: <duration> | default = 5m ] ``` Where `<filename_pattern>` may be a path ending in `.json`, `.yml` or `.yaml`. The last path segment may contain a single `` that matches any character sequence, e.g. `my/path/tg_.json`. SD configurations allow retrieving scrape targets from GCP GCE instances. The private IP address is used by default, but may be changed to the public IP address with

The following meta labels are available on targets during : `metagceinstance_id`: the numeric id of the instance `metagceinstance_name`: the name of the instance `metagcelabel_<labelname>`: each GCE label of the instance, with any unsupported characters converted to an underscore `metagcemachine_type`: full or partial URL of the machine type of the instance `metagcemetadata_<name>`: each metadata item of the instance `metagcenetwork`: the network URL of the instance `metagceprivate_ip`: the private IP address of the instance `metagceinterfaceipv4<name>`: IPv4 address of each named interface `metagceproject`: the GCP project in which the instance is running `metagcepublic_ip`: the public IP address of the instance, if present `metagcesubnetwork`: the subnetwork URL of the instance `metagcetags`: comma separated list of instance tags `metagcezone`: the GCE zone URL in which the instance is running See below for the configuration options for GCE discovery: ```yaml project: <string> zone: <string> [ filter: <string> ] [ refresh_interval: <duration> | default = 60s ] [ port: <int> | default = 80 ] [ tag_separator: <string> | default = , ] ``` Credentials are discovered by the Google Cloud SDK default client by looking in the following places, preferring the first location found: a JSON file specified by the `GOOGLEAPPLICATIONCREDENTIALS` environment variable a JSON file in the well-known path `$HOME/.config/gcloud/applicationdefaultcredentials.json` fetched from the GCE metadata server If Prometheus is running within GCE, the service account associated with the instance it is running on should have at least read-only permissions to the compute resources. If running outside of GCE make sure to create an appropriate service account and place the credential file in one of the expected locations. Hetzner SD configurations allow retrieving scrape targets from API and API. This service discovery uses the public IPv4 address by default, but that can be changed with relabeling, as demonstrated in [the Prometheus hetzner-sd configuration file](/documentation/examples/prometheus-hetzner.yml). The following meta labels are available on all targets during : `metahetznerserver_id`: the ID of the server `metahetznerserver_name`: the name of the server `metahetznerserver_status`: the status of the server `metahetznerpublic_ipv4`: the public ipv4 address of the server `metahetznerpublicipv6network`: the public ipv6 network (/64) of the server `metahetznerdatacenter`: the datacenter of the server The labels below are only available for targets with `role` set to `hcloud`: `metahetznerhcloudimagename`: the image name of the server `metahetznerhcloudimagedescription`: the description of the server image `metahetznerhcloudimageos_flavor`: the OS flavor of the server image `metahetznerhcloudimageos_version`: the OS version of the server image `metahetznerhclouddatacenterlocation`: the location of the server `metahetznerhclouddatacenterlocationnetworkzone`: the network zone of the server `metahetznerhcloudservertype`: the type of the server `metahetznerhcloudcpucores`: the CPU cores count of the server `metahetznerhcloudcputype`: the CPU type of the server (shared or dedicated) `metahetznerhcloudmemorysize_gb`: the amount of memory of the server (in GB) `metahetznerhclouddisksize_gb`: the disk size of the server (in GB) `metahetznerhcloudprivateipv4_<networkname>`: the private ipv4 address of the server within a given network `metahetznerhcloudlabel<labelname>`: each label of the server, with any unsupported characters converted to an underscore `metahetznerhcloudlabelpresent<labelname>`: `true` for each label of the server, with any unsupported characters converted to an underscore The labels below are only available for targets with `role` set to `robot`: `metahetznerrobot_product`: the product of the server `metahetznerrobot_cancelled`: the server cancellation status ```yaml role: <string> basic_auth: [ username: <string> ] [ password: <secret> ] [ password_file: <string> ] authorization: [ type: <string> | default: Bearer ] [ credentials: <secret> ] [ credentials_file: <filename> ] oauth2: [ <oauth2> ] [ proxy_url: <string> ] [ no_proxy: <string> ] [ proxyfromenvironment: <boolean> | default: false ] [ proxyconnectheader: [ <string>: [<secret>,

] ] [ follow_redirects: <boolean> | default = true ] [ enable_http2: <boolean> | default: true ] tls_config: [ <tls_config> ] [ port: <int> | default = 80 ] [ refresh_interval: <duration> | default = 60s ] ``` HTTP-based service discovery provides a more generic way to configure static targets and serves as an interface to plug in custom service discovery mechanisms. It fetches targets from an HTTP endpoint containing a list of zero or more `<static_config>`s. The target must reply with an HTTP 200 response. The HTTP header `Content-Type` must be `application/json`, and the body must be valid JSON. Example response body: ```json [ { "targets": [ "<host>", ... ], "labels": { "<labelname>": "<labelvalue>", ... } }, ... ] ``` The endpoint is queried periodically at the specified refresh interval. The `prometheussdhttpfailurestotal` counter metric tracks the number of refresh failures. Each target has a meta label `meta_url` during the . Its value is set to the URL from which the target was extracted. ```yaml url: <string> [ refresh_interval: <duration> | default = 60s ] basic_auth: [ username: <string> ] [ password: <secret> ] [ password_file: <string> ] authorization: [ type: <string> | default: Bearer ] [ credentials: <secret> ] [ credentials_file: <filename> ] oauth2: [ <oauth2> ] [ proxy_url: <string> ] [ no_proxy: <string> ] [ proxyfromenvironment: <boolean> | default: false ] [ proxyconnectheader: [ <string>: [<secret>, ...] ] ] [ follow_redirects: <boolean> | default = true ] [ enable_http2: <boolean> | default: true ] tls_config: [ <tls_config> ] ``` IONOS SD configurations allows retrieving scrape targets from API. This service discovery uses the first NICs IP address by default, but that can be changed with relabeling. The following meta labels are available on all targets during : `metaionosserveravailabilityzone`: the availability zone of the server `metaionosserverbootcdrom_id`: the ID of the CD-ROM the server is booted from `metaionosserverbootimage_id`: the ID of the boot image or snapshot the server is booted from `metaionosserverbootvolume_id`: the ID of the boot volume `metaionosservercpufamily`: the CPU family of the server to `metaionosserver_id`: the ID of the server `metaionosserver_ip`: comma separated list of all IPs assigned to the server `metaionosserver_lifecycle`: the lifecycle state of the server resource `metaionosserver_name`: the name of the server `metaionosservernicip<nicname>`: comma separated list of IPs, grouped by the name of each NIC attached to the server `metaionosserverserversid`: the ID of the servers the server belongs to `metaionosserver_state`: the execution state of the server `metaionosserver_type`: the type of the server ```yaml datacenter_id: <string> basic_auth: [ username: <string> ] [ password: <secret> ] [ password_file: <string> ] authorization: [ type: <string> | default: Bearer ] [ credentials: <secret> ] [ credentials_file: <filename> ] oauth2: [ <oauth2> ] [ proxy_url: <string> ] [ no_proxy: <string> ] [ proxyfromenvironment: <boolean> | default: false ] [ proxyconnectheader: [ <string>: [<secret>, ...] ] ] [ follow_redirects: <boolean> | default = true ] [ enable_http2: <boolean> | default: true ] tls_config: [ <tls_config> ] [ port: <int> | default = 80 ] [ refresh_interval: <duration> | default = 60s ] ``` Kubernetes SD configurations allow retrieving scrape targets from REST API and always staying synchronized with the cluster state. One of the following `role` types can be configured to discover targets: The `node` role discovers one target per cluster node with the address defaulting to the Kubelet's HTTP port. The target address defaults to the first existing address of the Kubernetes node object in the address type order of `NodeInternalIP`, `NodeExternalIP`, `NodeLegacyHostIP`, and `NodeHostName`. Available meta labels: `metakubernetesnode_name`: The name of the node object. `metakubernetesnodeproviderid`: The cloud provider's name for the node object. `metakubernetesnodelabel<labelname>`: Each label from the node object, with any unsupported characters converted to an

`metakubernetesnodelabelpresent<labelname>`: `true` for each label from the node object, with any unsupported characters converted to an underscore. `metakubernetesnodeannotation<annotationname>`: Each annotation from the node object. `metakubernetesnodeannotationpresent<annotationname>`: `true` for each annotation from the node object. `metakubernetesnodeaddress<address_type>`: The first address for each node address type, if it exists. In addition, the `instance` label for the node will be set to the node name as retrieved from the API server. The `service` role discovers a target for each service port for each service. This is generally useful for blackbox monitoring of a service. The address will be set to the Kubernetes DNS name of the service and respective service port. Available meta labels: `metakubernetesnamespace`: The namespace of the service object. `metakubernetesserviceannotation<annotationname>`: Each annotation from the service object. `metakubernetesserviceannotationpresent<annotationname>`: "true" for each annotation of the service object. `metakubernetesserviceclusterip`: The cluster IP address of the service. (Does not apply to services of type ExternalName) `metakubernetesserviceloadbalancerip`: The IP address of the loadbalancer. (Applies to services of type LoadBalancer) `metakubernetesserviceexternalname`: The DNS name of the service. (Applies to services of type ExternalName) `metakubernetesservicelabel<labelname>`: Each label from the service object, with any unsupported characters converted to an underscore. `metakubernetesservicelabelpresent<labelname>`: `true` for each label of the service object, with any unsupported characters converted to an underscore. `metakubernetesservice_name`: The name of the service object. `metakubernetesserviceportname`: Name of the service port for the target. `metakubernetesserviceportnumber`: Number of the service port for the target. `metakubernetesserviceportprotocol`: Protocol of the service port for the target. `metakubernetesservice_type`: The type of the service. The `pod` role discovers all pods and exposes their containers as targets. For each declared port of a container, a single target is generated. If a container has no specified ports, a port-free target per container is created for manually adding a port via relabeling. Available meta labels: `metakubernetesnamespace`: The namespace of the pod object. `metakubernetespod_name`: The name of the pod object. `metakubernetespod_ip`: The pod IP of the pod object. `metakubernetespodlabel<labelname>`: Each label from the pod object, with any unsupported characters converted to an underscore. `metakubernetespodlabelpresent<labelname>`: `true` for each label from the pod object, with any unsupported characters converted to an underscore. `metakubernetespodannotation<annotationname>`: Each annotation from the pod object. `metakubernetespodannotationpresent<annotationname>`: `true` for each annotation from the pod object. `metakubernetespodcontainerinit`: `true` if the container is an `metakubernetespodcontainername`: Name of the container the target address points to. `metakubernetespodcontainerid`: ID of the container the target address points to. The ID is in the form `<type>://<container_id>`. `metakubernetespodcontainerimage`: The image the container is using. `metakubernetespodcontainerport_name`: Name of the container port. `metakubernetespodcontainerport_number`: Number of the container port. `metakubernetespodcontainerport_protocol`: Protocol of the container port. `metakubernetespod_ready`: Set to `true` or `false` for the pod's ready state. `metakubernetespod_phase`: Set to `Pending`, `Running`, `Succeeded`, `Failed` or `Unknown` in the . `metakubernetespodnodename`: The name of the node the pod is scheduled onto. `metakubernetespodhostip`: The current host IP of the pod object. `metakubernetespod_uid`: The UID of the pod object. `metakubernetespodcontrollerkind`: Object kind of the pod controller. `metakubernetespodcontrollername`: Name of the pod controller. The `endpoints` role discovers targets from listed endpoints of a service. For each endpoint address one target is discovered per port. If the endpoint is backed by a pod, all additional container ports of the pod, not bound to an endpoint port, are discovered as targets as well. Available meta labels: `metakubernetesnamespace`: The namespace of the endpoints object. `metakubernetesendpoints_name`: The names of the endpoints object. `metakubernetesendpointslabel<labelname>`: Each label from the endpoints object, with any unsupported characters converted to an underscore. `metakubernetesendpointslabelpresent<labelname>`: `true` for each label from the endpoints object, with any unsupported characters converted to an underscore. `metakubernetesendpointsannotation<annotationname>`: Each annotation from the endpoints object. `metakubernetesendpointsannotationpresent<annotationname>`: `true` for each annotation from the endpoints

For all targets discovered directly from the endpoints list (those not additionally inferred from underlying pods), the following labels are attached: `metakubernetesendpoint_hostname`: Hostname of the endpoint. `metakubernetesendpointnodename`: Name of the node hosting the endpoint. `metakubernetesendpoint_ready`: Set to `true` or `false` for the endpoint's ready state. `metakubernetesendpointportname`: Name of the endpoint port. `metakubernetesendpointportprotocol`: Protocol of the endpoint port. `metakubernetesendpointaddresstarget_kind`: Kind of the endpoint address target. `metakubernetesendpointaddresstarget_name`: Name of the endpoint address target. If the endpoints belong to a service, all labels of the `role: service` discovery are attached. For all targets backed by a pod, all labels of the `role: pod` discovery are attached. The `endpointslice` role discovers targets from existing endpointslices. For each endpoint address referenced in the endpointslice object one target is discovered. If the endpoint is backed by a pod, all additional container ports of the pod, not bound to an endpoint port, are discovered as targets as well. Available meta labels: `metakubernetesnamespace`: The namespace of the endpoints object. `metakubernetesendpointslice_name`: The name of endpointslice object. `metakubernetesendpointslicelabel<labelname>`: Each label from the endpointslice object, with any unsupported characters converted to an underscore. `metakubernetesendpointslicelabelpresent<labelname>`: `true` for each label from the endpointslice object, with any unsupported characters converted to an underscore. `metakubernetesendpointsliceannotation<annotationname>`: Each annotation from the endpointslice object. `metakubernetesendpointsliceannotationpresent<annotationname>`: `true` for each annotation from the endpointslice object. For all targets discovered directly from the endpointslice list (those not additionally inferred from underlying pods), the following labels are attached: `metakubernetesendpointsliceaddresstarget_kind`: Kind of the referenced object. `metakubernetesendpointsliceaddresstarget_name`: Name of referenced object. `metakubernetesendpointsliceaddresstype`: The ip protocol family of the address of the target. `metakubernetesendpointsliceendpointconditions_ready`: Set to `true` or `false` for the referenced endpoint's ready state. `metakubernetesendpointsliceendpointconditions_serving`: Set to `true` or `false` for the referenced endpoint's serving state. `metakubernetesendpointsliceendpointconditions_terminating`: Set to `true` or `false` for the referenced endpoint's terminating state. `metakubernetesendpointsliceendpointtopologykubernetesio_hostname`: Name of the node hosting the referenced endpoint. `metakubernetesendpointsliceendpointtopologypresentkubernetesiohostname`: Flag that shows if the referenced object has a kubernetes.io/hostname annotation. `metakubernetesendpointsliceendpointhostname`: Hostname of the referenced endpoint. `metakubernetesendpointsliceendpointnode_name`: Name of the Node hosting the referenced endpoint. `metakubernetesendpointsliceendpointzone`: Zone the referenced endpoint exists in (only available when using the `discovery.k8s.io/v1` API group). `metakubernetesendpointslice_port`: Port of the referenced endpoint. `metakubernetesendpointsliceportname`: Named port of the referenced endpoint. `metakubernetesendpointsliceportprotocol`: Protocol of the referenced endpoint. If the endpoints belong to a service, all labels of the `role: service` discovery are attached. For all targets backed by a pod, all labels of the `role: pod` discovery are attached. The `ingress` role discovers a target for each path of each ingress. This is generally useful for blackbox monitoring of an ingress. The address will be set to the host specified in the ingress spec. Available meta labels: `metakubernetesnamespace`: The namespace of the ingress object. `metakubernetesingress_name`: The name of the ingress object. `metakubernetesingresslabel<labelname>`: Each label from the ingress object, with any unsupported characters converted to an underscore. `metakubernetesingresslabelpresent<labelname>`: `true` for each label from the ingress object, with any unsupported characters converted to an underscore. `metakubernetesingressannotation<annotationname>`: Each annotation from the ingress object. `metakubernetesingressannotationpresent<annotationname>`: `true` for each annotation from the ingress object. `metakubernetesingressclassname`: Class name from ingress spec, if present. `metakubernetesingress_scheme`: Protocol scheme of ingress, `https` if TLS config is set. Defaults to `http`. `metakubernetesingress_path`: Path from ingress spec. Defaults to

See below for the configuration options for Kubernetes discovery: ```yaml [ api_server: <host> ] role: <string> [ kubeconfig_file: <filename> ] basic_auth: [ username: <string> ] [ password: <secret> ] [ password_file: <string> ] authorization: [ type: <string> | default: Bearer ] [ credentials: <secret> ] [ credentials_file: <filename> ] oauth2: [ <oauth2> ] [ proxy_url: <string> ] [ no_proxy: <string> ] [ proxyfromenvironment: <boolean> | default: false ] [ proxyconnectheader: [ <string>: [<secret>, ...] ] ] [ follow_redirects: <boolean> | default = true ] [ enable_http2: <boolean> | default: true ] tls_config: [ <tls_config> ] namespaces: own_namespace: <boolean> names: [ - <string> ] [ selectors: [ - role: <string> [ label: <string> ] [ field: <string> ] ]] attach_metadata: [ node: <boolean> | default = false ] ``` See for a detailed example of configuring Prometheus for Kubernetes. You may wish to check out the 3rd party , which automates the Prometheus setup on top of Kubernetes. Kuma SD configurations allow retrieving scrape target from the control plane. This SD discovers "monitoring assignments" based on Kuma , via the MADS v1 (Monitoring Assignment Discovery Service) xDS API, and will create a target for each proxy inside a Prometheus-enabled mesh. The following meta labels are available for each target: `metakumamesh`: the name of the proxy's Mesh `metakumadataplane`: the name of the proxy `metakumaservice`: the name of the proxy's associated Service `metakumalabel_<tagname>`: each tag of the proxy See below for the configuration options for Kuma MonitoringAssignment discovery: ```yaml server: <string> [ client_id: <string> ] [ refresh_interval: <duration> | default = 30s ] [ fetch_timeout: <duration> | default = 2m ] [ proxy_url: <string> ] [ no_proxy: <string> ] [ proxyfromenvironment: <boolean> | default: false ] [ proxyconnectheader: [ <string>: [<secret>, ...] ] ] tls_config: [ <tls_config> ] basic_auth: [ username: <string> ] [ password: <secret> ] [ password_file: <string> ] authorization: [ type: <string> | default: Bearer ] [ credentials: <secret> ] [ credentials_file: <filename> ] oauth2: [ <oauth2> ] [ follow_redirects: <boolean> | default = true ] [ enable_http2: <boolean> | default: true ] ``` The is the preferred and more powerful way to filter proxies and user-defined tags. Lightsail SD configurations allow retrieving scrape targets from instances. The private IP address is used by default, but may be changed to the public IP address with relabeling. The following meta labels are available on targets during : `metalightsailavailability_zone`: the availability zone in which the instance is running `metalightsailblueprint_id`: the Lightsail blueprint ID `metalightsailbundle_id`: the Lightsail bundle ID `metalightsailinstance_name`: the name of the Lightsail instance `metalightsailinstance_state`: the state of the Lightsail instance `metalightsailinstancesupportcode`: the support code of the Lightsail instance `metalightsailipv6_addresses`: comma separated list of IPv6 addresses assigned to the instance's network interfaces, if present `metalightsailprivate_ip`: the private IP address of the instance `metalightsailpublic_ip`: the public IP address of the instance, if available `metalightsailregion`: the region of the instance `metalightsailtag_<tagkey>`: each tag value of the instance See below for the configuration options for Lightsail discovery: ```yaml [ region: <string> ] [ endpoint: <string> ] [ access_key: <string> ] [ secret_key: <secret> ] [ profile: <string> ] [ role_arn: <string> ] [ refresh_interval: <duration> | default = 60s ] [ port: <int> | default = 80 ] basic_auth: [ username: <string> ] [ password: <secret> ] [ password_file: <string> ] authorization: [ type: <string> | default: Bearer ] [ credentials: <secret> ] [ credentials_file: <filename> ] oauth2: [ <oauth2> ] [ proxy_url: <string> ] [ no_proxy: <string> ] [ proxyfromenvironment: <boolean> | default: false ] [ proxyconnectheader: [ <string>: [<secret>, ...] ] ] [ follow_redirects: <boolean> | default = true ] [ enable_http2: <boolean> | default: true ] tls_config: [ <tls_config> ] ``` Linode SD configurations allow retrieving scrape targets from Linode APIv4. This service discovery uses the public IPv4 address by default, by that can be changed with relabeling, as demonstrated in [the Prometheus linode-sd configuration

The following meta labels are available on targets during : `metalinodeinstance_id`: the id of the linode instance `metalinodeinstance_label`: the label of the linode instance `metalinodeimage`: the slug of the linode instance's image `metalinodeprivate_ipv4`: the private IPv4 of the linode instance `metalinodepublic_ipv4`: the public IPv4 of the linode instance `metalinodepublic_ipv6`: the public IPv6 of the linode instance `metalinodeprivateipv4rdns`: the reverse DNS for the first private IPv4 of the linode instance `metalinodepublicipv4rdns`: the reverse DNS for the first public IPv4 of the linode instance `metalinodepublicipv6rdns`: the reverse DNS for the first public IPv6 of the linode instance `metalinoderegion`: the region of the linode instance `metalinodetype`: the type of the linode instance `metalinodestatus`: the status of the linode instance `metalinodetags`: a list of tags of the linode instance joined by the tag separator `metalinodegroup`: the display group a linode instance is a member of `metalinodegpus`: the number of GPU's of the linode instance `metalinodehypervisor`: the virtualization software powering the linode instance `metalinodebackups`: the backup service status of the linode instance `metalinodespecsdiskbytes`: the amount of storage space the linode instance has access to `metalinodespecsmemorybytes`: the amount of RAM the linode instance has access to `metalinodespecs_vcpus`: the number of VCPUS this linode has access to `metalinodespecstransferbytes`: the amount of network transfer the linode instance is allotted each month `metalinodeextra_ips`: a list of all extra IPv4 addresses assigned to the linode instance joined by the tag separator `metalinodeipv6_ranges`: a list of IPv6 ranges with mask assigned to the linode instance joined by the tag separator ```yaml basic_auth: [ username: <string> ] [ password: <secret> ] [ password_file: <string> ] authorization: [ type: <string> | default: Bearer ] [ credentials: <secret> ] [ credentials_file: <filename> ] oauth2: [ <oauth2> ] [ region: <string> ] [ proxy_url: <string> ] [ no_proxy: <string> ] [ proxyfromenvironment: <boolean> | default: false ] [ proxyconnectheader: [ <string>: [<secret>, ...] ] ] [ follow_redirects: <boolean> | default = true ] [ enable_http2: <boolean> | default: true ] tls_config: [ <tls_config> ] [ port: <int> | default = 80 ] [ tag_separator: <string> | default = , ] [ refresh_interval: <duration> | default = 60s ] ``` Marathon SD configurations allow retrieving scrape targets using the REST API. Prometheus will periodically check the REST endpoint for currently running tasks and create a target group for every app that has at least one healthy task. The following meta labels are available on targets during : `metamarathonapp`: the name of the app (with slashes replaced by dashes) `metamarathonimage`: the name of the Docker image used (if available) `metamarathontask`: the ID of the Mesos task `metamarathonapplabel<labelname>`: any Marathon labels attached to the app, with any unsupported characters converted to an underscore `metamarathonportdefinitionlabel_<labelname>`: the port definition labels, with any unsupported characters converted to an underscore `metamarathonportmappinglabel_<labelname>`: the port mapping labels, with any unsupported characters converted to an underscore `metamarathonport_index`: the port index number (e.g. `1` for `PORT1`) See below for the configuration options for Marathon discovery: ```yaml servers: <string> [ refresh_interval: <duration> | default = 30s ] [ auth_token: <secret> ] [ authtokenfile: <filename> ] basic_auth: [ username: <string> ] [ password: <secret> ] [ password_file: <string> ] authorization: [ type: <string> | default: Bearer ] [ credentials: <secret> ] [ credentials_file: <filename> ] oauth2: [ <oauth2> ] [ follow_redirects: <boolean> | default = true ] [ enable_http2: <boolean> | default: true ] tls_config: [ <tls_config> ] [ proxy_url: <string> ] [ no_proxy: <string> ] [ proxyfromenvironment: <boolean> | default: false ] [ proxyconnectheader: [ <string>: [<secret>, ...] ] ] ``` By default every app listed in Marathon will be scraped by

If not all of your services provide Prometheus metrics, you can use a Marathon label and Prometheus relabeling to control which instances will actually be scraped. See for a practical example on how to set up your Marathon app and your Prometheus configuration. By default, all apps will show up as a single job in Prometheus (the one specified in the configuration file), which can also be changed using relabeling. Nerve SD configurations allow retrieving scrape targets from [AirBnB's Nerve] (https://github.com/airbnb/nerve) which are stored in . The following meta labels are available on targets during : `metanervepath`: the full path to the endpoint node in Zookeeper `metanerveendpoint_host`: the host of the endpoint `metanerveendpoint_port`: the port of the endpoint `metanerveendpoint_name`: the name of the endpoint ```yaml servers: <host> paths: <string> [ timeout: <duration> | default = 10s ] ``` Nomad SD configurations allow retrieving scrape targets from Service API. The following meta labels are available on targets during : `metanomadaddress`: the service address of the target `metanomaddc`: the datacenter name for the target `metanomadnamespace`: the namespace of the target `metanomadnode_id`: the node name defined for the target `metanomadservice`: the name of the service the target belongs to `metanomadservice_address`: the service address of the target `metanomadservice_id`: the service ID of the target `metanomadservice_port`: the service port of the target `metanomadtags`: the list of tags of the target joined by the tag separator ```yaml [ allow_stale: <boolean> | default = true ] [ namespace: <string> | default = default ] [ refresh_interval: <duration> | default = 60s ] [ region: <string> | default = global ] [ server: <host> ] [ tag_separator: <string> | default = ,] basic_auth: [ username: <string> ] [ password: <secret> ] [ password_file: <string> ] authorization: [ type: <string> | default: Bearer ] [ credentials: <secret> ] [ credentials_file: <filename> ] oauth2: [ <oauth2> ] [ proxy_url: <string> ] [ no_proxy: <string> ] [ proxyfromenvironment: <boolean> | default: false ] [ proxyconnectheader: [ <string>: [<secret>, ...] ] ] [ follow_redirects: <boolean> | default = true ] [ enable_http2: <boolean> | default: true ] tls_config: [ <tls_config> ] ``` Serverset SD configurations allow retrieving scrape targets from [Serversets] (https://github.com/twitter/finagle/tree/develop/finagle-serversets) which are stored in . Serversets are commonly used by and . The following meta labels are available on targets during : `metaserversetpath`: the full path to the serverset member node in Zookeeper `metaserversetendpoint_host`: the host of the default endpoint `metaserversetendpoint_port`: the port of the default endpoint `metaserversetendpointhost<endpoint>`: the host of the given endpoint `metaserversetendpointport<endpoint>`: the port of the given endpoint `metaserversetshard`: the shard number of the member `metaserversetstatus`: the status of the member ```yaml servers: <host> paths: <string> [ timeout: <duration> | default = 10s ] ``` Serverset data must be in the JSON format, the Thrift format is not currently supported. SD configurations allow retrieving scrape targets from discovery endpoints. One of the following `<triton_role>` types can be configured to discover targets: The `container` role discovers one target per "virtual machine" owned by the `account`. These are SmartOS zones or lx/KVM/bhyve branded zones. The following meta labels are available on targets during : `metatritongroups`: the list of groups belonging to the target joined by a comma separator `metatritonmachine_alias`: the alias of the target container `metatritonmachine_brand`: the brand of the target container `metatritonmachine_id`: the UUID of the target container `metatritonmachine_image`: the target container's image type `metatritonserver_id`: the server UUID the target container is running on The `cn` role discovers one target for per compute node (also known as "server" or "global zone") making up the Triton

The `account` must be a Triton operator and is currently required to own at least one `container`. The following meta labels are available on targets during : `metatritonmachine_alias`: the hostname of the target (requires triton-cmon 1.7.0 or newer) `metatritonmachine_id`: the UUID of the target See below for the configuration options for Triton discovery: ```yaml account: <string> [ role : <string> | default = "container" ] dns_suffix: <string> endpoint: <string> groups: [ - <string> ... ] [ port: <int> | default = 9163 ] [ refresh_interval: <duration> | default = 60s ] [ version: <int> | default = 1 ] tls_config: [ <tls_config> ] ``` Eureka SD configurations allow retrieving scrape targets using the REST API. Prometheus will periodically check the REST endpoint and create a target for every app instance. The following meta labels are available on targets during : `metaeurekaapp_name`: the name of the app `metaeurekaappinstanceid`: the ID of the app instance `metaeurekaappinstancehostname`: the hostname of the instance `metaeurekaappinstancehomepage_url`: the homepage url of the app instance `metaeurekaappinstancestatuspage_url`: the status page url of the app instance `metaeurekaappinstancehealthcheck_url`: the health check url of the app instance `metaeurekaappinstanceip_addr`: the IP address of the app instance `metaeurekaappinstancevip_address`: the VIP address of the app instance `metaeurekaappinstancesecurevipaddress`: the secure VIP address of the app instance `metaeurekaappinstancestatus`: the status of the app instance `metaeurekaappinstanceport`: the port of the app instance `metaeurekaappinstanceport_enabled`: the port enabled of the app instance `metaeurekaappinstancesecure_port`: the secure port address of the app instance `metaeurekaappinstancesecureportenabled`: the secure port of the app instance `metaeurekaappinstancecountry_id`: the country ID of the app instance `metaeurekaappinstancemetadata_<metadataname>`: app instance metadata `metaeurekaappinstancedatacenterinfo_name`: the datacenter name of the app instance `metaeurekaappinstancedatacenterinfo_<metadataname>`: the datacenter metadata See below for the configuration options for Eureka discovery: ```yaml server: <string> basic_auth: [ username: <string> ] [ password: <secret> ] [ password_file: <string> ] authorization: [ type: <string> | default: Bearer ] [ credentials: <secret> ] [ credentials_file: <filename> ] oauth2: [ <oauth2> ] tls_config: [ <tls_config> ] [ proxy_url: <string> ] [ no_proxy: <string> ] [ proxyfromenvironment: <boolean> | default: false ] [ proxyconnectheader: [ <string>: [<secret>, ...] ] ] [ follow_redirects: <boolean> | default = true ] [ enable_http2: <boolean> | default: true ] [ refresh_interval: <duration> | default = 30s ] ``` See for a practical example on how to set up your Eureka app and your Prometheus configuration. Scaleway SD configurations allow retrieving scrape targets from and . The following meta labels are available on targets during : `metascalewayinstanceboottype`: the boot type of the server `metascalewayinstance_hostname`: the hostname of the server `metascalewayinstance_id`: the ID of the server `metascalewayinstanceimagearch`: the arch of the server image `metascalewayinstanceimageid`: the ID of the server image `metascalewayinstanceimagename`: the name of the server image `metascalewayinstancelocationcluster_id`: the cluster ID of the server location `metascalewayinstancelocationhypervisor_id`: the hypervisor ID of the server location `metascalewayinstancelocationnode_id`: the node ID of the server location `metascalewayinstance_name`: name of the server `metascalewayinstanceorganizationid`: the organization of the server `metascalewayinstanceprivateipv4`: the private IPv4 address of the server `metascalewayinstanceprojectid`: project id of the server `metascalewayinstancepublicipv4`: the public IPv4 address of the server `metascalewayinstancepublicipv6`: the public IPv6 address of the server `metascalewayinstance_region`: the region of the server `metascalewayinstancesecuritygroup_id`: the ID of the security group of the server `metascalewayinstancesecuritygroup_name`: the name of the security group of the server `metascalewayinstance_status`: status of the server `metascalewayinstance_tags`: the list of tags of the server joined by the tag separator `metascalewayinstance_type`: commercial type of the server `metascalewayinstance_zone`: the zone of the server (ex: `fr-par-1`, complete list ) This role uses the first address it finds in the following order: private IPv4, public IPv4, public IPv6. This can be changed with relabeling, as demonstrated in [the Prometheus scaleway-sd configuration

Should an instance have no address before relabeling, it will not be added to the target list and you will not be able to relabel it. `metascalewaybaremetal_id`: the ID of the server `metascalewaybaremetalpublicipv4`: the public IPv4 address of the server `metascalewaybaremetalpublicipv6`: the public IPv6 address of the server `metascalewaybaremetal_name`: the name of the server `metascalewaybaremetalosname`: the name of the operating system of the server `metascalewaybaremetalosversion`: the version of the operating system of the server `metascalewaybaremetalprojectid`: the project ID of the server `metascalewaybaremetal_status`: the status of the server `metascalewaybaremetal_tags`: the list of tags of the server joined by the tag separator `metascalewaybaremetal_type`: the commercial type of the server `metascalewaybaremetal_zone`: the zone of the server (ex: `fr-par-1`, complete list ) This role uses the public IPv4 address by default. This can be changed with relabeling, as demonstrated in [the Prometheus scaleway-sd configuration file](/documentation/examples/prometheus-scaleway.yml). See below for the configuration options for Scaleway discovery: ```yaml access_key: <string> [ secret_key: <secret> ] [ secretkeyfile: <filename> ] project_id: <string> role: <string> [ port: <int> | default = 80 ] [ api_url: <string> | default = "https://api.scaleway.com" ] [ zone: <string> | default = fr-par-1 ] [ name_filter: <string> ] tags_filter: [ - <string> ] [ refresh_interval: <duration> | default = 60s ] [ follow_redirects: <boolean> | default = true ] [ enable_http2: <boolean> | default: true ] [ proxy_url: <string> ] [ no_proxy: <string> ] [ proxyfromenvironment: <boolean> | default: false ] [ proxyconnectheader: [ <string>: [<secret>, ...] ] ] tls_config: [ <tls_config> ] ``` Uyuni SD configurations allow retrieving scrape targets from managed systems via API. The following meta labels are available on targets during : `metauyuniendpoint_name`: the name of the application endpoint `metauyuniexporter`: the exporter exposing metrics for the target `metauyunigroups`: the system groups of the target `metauyunimetrics_path`: metrics path for the target `metauyuniminion_hostname`: hostname of the Uyuni client `metauyuniprimary_fqdn`: primary FQDN of the Uyuni client `metauyuniproxymodule`: the module name if Exporter Exporter_ proxy is configured for the target `metauyunischeme`: the protocol scheme used for requests `metauyunisystem_id`: the system ID of the client See below for the configuration options for Uyuni discovery: ```yaml server: <string> username: <string> password: <secret> [ entitlement: <string> | default = monitoring_entitled ] [ separator: <string> | default = , ] [ refresh_interval: <duration> | default = 60s ] basic_auth: [ username: <string> ] [ password: <secret> ] [ password_file: <string> ] authorization: [ type: <string> | default: Bearer ] [ credentials: <secret> ] [ credentials_file: <filename> ] oauth2: [ <oauth2> ] [ proxy_url: <string> ] [ no_proxy: <string> ] [ proxyfromenvironment: <boolean> | default: false ] [ proxyconnectheader: [ <string>: [<secret>, ...] ] ] [ follow_redirects: <boolean> | default = true ] [ enable_http2: <boolean> | default: true ] tls_config: [ <tls_config> ] ``` See for a practical example on how to set up Uyuni Prometheus configuration. Vultr SD configurations allow retrieving scrape targets from . This service discovery uses the main IPv4 address by default, which that be changed with relabeling, as demonstrated in [the Prometheus vultr-sd configuration file](/documentation/examples/prometheus-vultr.yml). The following meta labels are available on targets during : `metavultrinstance_id` : A unique ID for the vultr Instance. `metavultrinstance_label` : The user-supplied label for this instance. `metavultrinstance_os` : The Operating System name. `metavultrinstanceosid` : The Operating System id used by this instance. `metavultrinstance_region` : The Region id where the Instance is located. `metavultrinstance_plan` : A unique ID for the Plan. `metavultrinstancemainip` : The main IPv4 address. `metavultrinstanceinternalip` : The private IP address. `metavultrinstancemainipv6` : The main IPv6 address. `metavultrinstance_features` : List of features that are available to the

`metavultrinstance_tags` : List of tags associated with the instance. `metavultrinstance_hostname` : The hostname for this instance. `metavultrinstanceserverstatus` : The server health status. `metavultrinstancevcpucount` : Number of vCPUs. `metavultrinstancerammb` : The amount of RAM in MB. `metavultrinstancediskgb` : The size of the disk in GB. `metavultrinstanceallowedbandwidth_gb` : Monthly bandwidth quota in GB. ```yaml basic_auth: [ username: <string> ] [ password: <secret> ] [ password_file: <string> ] authorization: [ type: <string> | default: Bearer ] [ credentials: <secret> ] [ credentials_file: <filename> ] oauth2: [ <oauth2> ] [ proxy_url: <string> ] [ no_proxy: <string> ] [ proxyfromenvironment: <boolean> | default: false ] [ proxyconnectheader: [ <string>: [<secret>, ...] ] ] [ follow_redirects: <boolean> | default = true ] [ enable_http2: <boolean> | default: true ] tls_config: [ <tls_config> ] [ port: <int> | default = 80 ] [ refresh_interval: <duration> | default = 60s ] ``` A `static_config` allows specifying a list of targets and a common label set for them. It is the canonical way to specify static targets in a scrape configuration. ```yaml targets: [ - '<host>' ] labels: [ <labelname>: <labelvalue> ... ] ``` Relabeling is a powerful tool to dynamically rewrite the label set of a target before it gets scraped. Multiple relabeling steps can be configured per scrape configuration. They are applied to the label set of each target in order of their appearance in the configuration file. Initially, aside from the configured per-target labels, a target's `job` label is set to the `job_name` value of the respective scrape configuration. The `address` label is set to the `<host>:<port>` address of the target. After relabeling, the `instance` label is set to the value of `address` by default if it was not set during relabeling. The `scheme` and `metrics_path` labels are set to the scheme and metrics path of the target respectively. The `param_<name>` label is set to the value of the first passed URL parameter called `<name>`. The `scrape_interval` and `scrape_timeout` labels are set to the target's interval and timeout. Additional labels prefixed with `meta_` may be available during the relabeling phase. They are set by the service discovery mechanism that provided the target and vary between mechanisms. Labels starting with `` will be removed from the label set after target relabeling is completed. If a relabeling step needs to store a label value only temporarily (as the input to a subsequent relabeling step), use the `tmp` label name prefix. This prefix is guaranteed to never be used by Prometheus itself. ```yaml [ source_labels: '[' <labelname> [, ...] ']' ] [ separator: <string> | default = ; ] [ target_label: <labelname> ] [ regex: <regex> | default = (.*) ] [ modulus: <int> ] [ replacement: <string> | default = $1 ] [ action: <relabel_action> | default = replace ] ``` `<regex>` is any valid . It is required for the `replace`, `keep`, `drop`, `labelmap`,`labeldrop` and `labelkeep` actions. The regex is anchored on both ends. To un-anchor the regex, use `.<regex>.`. `<relabel_action>` determines the relabeling action to take: `replace`: Match `regex` against the concatenated `source_labels`. Then, set `target_label` to `replacement`, with match group references (`${1}`, `${2}`, ...) in `replacement` substituted by their value. If `regex` does not match, no replacement takes place. `lowercase`: Maps the concatenated `source_labels` to their lower case. `uppercase`: Maps the concatenated `source_labels` to their upper case. `keep`: Drop targets for which `regex` does not match the concatenated `source_labels`. `drop`: Drop targets for which `regex` matches the concatenated `source_labels`. `keepequal`: Drop targets for which the concatenated `sourcelabels` do not match

`dropequal`: Drop targets for which the concatenated `sourcelabels` do match `targetlabel`. `hashmod`: Set `targetlabel` to the `modulus` of a hash of the concatenated `sourcelabels`. `labelmap`: Match `regex` against all source label names, not just those specified in `source_labels`. Then copy the values of the matching labels to label names given by `replacement` with match group references (`${1}`, `${2}`, ...) in `replacement` substituted by their value. `labeldrop`: Match `regex` against all label names. Any label that matches will be removed from the set of labels. `labelkeep`: Match `regex` against all label names. Any label that does not match will be removed from the set of labels. Care must be taken with `labeldrop` and `labelkeep` to ensure that metrics are still uniquely labeled once the labels are removed. Metric relabeling is applied to samples as the last step before ingestion. It has the same configuration format and actions as target relabeling. Metric relabeling does not apply to automatically generated timeseries such as `up`. One use for this is to exclude time series that are too expensive to ingest. Alert relabeling is applied to alerts before they are sent to the Alertmanager. It has the same configuration format and actions as target relabeling. Alert relabeling is applied after external labels. One use for this is ensuring a HA pair of Prometheus servers with different external labels send identical alerts. An `alertmanager_config` section specifies Alertmanager instances the Prometheus server sends alerts to. It also provides parameters to configure how to communicate with these Alertmanagers. Alertmanagers may be statically configured via the `static_configs` parameter or dynamically discovered using one of the supported service-discovery mechanisms. Additionally, `relabel_configs` allow selecting Alertmanagers from discovered entities and provide advanced modifications to the used API path, which is exposed through the `alerts_path` label. ```yaml [ timeout: <duration> | default = 10s ] [ api_version: <string> | default = v2 ] [ path_prefix: <path> | default = / ] [ scheme: <scheme> | default = http ] basic_auth: [ username: <string> ] [ password: <secret> ] [ password_file: <string> ] authorization: [ type: <string> | default: Bearer ] [ credentials: <secret> ] [ credentials_file: <filename> ] sigv4: [ region: <string> ] [ access_key: <string> ] [ secret_key: <secret> ] [ profile: <string> ] [ role_arn: <string> ] oauth2: [ <oauth2> ] tls_config: [ <tls_config> ] [ proxy_url: <string> ] [ no_proxy: <string> ] [ proxyfromenvironment: <boolean> | default: false ] [ proxyconnectheader: [ <string>: [<secret>, ...] ] ] [ follow_redirects: <boolean> | default = true ] [ enable_http2: <boolean> | default: true ] azuresdconfigs: [ - <azuresdconfig> ... ] consulsdconfigs: [ - <consulsdconfig> ... ] dnssdconfigs: [ - <dnssdconfig> ... ] ec2sdconfigs: [ - <ec2sdconfig> ... ] eurekasdconfigs: [ - <eurekasdconfig> ... ] filesdconfigs: [ - <filesdconfig> ... ] digitaloceansdconfigs: [ - <digitaloceansdconfig> ... ] dockersdconfigs: [ - <dockersdconfig> ... ] dockerswarmsdconfigs: [ - <dockerswarmsdconfig> ... ] gcesdconfigs: [ - <gcesdconfig> ... ] hetznersdconfigs: [ - <hetznersdconfig> ... ] httpsdconfigs: [ - <httpsdconfig> ... ] ionossdconfigs: [ - <ionossdconfig> ... ] kubernetessdconfigs: [ - <kubernetessdconfig> ... ] lightsailsdconfigs: [ - <lightsailsdconfig> ... ] linodesdconfigs: [ - <linodesdconfig> ... ] marathonsdconfigs: [ - <marathonsdconfig> ... ] nervesdconfigs: [ - <nervesdconfig> ... ] nomadsdconfigs: [ - <nomadsdconfig> ... ] openstacksdconfigs: [ - <openstacksdconfig> ... ] ovhcloudsdconfigs: [ - <ovhcloudsdconfig> ... ] puppetdbsdconfigs: [ - <puppetdbsdconfig> ... ] scalewaysdconfigs: [ - <scalewaysdconfig> ... ] serversetsdconfigs: [ - <serversetsdconfig> ... ] tritonsdconfigs: [ - <tritonsdconfig> ... ] uyunisdconfigs: [ - <uyunisdconfig> ... ] vultrsdconfigs: [ - <vultrsdconfig> ... ] static_configs: [ - <static_config> ... ] relabel_configs: [ - <relabel_config>

] alertrelabelconfigs: [ - <relabel_config> ... ] ``` `writerelabelconfigs` is relabeling applied to samples before sending them to the remote endpoint. Write relabeling is applied after external labels. This could be used to limit which samples are sent. There is a of how to use this functionality. ```yaml url: <string> [ remote_timeout: <duration> | default = 30s ] headers: [ <string>: <string> ... ] writerelabelconfigs: [ - <relabel_config> ... ] [ name: <string> ] [ send_exemplars: <boolean> | default = false ] [ sendnativehistograms: <boolean> | default = false ] basic_auth: [ username: <string> ] [ password: <secret> ] [ password_file: <string> ] authorization: [ type: <string> | default: Bearer ] [ credentials: <secret> ] [ credentials_file: <filename> ] sigv4: [ region: <string> ] [ access_key: <string> ] [ secret_key: <secret> ] [ profile: <string> ] [ role_arn: <string> ] oauth2: [ <oauth2> ] azuread: [ cloud: <string> | default = AzurePublic ] [ managed_identity: [ client_id: <string> ] ] [ oauth: [ client_id: <string> ] [ client_secret: <string> ] [ tenant_id: <string> ] ] [ sdk: [ tenant_id: <string> ] ] tls_config: [ <tls_config> ] [ proxy_url: <string> ] [ no_proxy: <string> ] [ proxyfromenvironment: <boolean> | default: false ] [ proxyconnectheader: [ <string>: [<secret>, ...] ] ] [ follow_redirects: <boolean> | default = true ] [ enable_http2: <boolean> | default: true ] queue_config: [ capacity: <int> | default = 10000 ] [ max_shards: <int> | default = 50 ] [ min_shards: <int> | default = 1 ] [ maxsamplesper_send: <int> | default = 2000] [ batchsenddeadline: <duration> | default = 5s ] [ min_backoff: <duration> | default = 30ms ] [ max_backoff: <duration> | default = 5s ] [ retryonhttp_429: <boolean> | default = false ] [ sampleagelimit: <duration> | default = 0s ] metadata_config: [ send: <boolean> | default = true ] [ send_interval: <duration> | default = 1m ] [ maxsamplesper_send: <int> | default = 500] ``` There is a list of with this feature. ```yaml url: <string> [ name: <string> ] required_matchers: [ <labelname>: <labelvalue> ... ] [ remote_timeout: <duration> | default = 1m ] headers: [ <string>: <string> ... ] [ read_recent: <boolean> | default = false ] basic_auth: [ username: <string> ] [ password: <secret> ] [ password_file: <string> ] authorization: [ type: <string> | default: Bearer ] [ credentials: <secret> ] [ credentials_file: <filename> ] oauth2: [ <oauth2> ] tls_config: [ <tls_config> ] [ proxy_url: <string> ] [ no_proxy: <string> ] [ proxyfromenvironment: <boolean> | default: false ] [ proxyconnectheader: [ <string>: [<secret>, ...] ] ] [ follow_redirects: <boolean> | default = true ] [ enable_http2: <boolean> | default: true ] [ filterexternallabels: <boolean> | default = true ] ``` There is a list of with this feature. `tsdb` lets you configure the runtime-reloadable configuration settings of the TSDB. NOTE: Out-of-order ingestion is an experimental feature, but you do not need any additional flag to enable it. Setting `outofordertimewindow` to a positive duration enables it. ```yaml [ outofordertimewindow: <duration> | default = 0s ] ``` Note that exemplar storage is still considered experimental and must be enabled via `--enable-feature=exemplar-storage`. ```yaml [ max_exemplars: <int> | default = 100000 ] ``` `tracing_config` configures exporting traces from Prometheus to a tracing backend via the OTLP protocol. Tracing is currently an experimental feature and could change in the future. ```yaml [ client_type: <string> | default = grpc ] [ endpoint: <string> ] [ sampling_fraction: <float> | default = 0 ] [ insecure: <boolean> | default = false ] headers: [ <string>: <string> ... ] [ compression: <string> ] [ timeout: <duration> | default = 10s ]