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

Added support for couchdb v3. #26950

Open
wants to merge 42 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
42 commits
Select commit Hold shift + click to select a range
50a1b59
Added support for couchdb v3.
StephanU Jul 19, 2021
639a2f1
Added pr id.
StephanU Jul 19, 2021
3c1f9b8
Merge branch 'master' of https://github.com/elastic/beats into elasti…
StephanU Aug 3, 2021
1817b4c
Merge branch 'elastic-master'
StephanU Aug 3, 2021
8d2df59
Merge branch 'master' into master
StephanU Aug 12, 2021
6a9d565
Merge branch 'master' into master
StephanU Sep 6, 2021
602ad1a
Created separate struct for version 3.
StephanU Sep 6, 2021
ddc13a1
Use new V3 struct.
StephanU Sep 6, 2021
527985b
Added support for testing multiple versions of couchdb.
StephanU Sep 7, 2021
8d7a355
Merge branch 'master' into master
StephanU Sep 8, 2021
4562c48
Merge branch 'master' into master
StephanU Sep 29, 2021
f2c3843
Merge branch 'master' into master
StephanU Oct 4, 2021
3830f7f
Merge branch 'master' into master
StephanU Nov 8, 2021
f24f29e
Merge branch 'elastic:master' into master
StephanU Jan 4, 2022
cfc263e
Merge branch 'master' into master
StephanU Jan 11, 2022
457a629
Merge branch 'master' of https://github.com/elastic/beats
StephanU Feb 2, 2022
5b0c837
Merge branch 'main' into master
StephanU Feb 9, 2022
5a15d3c
[DOCS] Removed reference to the Stack GS (#32083)
debadair Jun 23, 2022
a55ae58
[DOCS] Removed reference to the Stack GS (#32119)
debadair Jun 27, 2022
563bd2e
Merge branch 'elastic:master' into master
StephanU Sep 9, 2022
c55087a
Ran 'make update'
StephanU Oct 1, 2022
9278528
Merge branch 'master' of github.com:StephanU/beats
StephanU Oct 1, 2022
2788b6b
Merge remote-tracking branch 'upstream/main'
StephanU Oct 1, 2022
f7b1f9c
Ran 'make fmt'
StephanU Oct 1, 2022
bab3b85
Merge branch 'main' into master
StephanU Nov 8, 2022
ae7c2bc
Merge branch 'main' into master
StephanU Dec 28, 2022
2d85487
Merge branch 'main' into master
StephanU Jan 13, 2023
bc75520
Merge branch 'main' into master
StephanU Mar 7, 2023
47d8956
Merge branch 'main' into master
StephanU Mar 22, 2023
670e761
Merge branch 'main' into master
StephanU Mar 27, 2023
c2f30e7
Merge branch 'main' into master
StephanU May 4, 2023
1fb424e
Merge branch 'main' into master
StephanU Jun 5, 2023
09960e2
Merge branch 'main' into master
StephanU Jun 22, 2023
64d48e4
Merge branch 'main' into master
StephanU Aug 28, 2023
b2288de
Merge branch 'main' into master
StephanU Oct 10, 2023
e32b127
Merge branch 'main' into master
StephanU Oct 18, 2023
11999ee
Merge branch 'main' into master
StephanU Nov 17, 2023
77e2a58
Merge branch 'main' into master
StephanU Feb 7, 2024
2054d10
Merge branch 'main' into master
StephanU Jul 3, 2024
594a345
Merge branch 'main' into master
StephanU Jul 25, 2024
6c8321b
Merge branch 'main' into master
kush-elastic Jul 26, 2024
826d959
Merge branch 'main' into master
StephanU Oct 10, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.next.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ https://github.com/elastic/beats/compare/v8.8.1\...main[Check the HEAD diff]
- Add support of Graphite series 1.1.0+ tagging extension for statsd module. {pull}39619[39619]
- Allow metricsets to report their status via control v2 protocol. {pull}40025[40025]
- Remove fallback to the node limit for the `kubernetes.pod.cpu.usage.limit.pct` and `kubernetes.pod.memory.usage.limit.pct` metrics calculation
- Add support for CouchDB v3 {issue}22743[22743] {pull}26950[26950]
- Add support for Kibana status metricset in v8 format {pull}40275[40275]
- Mark system process metricsets as running if metrics are partially available {pull}40565[40565]
- Added back `elasticsearch.node.stats.jvm.mem.pools.*` to the `node_stats` metricset {pull}40571[40571]
Expand Down
2 changes: 2 additions & 0 deletions metricbeat/docs/modules/couchdb.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,8 @@ metricbeat.modules:
metricsets: ["server"]
period: 10s
hosts: ["localhost:5984"]
username: "admin"
password: "password"
----

This module supports TLS connections when using `ssl` config field, as described in <<configuration-ssl>>.
Expand Down
2 changes: 2 additions & 0 deletions metricbeat/metricbeat.reference.yml
Original file line number Diff line number Diff line change
Expand Up @@ -237,6 +237,8 @@ metricbeat.modules:
metricsets: ["server"]
period: 10s
hosts: ["localhost:5984"]
username: "admin"
password: "password"

#-------------------------------- Docker Module --------------------------------
- module: docker
Expand Down
5 changes: 3 additions & 2 deletions metricbeat/module/couchdb/_meta/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
ARG COUCHDB_VERSION
FROM apache/couchdb:${COUCHDB_VERSION}
COPY ./local.ini /etc/couchdb/local.ini
EXPOSE 5984

HEALTHCHECK --interval=1s --retries=90 CMD curl -f http://localhost:5984/ | grep Welcome

EXPOSE 5984
2 changes: 2 additions & 0 deletions metricbeat/module/couchdb/_meta/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,5 @@
metricsets: ["server"]
period: 10s
hosts: ["localhost:5984"]
username: "admin"
password: "password"
5 changes: 0 additions & 5 deletions metricbeat/module/couchdb/_meta/local.ini

This file was deleted.

4 changes: 4 additions & 0 deletions metricbeat/module/couchdb/_meta/supported-versions.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
variants:
- COUCHDB_VERSION: 1.7
- COUCHDB_VERSION: 2.3
- COUCHDB_VERSION: 3.1
5 changes: 4 additions & 1 deletion metricbeat/module/couchdb/docker-compose.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
version: '2.3'
version: "2.3"

services:
couchdb:
Expand All @@ -7,5 +7,8 @@ services:
context: ./_meta
args:
COUCHDB_VERSION: ${COUCHDB_VERSION:-1.7}
environment:
COUCHDB_USER: admin
COUCHDB_PASSWORD: password
ports:
- 5984
2 changes: 2 additions & 0 deletions metricbeat/module/couchdb/server/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -127,11 +127,13 @@
m.fetcher = &V1{}
case 2:
m.fetcher = &V2{}
case 3:
m.fetcher = &V3{}
default:
m.fetcher = nil
}

return

Check failure on line 136 in metricbeat/module/couchdb/server/server.go

View workflow job for this annotation

GitHub Actions / lint (linux)

naked return in func `retrieveFetcher` with 29 lines of code (nakedret)
}

