prometheus
324 строки · 9.9 Кб
1import { ScrapePools, Target } from '../target';2
3export const targetGroups: ScrapePools = Object.freeze({4blackbox: {5upCount: 2,6targets: [7{8discoveredLabels: {9__address__: 'http://prometheus.io',10__metrics_path__: '/probe',11__param_module: 'http_2xx',12__scheme__: 'http',13job: 'blackbox',14},15labels: {16instance: 'http://prometheus.io',17job: 'blackbox',18},19scrapePool: 'blackbox',20scrapeUrl: 'http://127.0.0.1:9115/probe?module=http_2xx&target=http%3A%2F%2Fprometheus.io',21globalUrl: 'http://localhost.localdomain:9115/probe?module=http_2xx&target=http%3A%2F%2Fprometheus.io',22lastError: '',23lastScrape: '2019-11-04T11:52:14.759299-07:00',24lastScrapeDuration: 36560147,25health: 'up',26scrapeInterval: '15s',27scrapeTimeout: '500ms',28},29{30discoveredLabels: {31__address__: 'https://prometheus.io',32__metrics_path__: '/probe',33__param_module: 'http_2xx',34__scheme__: 'http',35job: 'blackbox',36},37labels: {38instance: 'https://prometheus.io',39job: 'blackbox',40},41scrapePool: 'blackbox',42scrapeUrl: 'http://127.0.0.1:9115/probe?module=http_2xx&target=https%3A%2F%2Fprometheus.io',43globalUrl: 'http://localhost.localdomain:9115/probe?module=http_2xx&target=https%3A%2F%2Fprometheus.io',44lastError: '',45lastScrape: '2019-11-04T11:52:24.731096-07:00',46lastScrapeDuration: 49448763,47health: 'up',48scrapeInterval: '15s',49scrapeTimeout: '500ms',50},51{52discoveredLabels: {53__address__: 'http://example.com:8080',54__metrics_path__: '/probe',55__param_module: 'http_2xx',56__scheme__: 'http',57job: 'blackbox',58},59labels: {60instance: 'http://example.com:8080',61job: 'blackbox',62},63scrapePool: 'blackbox',64scrapeUrl: 'http://127.0.0.1:9115/probe?module=http_2xx&target=http%3A%2F%2Fexample.com%3A8080',65globalUrl: 'http://localhost.localdomain:9115/probe?module=http_2xx&target=http%3A%2F%2Fexample.com%3A8080',66lastError: '',67lastScrape: '2019-11-04T11:52:13.516654-07:00',68lastScrapeDuration: 120916592,69health: 'down',70scrapeInterval: '15s',71scrapeTimeout: '500ms',72},73] as Target[],74},75node_exporter: {76upCount: 1,77targets: [78{79discoveredLabels: {80__address__: 'localhost:9100',81__metrics_path__: '/metrics',82__scheme__: 'http',83job: 'node_exporter',84},85labels: {86instance: 'localhost:9100',87job: 'node_exporter',88},89scrapePool: 'node_exporter',90scrapeUrl: 'http://localhost:9100/metrics',91globalUrl: 'http://localhost.localdomain:9100/metrics',92lastError: '',93lastScrape: '2019-11-04T11:52:14.145703-07:00',94lastScrapeDuration: 3842307,95health: 'up',96scrapeInterval: '15s',97scrapeTimeout: '500ms',98},99] as Target[],100},101prometheus: {102upCount: 1,103targets: [104{105discoveredLabels: {106__address__: 'localhost:9090',107__metrics_path__: '/metrics',108__scheme__: 'http',109job: 'prometheus',110},111labels: {112instance: 'localhost:9090',113job: 'prometheus',114},115scrapePool: 'prometheus',116scrapeUrl: 'http://localhost:9090/metrics',117globalUrl: 'http://localhost.localdomain:9000/metrics',118lastError: '',119lastScrape: '2019-11-04T11:52:18.479731-07:00',120lastScrapeDuration: 4050976,121health: 'up',122scrapeInterval: '15s',123scrapeTimeout: '500ms',124},125] as Target[],126},127});128
129export const sampleApiResponse = Object.freeze({130status: 'success',131data: {132activeTargets: [133{134discoveredLabels: {135__address__: 'http://prometheus.io',136__metrics_path__: '/probe',137__param_module: 'http_2xx',138__scheme__: 'http',139job: 'blackbox',140},141labels: {142instance: 'http://prometheus.io',143job: 'blackbox',144},145scrapePool: 'blackbox',146scrapeUrl: 'http://127.0.0.1:9115/probe?module=http_2xx&target=http%3A%2F%2Fprometheus.io',147lastError: '',148lastScrape: '2019-11-04T11:52:14.759299-07:00',149lastScrapeDuration: 36560147,150health: 'up',151globalUrl: 'http://localhost.localdomain:9000/metrics',152scrapeInterval: '15s',153scrapeTimeout: '500ms',154},155{156discoveredLabels: {157__address__: 'https://prometheus.io',158__metrics_path__: '/probe',159__param_module: 'http_2xx',160__scheme__: 'http',161job: 'blackbox',162},163labels: {164instance: 'https://prometheus.io',165job: 'blackbox',166},167scrapePool: 'blackbox',168scrapeUrl: 'http://127.0.0.1:9115/probe?module=http_2xx&target=https%3A%2F%2Fprometheus.io',169lastError: '',170lastScrape: '2019-11-04T11:52:24.731096-07:00',171lastScrapeDuration: 49448763,172health: 'up',173globalUrl: 'http://localhost.localdomain:9000/metrics',174scrapeInterval: '15s',175scrapeTimeout: '500ms',176},177{178discoveredLabels: {179__address__: 'http://example.com:8080',180__metrics_path__: '/probe',181__param_module: 'http_2xx',182__scheme__: 'http',183job: 'blackbox',184},185labels: {186instance: 'http://example.com:8080',187job: 'blackbox',188},189scrapePool: 'blackbox',190scrapeUrl: 'http://127.0.0.1:9115/probe?module=http_2xx&target=http%3A%2F%2Fexample.com%3A8080',191lastError: '',192lastScrape: '2019-11-04T11:52:13.516654-07:00',193lastScrapeDuration: 120916592,194health: 'up',195globalUrl: 'http://localhost.localdomain:9000/metrics',196scrapeInterval: '15s',197scrapeTimeout: '500ms',198},199{200discoveredLabels: {201__address__: 'localhost:9100',202__metrics_path__: '/metrics',203__scheme__: 'http',204job: 'node_exporter',205},206labels: {207instance: 'localhost:9100',208job: 'node_exporter',209},210scrapePool: 'node_exporter',211scrapeUrl: 'http://localhost:9100/metrics',212lastError: '',213lastScrape: '2019-11-04T11:52:14.145703-07:00',214lastScrapeDuration: 3842307,215health: 'up',216globalUrl: 'http://localhost.localdomain:9000/metrics',217scrapeInterval: '15s',218scrapeTimeout: '500ms',219},220{221discoveredLabels: {222__address__: 'localhost:9090',223__metrics_path__: '/metrics',224__scheme__: 'http',225job: 'prometheus/test',226},227labels: {228instance: 'localhost:9090',229job: 'prometheus/test',230},231scrapePool: 'prometheus/test',232scrapeUrl: 'http://localhost:9090/metrics',233lastError: '',234lastScrape: '2019-11-04T11:52:18.479731-07:00',235lastScrapeDuration: 4050976,236health: 'up',237globalUrl: 'http://localhost.localdomain:9000/metrics',238scrapeInterval: '15s',239scrapeTimeout: '500ms',240},241] as Target[],242},243});244
245export const scrapePoolTargetsSampleAPI = Object.freeze({246status: 'success',247data: {248targets: [249{250discoveredLabels: {251__address__: 'http://prometheus.io',252__metrics_path__: '/probe',253__param_module: 'http_2xx',254__scheme__: 'http',255job: 'blackbox',256},257labels: {258instance: 'http://prometheus.io',259job: 'blackbox',260},261scrapePool: 'blackbox',262scrapeUrl: 'http://127.0.0.1:9115/probe?module=http_2xx&target=http%3A%2F%2Fprometheus.io',263lastError: '',264lastScrape: '2019-11-04T11:52:14.759299-07:00',265lastScrapeDuration: 36560147,266health: 'up',267globalUrl: 'http://localhost.localdomain:9000/metrics',268scrapeInterval: '15s',269scrapeTimeout: '500ms',270},271{272discoveredLabels: {273__address__: 'https://prometheus.io',274__metrics_path__: '/probe',275__param_module: 'http_2xx',276__scheme__: 'http',277job: 'blackbox',278},279labels: {280instance: 'https://prometheus.io',281job: 'blackbox',282},283scrapePool: 'blackbox',284scrapeUrl: 'http://127.0.0.1:9115/probe?module=http_2xx&target=https%3A%2F%2Fprometheus.io',285lastError: '',286lastScrape: '2019-11-04T11:52:24.731096-07:00',287lastScrapeDuration: 49448763,288health: 'up',289globalUrl: 'http://localhost.localdomain:9000/metrics',290scrapeInterval: '15s',291scrapeTimeout: '500ms',292},293{294discoveredLabels: {295__address__: 'http://example.com:8080',296__metrics_path__: '/probe',297__param_module: 'http_2xx',298__scheme__: 'http',299job: 'blackbox',300},301labels: {302instance: 'http://example.com:8080',303job: 'blackbox',304},305scrapePool: 'blackbox',306scrapeUrl: 'http://127.0.0.1:9115/probe?module=http_2xx&target=http%3A%2F%2Fexample.com%3A8080',307lastError: '',308lastScrape: '2019-11-04T11:52:13.516654-07:00',309lastScrapeDuration: 120916592,310health: 'up',311globalUrl: 'http://localhost.localdomain:9000/metrics',312scrapeInterval: '15s',313scrapeTimeout: '500ms',314},315] as Target[],316},317});318
319export const scrapePoolsSampleAPI = Object.freeze({320status: 'success',321data: {322scrapePools: ['blackbox'],323},324});325