Skip to content

Cherry-pick #16205 to 7.x: Fix: don't miss address scheme#16241

Merged
mtojek merged 3 commits intoelastic:7.xfrom
mtojek:backport_16205_7.x
Feb 11, 2020
Merged

Cherry-pick #16205 to 7.x: Fix: don't miss address scheme#16241
mtojek merged 3 commits intoelastic:7.xfrom
mtojek:backport_16205_7.x

Conversation

@mtojek
Copy link
Copy Markdown
Contributor

@mtojek mtojek commented Feb 11, 2020

Cherry-pick of PR #16205 to 7.x branch. Original message:

While working on the Ceph module (#7723) I've prepared the following setup for a new metric set:

modules.d/ceph.yml:

- module: ceph
  metricsets:
    - mgr_cluster_health
  hosts: [ "https://ceph-restful:8003" ]
  username: "demo"
  password: "51dd94b3-f865-4f63-af79-9efb9130cd7f"
  ssl.verification_mode: "none"

module/ceph/mgr_cluster_health:

default: true
input:
  module: http
  metricset: json
  defaults:
    method: POST
    namespace: "json_namespace"
    basepath: "/request"
    headers:
      Content-Type: application/json
    query:
      wait: "1"
    body: '{"prefix": "status", "format": "json"}'

processors:
  - extract_array:
      field: http.json_namespace.finished
      mappings:
        ceph.request: 0
  - decode_json_fields:
      fields: ["ceph.request.outb"]
      process_array: true
      target: "ceph.mgr_cluster_status.output"
  - drop_fields:
      fields: ["http", "ceph.request"]

The problem: Ceph's request API is accessible via HTTPS (by default) and the information about protocol scheme (https://) is getting lost in runtime.

* Fix: don't miss address scheme

* Add unit test

* Adjust source after code review

* Add comment to method

(cherry picked from commit 9c2064a)
@mtojek mtojek requested review from a team and jsoriano February 11, 2020 16:15
@mtojek mtojek self-assigned this Feb 11, 2020
@mtojek mtojek merged commit f6822f1 into elastic:7.x Feb 11, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants