github.com/thanos-io/thanos@v0.32.5/pkg/ui/react-app/src/pages/targets/__testdata__/testdata.ts (about)

     1  /* eslint-disable camelcase */
     2  
     3  import { ScrapePools } from '../target';
     4  
     5  export const targetGroups: ScrapePools = Object.freeze({
     6    blackbox: {
     7      upCount: 2,
     8      targets: [
     9        {
    10          discoveredLabels: {
    11            __address__: 'http://prometheus.io',
    12            __metrics_path__: '/probe',
    13            __param_module: 'http_2xx',
    14            __scheme__: 'http',
    15            job: 'blackbox',
    16          },
    17          labels: {
    18            instance: 'http://prometheus.io',
    19            job: 'blackbox',
    20          },
    21          scrapePool: 'blackbox',
    22          scrapeUrl: 'http://127.0.0.1:9115/probe?module=http_2xx&target=http%3A%2F%2Fprometheus.io',
    23          globalUrl: 'http://localhost.localdomain:9115/probe?module=http_2xx&target=http%3A%2F%2Fprometheus.io',
    24          lastError: '',
    25          lastScrape: '2019-11-04T11:52:14.759299-07:00',
    26          lastScrapeDuration: 36560147,
    27          health: 'up',
    28        },
    29        {
    30          discoveredLabels: {
    31            __address__: 'https://prometheus.io',
    32            __metrics_path__: '/probe',
    33            __param_module: 'http_2xx',
    34            __scheme__: 'http',
    35            job: 'blackbox',
    36          },
    37          labels: {
    38            instance: 'https://prometheus.io',
    39            job: 'blackbox',
    40          },
    41          scrapePool: 'blackbox',
    42          scrapeUrl: 'http://127.0.0.1:9115/probe?module=http_2xx&target=https%3A%2F%2Fprometheus.io',
    43          globalUrl: 'http://localhost.localdomain:9115/probe?module=http_2xx&target=https%3A%2F%2Fprometheus.io',
    44          lastError: '',
    45          lastScrape: '2019-11-04T11:52:24.731096-07:00',
    46          lastScrapeDuration: 49448763,
    47          health: 'up',
    48        },
    49        {
    50          discoveredLabels: {
    51            __address__: 'http://example.com:8080',
    52            __metrics_path__: '/probe',
    53            __param_module: 'http_2xx',
    54            __scheme__: 'http',
    55            job: 'blackbox',
    56          },
    57          labels: {
    58            instance: 'http://example.com:8080',
    59            job: 'blackbox',
    60          },
    61          scrapePool: 'blackbox',
    62          scrapeUrl: 'http://127.0.0.1:9115/probe?module=http_2xx&target=http%3A%2F%2Fexample.com%3A8080',
    63          globalUrl: 'http://localhost.localdomain:9115/probe?module=http_2xx&target=http%3A%2F%2Fexample.com%3A8080',
    64          lastError: '',
    65          lastScrape: '2019-11-04T11:52:13.516654-07:00',
    66          lastScrapeDuration: 120916592,
    67          health: 'down',
    68        },
    69      ],
    70    },
    71    node_exporter: {
    72      upCount: 1,
    73      targets: [
    74        {
    75          discoveredLabels: {
    76            __address__: 'localhost:9100',
    77            __metrics_path__: '/metrics',
    78            __scheme__: 'http',
    79            job: 'node_exporter',
    80          },
    81          labels: {
    82            instance: 'localhost:9100',
    83            job: 'node_exporter',
    84          },
    85          scrapePool: 'node_exporter',
    86          scrapeUrl: 'http://localhost:9100/metrics',
    87          globalUrl: 'http://localhost.localdomain:9100/metrics',
    88          lastError: '',
    89          lastScrape: '2019-11-04T11:52:14.145703-07:00',
    90          lastScrapeDuration: 3842307,
    91          health: 'up',
    92        },
    93      ],
    94    },
    95    prometheus: {
    96      upCount: 1,
    97      targets: [
    98        {
    99          discoveredLabels: {
   100            __address__: 'localhost:9090',
   101            __metrics_path__: '/metrics',
   102            __scheme__: 'http',
   103            job: 'prometheus',
   104          },
   105          labels: {
   106            instance: 'localhost:9090',
   107            job: 'prometheus',
   108          },
   109          scrapePool: 'prometheus',
   110          scrapeUrl: 'http://localhost:9090/metrics',
   111          globalUrl: 'http://localhost.localdomain:9000/metrics',
   112          lastError: '',
   113          lastScrape: '2019-11-04T11:52:18.479731-07:00',
   114          lastScrapeDuration: 4050976,
   115          health: 'up',
   116        },
   117      ],
   118    },
   119  });
   120  
   121  export const sampleApiResponse = Object.freeze({
   122    status: 'success',
   123    data: {
   124      activeTargets: [
   125        {
   126          discoveredLabels: {
   127            __address__: 'http://prometheus.io',
   128            __metrics_path__: '/probe',
   129            __param_module: 'http_2xx',
   130            __scheme__: 'http',
   131            job: 'blackbox',
   132          },
   133          labels: {
   134            instance: 'http://prometheus.io',
   135            job: 'blackbox',
   136          },
   137          scrapePool: 'blackbox',
   138          scrapeUrl: 'http://127.0.0.1:9115/probe?module=http_2xx&target=http%3A%2F%2Fprometheus.io',
   139          lastError: '',
   140          lastScrape: '2019-11-04T11:52:14.759299-07:00',
   141          lastScrapeDuration: 36560147,
   142          health: 'up',
   143        },
   144        {
   145          discoveredLabels: {
   146            __address__: 'https://prometheus.io',
   147            __metrics_path__: '/probe',
   148            __param_module: 'http_2xx',
   149            __scheme__: 'http',
   150            job: 'blackbox',
   151          },
   152          labels: {
   153            instance: 'https://prometheus.io',
   154            job: 'blackbox',
   155          },
   156          scrapePool: 'blackbox',
   157          scrapeUrl: 'http://127.0.0.1:9115/probe?module=http_2xx&target=https%3A%2F%2Fprometheus.io',
   158          lastError: '',
   159          lastScrape: '2019-11-04T11:52:24.731096-07:00',
   160          lastScrapeDuration: 49448763,
   161          health: 'up',
   162        },
   163        {
   164          discoveredLabels: {
   165            __address__: 'http://example.com:8080',
   166            __metrics_path__: '/probe',
   167            __param_module: 'http_2xx',
   168            __scheme__: 'http',
   169            job: 'blackbox',
   170          },
   171          labels: {
   172            instance: 'http://example.com:8080',
   173            job: 'blackbox',
   174          },
   175          scrapePool: 'blackbox',
   176          scrapeUrl: 'http://127.0.0.1:9115/probe?module=http_2xx&target=http%3A%2F%2Fexample.com%3A8080',
   177          lastError: '',
   178          lastScrape: '2019-11-04T11:52:13.516654-07:00',
   179          lastScrapeDuration: 120916592,
   180          health: 'up',
   181        },
   182        {
   183          discoveredLabels: {
   184            __address__: 'localhost:9100',
   185            __metrics_path__: '/metrics',
   186            __scheme__: 'http',
   187            job: 'node_exporter',
   188          },
   189          labels: {
   190            instance: 'localhost:9100',
   191            job: 'node_exporter',
   192          },
   193          scrapePool: 'node_exporter',
   194          scrapeUrl: 'http://localhost:9100/metrics',
   195          lastError: '',
   196          lastScrape: '2019-11-04T11:52:14.145703-07:00',
   197          lastScrapeDuration: 3842307,
   198          health: 'up',
   199        },
   200        {
   201          discoveredLabels: {
   202            __address__: 'localhost:9090',
   203            __metrics_path__: '/metrics',
   204            __scheme__: 'http',
   205            job: 'prometheus/test',
   206          },
   207          labels: {
   208            instance: 'localhost:9090',
   209            job: 'prometheus/test',
   210          },
   211          scrapePool: 'prometheus/test',
   212          scrapeUrl: 'http://localhost:9090/metrics',
   213          lastError: '',
   214          lastScrape: '2019-11-04T11:52:18.479731-07:00',
   215          lastScrapeDuration: 4050976,
   216          health: 'up',
   217        },
   218      ],
   219    },
   220  });