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 #16455 to 7.x: [Metricbeat] Update Couchdb to v2 #17078

Merged
merged 2 commits into from
Mar 18, 2020

Conversation

sayden
Copy link
Contributor

@sayden sayden commented Mar 18, 2020

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

What does this PR do?

Updates module to use a Strategy patern and decide between v1 and v2 Couchdb parsing. To do so, it has to do a pre HTTP request to root path / to know which version is deployed on each fetch (done in fetch to allow hot upgrades in container environment).

I have removed testdata tests because one of them was a bit unnecessary with our current testdata implementation (a timeout test which was testing testdata framework more than the module itself). The other testdata doesn't work anymore because more than one request is necessary now to check version.

Because we can only test in CI with a single version, I maintained current Dockerfile

Why is it important?

ATM, we were only parsing v1 metrics and v3 is going to be released soon. This PR introduces v2 parsing maintaining compatibility with our previous version.

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

How to test this PR locally

  • Launch v1 and v2 containers
docker run -d --name couchdb16 -p 15984:5984 couchdb:1.6
docker run -d --name couchdb23 -p 25984:5984 -p 25986:5986 couchdb:2.3
  • Setup Metricbeat Couchdb module to point to both servers ./metricbeat modules enable couchdb and leave config similar to this:
- module: couchdb
  metricsets: ["server"]
  period: 10s
  hosts: ["localhost:15984", "localhost:25984/_node/_local/_stats", "localhost:25984/_node/nonode@nohost/_stats", "localhost:25986"]
  • Check that events from v1 and v2 are being received in, for example, Kibana. You can see version in field service.version and the service.id must be the same for all paths of v2.
  • Extra mile, check dashboards, they must maintain compatibility and show info of both servers.

Related issues

Screenshots

I checked that dashboard still works.

image

@sayden sayden added the Team:Services (Deprecated) Label for the former Integrations-Services team label Mar 18, 2020
@elasticmachine
Copy link
Collaborator

Pinging @elastic/integrations-services (Team:Services)

@sayden sayden merged commit 965a80e into elastic:7.x Mar 18, 2020
@sayden sayden deleted the backport_16455_7.x branch October 29, 2021 08:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport review Team:Services (Deprecated) Label for the former Integrations-Services team
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants