#
# Copyright © 2016-2026 The Thingsboard 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.
#

# my global config
global:
  scrape_interval:     15s # By default, scrape targets every 15 seconds.
  evaluation_interval: 15s # By default, scrape targets every 15 seconds.
  # scrape_timeout is set to the global default (10s).

  # Attach these labels to any time series or alerts when communicating with
  # external systems (federation, remote storage, Alertmanager).
  external_labels:
      monitor: 'thingsboard'


# A scrape configuration containing exactly one endpoint to scrape:
# Here it's Prometheus itself.
scrape_configs:
  # The job name is added as a label `job=<job_name>` to any timeseries scraped from this config.

  - job_name: 'prometheus'
    scrape_interval: 5s
    static_configs:
     - targets: ['localhost:9090']

  - job_name: 'tb-core1'
    metrics_path: /actuator/prometheus
    static_configs:
      - targets: [ 'tb-core1:8080' ]

  - job_name: 'tb-core2'
    metrics_path: /actuator/prometheus
    static_configs:
      - targets: [ 'tb-core2:8080' ]

  - job_name: 'tb-rule-engine1'
    metrics_path: /actuator/prometheus
    static_configs:
      - targets: [ 'tb-rule-engine1:8080' ]

  - job_name: 'tb-rule-engine2'
    metrics_path: /actuator/prometheus
    static_configs:
      - targets: [ 'tb-rule-engine2:8080' ]

  - job_name: 'tb-mqtt-transport1'
    metrics_path: /actuator/prometheus
    static_configs:
      - targets: [ 'tb-mqtt-transport1:8081' ]

  - job_name: 'tb-mqtt-transport2'
    metrics_path: /actuator/prometheus
    static_configs:
      - targets: [ 'tb-mqtt-transport2:8081' ]

  - job_name: 'tb-http-transport1'
    metrics_path: /actuator/prometheus
    static_configs:
      - targets: [ 'tb-http-transport1:8081' ]

  - job_name: 'tb-http-transport2'
    metrics_path: /actuator/prometheus
    static_configs:
      - targets: [ 'tb-http-transport2:8081' ]

  - job_name: 'tb-coap-transport'
    metrics_path: /actuator/prometheus
    static_configs:
      - targets: [ 'tb-coap-transport:8081' ]

  - job_name: 'tb-lwm2m-transport'
    metrics_path: /actuator/prometheus
    static_configs:
      - targets: [ 'tb-lwm2m-transport:8081' ]

  - job_name: 'tb-snmp-transport'
    metrics_path: /actuator/prometheus
    static_configs:
      - targets: [ 'tb-snmp-transport:8081' ]
