Skip to content

Commit

Permalink
[Metricbeat] Make Oracle module GA (elastic#16833)
Browse files Browse the repository at this point in the history
  • Loading branch information
sayden committed Mar 24, 2020
1 parent 2e09734 commit 8a2ed76
Show file tree
Hide file tree
Showing 17 changed files with 34 additions and 27 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.next.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -260,6 +260,7 @@ https://github.com/elastic/beats/compare/v7.0.0-alpha2...master[Check the HEAD d
- Release Zookeeper/connection module as GA. {issue}14281[14281] {pull}17043[17043]
- Add support for CouchDB v2 {issue}16352[16352] {pull}16455[16455]
- Replace vpc metricset into vpn, transitgateway and natgateway metricsets. {pull}16892[16892]
- Release Oracle module as GA. {issue}14279[14279] {pull}16833[16833]

*Packetbeat*

Expand Down
2 changes: 2 additions & 0 deletions Jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -574,6 +574,8 @@ def withBeatsEnv(Closure body){
"TEST_COVERAGE=true",
"RACE_DETECTOR=true",
"PYTHON_ENV=${WORKSPACE}/python-env",
"TEST_TAGS=oracle",
"DOCKER_PULL=0",
]){
deleteDir()
unstash 'source'
Expand Down
2 changes: 0 additions & 2 deletions metricbeat/docs/modules/oracle.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,6 @@ This file is generated! See scripts/mage/docs_collector.go
[role="xpack"]
== Oracle module

beta[]

This is the https://www.oracle.com[Oracle] module for Metricbeat. It is under active development with feedback from the community. A single Metricset for Tablespace monitoring is added so the community can start gathering metrics from their nodes and contributing to the module.

[float]
Expand Down
2 changes: 0 additions & 2 deletions metricbeat/docs/modules/oracle/performance.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,6 @@ This file is generated! See scripts/mage/docs_collector.go
[[metricbeat-metricset-oracle-performance]]
=== Oracle performance metricset

beta[]

include::../../../../x-pack/metricbeat/module/oracle/performance/_meta/docs.asciidoc[]


Expand Down
2 changes: 0 additions & 2 deletions metricbeat/docs/modules/oracle/tablespace.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,6 @@ This file is generated! See scripts/mage/docs_collector.go
[[metricbeat-metricset-oracle-tablespace]]
=== Oracle tablespace metricset

beta[]

include::../../../../x-pack/metricbeat/module/oracle/tablespace/_meta/docs.asciidoc[]


Expand Down
6 changes: 3 additions & 3 deletions metricbeat/docs/modules_list.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -195,9 +195,9 @@ This file is generated! See scripts/mage/docs_collector.go
.1+| .1+| |<<metricbeat-metricset-nginx-stubstatus,stubstatus>>
|<<metricbeat-module-openmetrics,Openmetrics>> beta[] |image:./images/icon-no.png[No prebuilt dashboards] |
.1+| .1+| |<<metricbeat-metricset-openmetrics-collector,collector>> beta[]
|<<metricbeat-module-oracle,Oracle>> beta[] |image:./images/icon-yes.png[Prebuilt dashboards are available] |
.2+| .2+| |<<metricbeat-metricset-oracle-performance,performance>> beta[]
|<<metricbeat-metricset-oracle-tablespace,tablespace>> beta[]
|<<metricbeat-module-oracle,Oracle>> |image:./images/icon-yes.png[Prebuilt dashboards are available] |
.2+| .2+| |<<metricbeat-metricset-oracle-performance,performance>>
|<<metricbeat-metricset-oracle-tablespace,tablespace>>
|<<metricbeat-module-php_fpm,PHP_FPM>> |image:./images/icon-no.png[No prebuilt dashboards] |
.2+| .2+| |<<metricbeat-metricset-php_fpm-pool,pool>>
|<<metricbeat-metricset-php_fpm-process,process>>
Expand Down
4 changes: 2 additions & 2 deletions x-pack/metricbeat/module/oracle/_meta/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
FROM store/oracle/database-enterprise:12.2.0.1
FROM docker.elastic.co/observability-ci/database-enterprise:12.2.0.1

HEALTHCHECK --interval=1s --retries=90 CMD /usr/bin/echo 'select 1' | sqlplus sys/Oradoc_db1@localhost:1521/ORCLPDB1.localdomain AS SYSDBA
HEALTHCHECK --interval=1s --retries=90 CMD /usr/bin/echo 'select 1' | /u01/app/oracle/product/12.2.0/dbhome_1/bin/sqlplus sys/Oradoc_db1@localhost:1521/ORCLPDB1.localdomain AS SYSDBA
2 changes: 1 addition & 1 deletion x-pack/metricbeat/module/oracle/_meta/fields.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
title: "Oracle"
description: Oracle database module
short_config: false
release: beta
release: ga
fields:
- name: oracle
type: group
Expand Down
2 changes: 2 additions & 0 deletions x-pack/metricbeat/module/oracle/_meta/supported-versions.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
variants:
- ORACLE_VERSION: 12.2.0.1
12 changes: 12 additions & 0 deletions x-pack/metricbeat/module/oracle/docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
version: '2.3'

services:
oracle:
image: docker.elastic.co/observability-ci/database-enterprise:${ORACLE_VERSION:-12.2.0.1}-1
build:
context: ./_meta
args:
ORACLE_VERSION: ${ORACLE_VERSION:-12.2.0.1}
ports:
- 1521
- 5500
2 changes: 1 addition & 1 deletion x-pack/metricbeat/module/oracle/fields.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
- name: performance
type: group
description: Performance related metrics on a single database instance
release: beta
release: ga
fields:
- name: machine
type: keyword
Expand Down
3 changes: 0 additions & 3 deletions x-pack/metricbeat/module/oracle/performance/metricset.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ import (

"github.com/pkg/errors"

"github.com/elastic/beats/v7/libbeat/common/cfgwarn"
"github.com/elastic/beats/v7/metricbeat/mb"
"github.com/elastic/beats/v7/x-pack/metricbeat/module/oracle"
)
Expand All @@ -35,8 +34,6 @@ type MetricSet struct {
// New creates a new instance of the MetricSet. New is responsible for unpacking
// any MetricSet specific configuration options if there are any.
func New(base mb.BaseMetricSet) (mb.MetricSet, error) {
cfgwarn.Beta("The oracle 'performance' metricset is beta.")

config := oracle.ConnectionDetails{}
if err := base.Module().UnpackConfig(&config); err != nil {
return nil, errors.Wrap(err, "error parsing config file")
Expand Down
12 changes: 7 additions & 5 deletions x-pack/metricbeat/module/oracle/performance/metricset_test.go
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
// Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
// or more contributor license agreements. Licensed under the Elastic License;
// you may not use this file except in compliance with the Elastic License.

// +build integration
// +build oracle

package performance

Expand All @@ -12,13 +12,15 @@ import (
_ "github.com/godror/godror"

"github.com/elastic/beats/v7/libbeat/common"
"github.com/elastic/beats/v7/libbeat/tests/compose"
mbtest "github.com/elastic/beats/v7/metricbeat/mb/testing"
"github.com/elastic/beats/v7/x-pack/metricbeat/module/oracle"
)

func TestData(t *testing.T) {
t.Skip("Skip until a proper Docker image is setup for Metricbeat")
f := mbtest.NewReportingMetricSetV2WithContext(t, getConfig())
r := compose.EnsureUp(t, "oracle")

f := mbtest.NewReportingMetricSetV2WithContext(t, getConfig(r.Host()))

findKey := func(key string) func(common.MapStr) bool {
return func(in common.MapStr) bool {
Expand Down Expand Up @@ -54,11 +56,11 @@ func TestData(t *testing.T) {
}
}

func getConfig() map[string]interface{} {
func getConfig(host string) map[string]interface{} {
return map[string]interface{}{
"module": "oracle",
"metricsets": []string{"performance"},
"hosts": []string{oracle.GetOracleConnectionDetails("localhost")},
"hosts": []string{oracle.GetOracleConnectionDetails(host)},
"username": "sys",
"password": "Oradoc_db1",
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
- name: tablespace
type: group
description: tablespace
release: beta
release: ga
fields:
- name: name
type: keyword
Expand Down
3 changes: 0 additions & 3 deletions x-pack/metricbeat/module/oracle/tablespace/metricset.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ import (

"github.com/pkg/errors"

"github.com/elastic/beats/v7/libbeat/common/cfgwarn"
"github.com/elastic/beats/v7/metricbeat/mb"
"github.com/elastic/beats/v7/x-pack/metricbeat/module/oracle"
)
Expand All @@ -35,8 +34,6 @@ type MetricSet struct {
// New creates a new instance of the MetricSet. New is responsible for unpacking
// any MetricSet specific configuration options if there are any.
func New(base mb.BaseMetricSet) (mb.MetricSet, error) {
cfgwarn.Beta("The oracle 'tablespace' metricset is beta.")

config := oracle.ConnectionDetails{}
if err := base.Module().UnpackConfig(&config); err != nil {
return nil, errors.Wrap(err, "error parsing config file")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
// you may not use this file except in compliance with the Elastic License.

// +build integration
// +build oracle

package tablespace

Expand All @@ -17,7 +18,6 @@ import (
)

func TestData(t *testing.T) {
t.Skip("Skip until a proper Docker image is setup for Metricbeat")
r := compose.EnsureUp(t, "oracle")

f := mbtest.NewReportingMetricSetV2WithContext(t, getConfig(r.Host()))
Expand Down

0 comments on commit 8a2ed76

Please sign in to comment.