msg = "ошибка добавления" err = "\" INVALID \ "не является допустимым маркером запуска" - PullRequest
0 голосов
/ 26 сентября 2019

как отправить метрики API в pushgateway или node_exporter?

Я поместил следующее содержимое в файл prometheus.yml:

global:
scrape_interval: 1s # Set the scrape interval to every 15 seconds. Default is every 1 minute.

scrape_configs:

- job_name: 'prometheus'
static_configs:
- targets: ['localhost:9090']

- job_name: 'pushgateway'
static_configs:
- targets: ['localhost:9091']

- job_name: 'api-server'
metrics_path: /nifi-api/system-diagnostics
static_configs:
- targets: ['localhost:19090']

Но я получаю следующую ошибку:

level = warn ts = 2019-09-26T12: 15: 20.732Z caller = scrape.go: 930 component = "scrape manager" scrape_pool = цель api-сервера = http://localhost:19090/nifi-api/system-diagnostics msg = "ошибка добавления: "err =" \ "INVALID \" не является допустимым маркером запуска "

Мой API-интерфейс такой http://localhost:19090/nifi-api/system-diagnostics

{
   "systemDiagnostics":{
      "aggregateSnapshot":{
         "totalNonHeap":"158.5 MB",
         "totalNonHeapBytes":166199296,
         "usedNonHeap":"147.66 MB",
         "usedNonHeapBytes":154831352,
         "freeNonHeap":"10.84 MB",
         "freeNonHeapBytes":11367944,
         "maxNonHeap":"-1 bytes",
         "maxNonHeapBytes":-1,
         "totalHeap":"512 MB",
         "totalHeapBytes":536870912,
         "usedHeap":"238 MB",
         "usedHeapBytes":249561088,
         "freeHeap":"274 MB",
         "freeHeapBytes":287309824,
         "maxHeap":"512 MB",
         "maxHeapBytes":536870912,
         "heapUtilization":"46.0%",
         "availableProcessors":4,
         "processorLoadAverage":0.01,
         "totalThreads":69,
         "daemonThreads":30,
         "uptime":"00:40:57.197",
         "flowFileRepositoryStorageUsage":{
            "freeSpace":"36.08 GB",
            "totalSpace":"42.22 GB",
            "usedSpace":"6.14 GB",
            "freeSpaceBytes":38741389312,
            "totalSpaceBytes":45335056384,
            "usedSpaceBytes":6593667072,
            "utilization":"15.0%"
         },
         "contentRepositoryStorageUsage":[
            {
               "identifier":"default",
               "freeSpace":"36.08 GB",
               "totalSpace":"42.22 GB",
               "usedSpace":"6.14 GB",
               "freeSpaceBytes":38741389312,
               "totalSpaceBytes":45335056384,
               "usedSpaceBytes":6593667072,
               "utilization":"15.0%"
            }
         ],
         "provenanceRepositoryStorageUsage":[
            {
               "identifier":"default",
               "freeSpace":"36.08 GB",
               "totalSpace":"42.22 GB",
               "usedSpace":"6.14 GB",
               "freeSpaceBytes":38741389312,
               "totalSpaceBytes":45335056384,
               "usedSpaceBytes":6593667072,
               "utilization":"15.0%"
            }
         ],
         "garbageCollection":[
            {
               "name":"G1 Young Generation",
               "collectionCount":32,
               "collectionTime":"00:00:00.974",
               "collectionMillis":974
            },
            {
               "name":"G1 Old Generation",
               "collectionCount":0,
               "collectionTime":"00:00:00.000",
               "collectionMillis":0
            }
         ],
         "statsLastRefreshed":"17:52:11 IST",
         "versionInfo":{
            "niFiVersion":"1.9.0.1.0.0.0-90",
            "javaVendor":"Oracle Corporation",
            "javaVersion":"1.8.0_131",
            "osName":"Linux",
            "osVersion":"3.10.0-1062.1.2.el7.x86_64",
            "osArchitecture":"amd64",
            "buildTag":"nifi-1.9.0-RC2",
            "buildRevision":"af31e41",
            "buildBranch":"UNKNOWN",
            "buildTimestamp":"03/29/2019 16:40:44 IST"
         }
      }
   }
}

Я хочу предоставить метрики APIк прометею.

Может кто-нибудь помочь мне найти это решение?

...