// CommonInfo defines the data you receive when you make a GET request to the root path of a Couchdb server
Expand All @@ -155,7 +157,7 @@
return nil, fmt.Errorf("error using host parser: %w", err)
}

res, err := c.Get(hostdata.URI)

Check failure on line 160 in metricbeat/module/couchdb/server/server.go

View workflow job for this annotation

GitHub Actions / lint (linux)

(*net/http.Client).Get must not be called (noctx)
if err != nil {
return nil, fmt.Errorf("error trying to do GET request to couchdb: %w", err)
}
Expand Down
22 changes: 22 additions & 0 deletions metricbeat/module/couchdb/server/v3.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
// Licensed to Elasticsearch B.V. under one or more contributor
// license agreements. See the NOTICE file distributed with
// this work for additional information regarding copyright
// ownership. Elasticsearch B.V. licenses this file to you under
// the Apache License, Version 2.0 (the "License"); you may
// not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing,
// software distributed under the License is distributed on an
// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
// KIND, either express or implied. See the License for the
// specific language governing permissions and limitations
// under the License.

package server

type V3 struct {
V2
}
2 changes: 2 additions & 0 deletions metricbeat/modules.d/couchdb.yml.disabled
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,5 @@
metricsets: ["server"]
period: 10s
hosts: ["localhost:5984"]
username: "admin"
password: "password"
2 changes: 2 additions & 0 deletions x-pack/metricbeat/metricbeat.reference.yml
Original file line number Diff line number Diff line change
Expand Up @@ -482,6 +482,8 @@ metricbeat.modules:
metricsets: ["server"]
period: 10s
hosts: ["localhost:5984"]
username: "admin"
password: "password"

#-------------------------------- Docker Module --------------------------------
- module: docker
Expand Down
Loading