Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Merged
merged 3 commits into from
Feb 11, 2020

Conversation

mtojek
Copy link
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 jsoriano and a team 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