Передача показателей httpenpoinds с использованием http module-metricbeat - PullRequest
0 голосов
/ 20 сентября 2018

Чтобы отправить конечные точки метрик (/ metric) моего приложения с весенней загрузкой, я использовал модуль http в metricbeat, я следую официальному документу на веб-сайтеastic.io для установки и настройки metricbeat, но, напротив,передача метрик была неправильной, хотя соединение было установлено..I изменил файл fields.yml, чтобы создать специальный шаблон только для модуля http

fields.yml

- key: http
  title: "HTTP"
  description: >
    HTTP module
  release: beta
  settings: ["ssl"]
  fields:
    - name: http
      type: group
      description: >
      fields:
        - name: request
          type: group
          description: >
              HTTP request information
          fields:
            - name: header
              type: object
              description: >
                The HTTP headers sent
            - name: method
              type: keyword
              description: >
                The HTTP method used
            - name: body
              type: keyword
              description: >
                The HTTP payload sent
        - name: response
          type: group
          description: >
              HTTP response information
          fields:
            - name: header
              type: object
              description: >
                The HTTP headers received
            - name: code
              type: keyword
              description: >
                The HTTP status code
              example: 404
            - name: phrase
              type: keyword
              example: Not found
              description: >
                The HTTP status phrase
            - name: body
              type: keyword
              description: >
                The HTTP payload received
        - name: json
          type: group
          description: >
            json metricset
          release: beta
          fields:

        - name: server
          type: group
          description: >
            server
          release: experimental
          fields:

metricbeat.yml

    metricbeat.config.modules:
      # Glob pattern for configuration loading
      path: ${path.config}/modules.d/*.yml
      # Set to true to enable config reloading
      reload.enabled: false
metricbeat.modules:

    #------------------------------- HTTP Module -------------------------------
    - module: http
      metricsets: ["json"]
      period: 10s
      hosts: ["http://localhost:8080/metrics"]
      namespace: "test_metrics"
      method: "GET" 
      enabled: true
      setup.template.overwrite: true
      output.elasticsearch:
         hosts: ["localhost:9200"]

Отображение метрик моего приложения: (http://localhost:8080/metrics)

    {
  "mem": 199405,
  "mem.free": 74297,
  "processors": 4,
  "instance.uptime": 45240231,
  "uptime": 45254636,
  "systemload.average": -1,
  "heap.committed": 154624,
  "heap.init": 131072,
  "heap.used": 80326,
  "heap": 1842688,
  "nonheap.committed": 45888,
  "nonheap.init": 2496,
  "nonheap.used": 44781,
  "nonheap": 0,
  "threads.peak": 31,
  "threads.daemon": 25,
  "threads.totalStarted": 35,
  "threads": 27,
  "classes": 6659,
  "classes.loaded": 6659,
  "classes.unloaded": 0,
  "gc.ps_scavenge.count": 24,
  "gc.ps_scavenge.time": 999,
  "gc.ps_marksweep.count": 1,
  "gc.ps_marksweep.time": 71,
  "httpsessions.max": -1,
  "httpsessions.active": 0,
  "gauge.response.metrics": 20,
  "gauge.response.unmapped": 6005,
  "gauge.response.login": 1,
  "gauge.response.star-star.favicon.ico": 1878,
  "counter.status.200.star-star.favicon.ico": 1,
  "counter.status.200.metrics": 30,
  "counter.status.302.unmapped": 3,
  "counter.status.200.login": 2
}

Раньше я использовал httpbeat и все было отлично, названия полей в индексе эластичного поиска совместимы ..., так как яперешел на использование модуля http все было изменено, я использую его, чтобы получить предопределенные панели мониторинга в kibana.

Любая помощь, пожалуйста?

...