title: msg="append failed" err="\"INVALID\" is not a valid start token"
body: <p>how to push api metrics to the pushgateway or node_exporter?</p>
  
  <p>I have placed following content in prometheus.yml file:</p>
  
  <pre><code>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']
  </code></pre>
  
  <p>But I am getting following error:</p>
  
  <blockquote>
    <p>level=warn ts=2019-09-26T12:15:20.732Z caller=scrape.go:930 component="scrape manager" scrape_pool=api-server target=<a href="http://localhost:19090/nifi-api/system-diagnostics" rel="nofollow noreferrer">http://localhost:19090/nifi-api/system-diagnostics</a> msg="append failed" err="\"INVALID\" is not a valid start token"</p>
  </blockquote>
  
  <p>My api is like this <a href="http://localhost:19090/nifi-api/system-diagnostics" rel="nofollow noreferrer">http://localhost:19090/nifi-api/system-diagnostics</a></p>
  
  <pre><code>{
     "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"
           }
        }
     }
  }
  </code></pre>
  
  <p>I want to expose api metrics to the prometheus. </p>
  
  <p>Can anyone help me to find this solution?</p>