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 #15997 to 7.6: Correctly format the path to read data from npipe. #16062

Merged
merged 1 commit into from
Feb 4, 2020

Conversation

ph
Copy link
Contributor

@ph ph commented Feb 4, 2020

Cherry-pick of PR #15997 to 7.6 branch. Original message:

What does this PR do?

This is not a fix for #15832 this will be tackle in another PR.

When http+npipe:// scheme was initially parsed by the url parser of
metric the generated PATH wasn't correctly setup up this mean that Metricbeat was not able to collect metrics over a npipe. So I've fixed the parsing and the tests.

Why is it important?

Fix an issue to read metric over a named pipe

Checklist

  • My code follows the style guidelines of this project
    - [ ] I have commented my code, particularly in hard-to-understand areas
    - [ ] I have made corresponding changes to the documentation
    - [ ] I have made corresponding change to the default configuration files
  • I have added tests that prove my fix is effective or that my feature works

Author's Checklist

  • This need to be tested under Windows.

How to test this PR locally

Now to test the behavior on Windows you will need a beat that expose metrics over
named pipes, you can do so with a configuration like this.

metricbeat.modules:
  - module: system

output.console: ~

http.enabled: true
http.host: \\.\pipe\custom

After you can start a Metricbeat instance with the beat modules to
collect the metric information.

metricbeat.modules:
- module: beat
  hosts: http+npipe://./pipe/custom
  metricsets:
  - stats
  - state
output.console: ~

If you start metricbeat with the -e -d "*" flags this will output any
metrics fetched from the running beat instance.

Related issues

This is not a fix for #15832 this will be tackle in another PR.
When http+npipe:// scheme were initially parsed by the url parser of
metric the generated PATH wasn't correctly setup up. So I've fixed the
parsing and the tests.

Now to test the behavior on Windows you will need a beat that expose metrics over
npipes, you can do so with a configuration like this.

```yaml
metricbeat.modules:
  - module: system

output.console: ~

http.enabled: true
http.host: \\.\pipe\custom
```yaml

After you can start a Metricbeat instance with the beat modules to
collect the metric information.

```yaml
metricbeat.modules:
- module: beat
  hosts: http+npipe://./pipe/custom
  metricsets:
  - stats
  - state
output.console: ~
```

If you start metricbeat with the `-e -d "*"` flags this will output any
metrics fetched from the running beat instance.

Fixes: #15938
(cherry picked from commit 75ddc22)
@ph ph self-assigned this Feb 4, 2020
@ph ph requested a review from urso February 4, 2020 13:26
@ph ph merged commit e1bf1a9 into elastic:7.6 Feb 4, 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