Skip to content

Commit 23a0635

Browse files
update per Monica (#168)
* update per Monica * incorporate edits from Russ and Monica * incorporate example config
1 parent 0fb9869 commit 23a0635

File tree

1 file changed

+66
-23
lines changed

1 file changed

+66
-23
lines changed

README.md

Lines changed: 66 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -2,20 +2,20 @@
22

33
[![Build Status](https://travis-ci.org/oracle/weblogic-monitoring-exporter.svg?branch=master)](https://travis-ci.org/oracle/weblogic-monitoring-exporter)
44

5-
The WebLogic Monitoring Exporter is a [Prometheus](http://prometheus.io)-compatible exporter of metrics from
6-
WebLogic Server (WLS) instances, which it obtains by using the
7-
[WLS RESTful Management API](https://docs.oracle.com/middleware/12213/wls/WLRUR/overview.htm#WLRUR111), available in version 12.2.1 or later.
5+
The WebLogic Monitoring Exporter is a [Prometheus](http://prometheus.io)-compatible exporter of metrics from
6+
WebLogic Server (WLS) instances, which it obtains by using the
7+
[WLS RESTful Management API](https://docs.oracle.com/middleware/12213/wls/WLRUR/overview.htm#WLRUR111), available in version 12.2.1 or later.
88
Metrics are selected using a [YAML configuration file](#Configuration).
99

1010
The exporter is available in two forms:
11-
- A [web application](#web-application) that you deploy to the server from which metrics are to be extracted.
12-
You may include a configuration file directly in the WAR file, and you may temporarily modify the configuration in a
13-
running system by using a web form. If a [coordination configurator](config_coordinator/README.md) is running and configured,
11+
- A [web application](#web-application) that you deploy to the server from which metrics are to be extracted.
12+
You may include a configuration file directly in the WAR file, and you may temporarily modify the configuration in a
13+
running system by using a web form. If a [coordination configurator](config_coordinator/README.md) is running and configured,
1414
that temporary configuration will be sent to all servers configured to use it.
15-
15+
1616
- A [separate process](#sidecar) that is run alongside a server instance. You supply the configuration to such a
1717
process with a PUT command, as described below. [WebLogic Server Kubernetes Operator](https://github.com/oracle/weblogic-kubernetes-operator/) versions 3.2 and later have special support for the exporter in this form.
18-
18+
For more information, see [Use the Monitoring Exporter with WebLogic Kubernetes Operator](#use-the-monitoring-exporter-with-weblogic-kubernetes-operator).
1919

2020
## Configuration
2121
Here is an example `yaml` file configuration:
@@ -53,7 +53,7 @@ Note that there are two parts to the configuration. The optional top portion def
5353
| `domainQualifier` | If true, the domain name will be included as a qualifier for all metrics. Defaults to false. |
5454
| `restPort` | Optional, used in the web application only. Overrides the port on which the exporter should contact the REST API. Needed if the exporter cannot find the REST API. The most common case is running on a system with the administration port enabled. In that case, you must specify the administration port in this field and access the exporter by using the SSL port. |
5555

56-
Note that if unable to contact the REST API using the inferred host and port, the exporter will try the local host name and, if the REST port is specified, the local port.
56+
Note that if unable to contact the REST API using the inferred host and port, the exporter will try the local host name and, if the REST port is specified, the local port.
5757

5858
The `query` field is more complex. Each query consists of a hierarchy of the [MBeans](https://docs.oracle.com/middleware/12213/wls/WLMBR/core/index.html), starting relative to `ServerRuntimes`.
5959
Within each section, there are a number of options:
@@ -120,6 +120,40 @@ however, if the metrics request is made using a load balancer or Kubernetes Node
120120
original request was made might not be the same as the instance's HTTP port. In such a case, the configuration should
121121
include the `restPort` configuration to tell the exporter which port to use.
122122

123+
## Use the Monitoring Exporter with WebLogic Kubernetes Operator
124+
125+
If you are running operator-managed WebLogic Server domains in Kubernetes, simply add the [`monitoringExporter`](https://github.com/oracle/weblogic-kubernetes-operator/blob/main/documentation/domains/Domain.md) configuration element in the domain resource to enable the Monitoring Exporter. For an example, see the following `yaml` file configuration:
126+
127+
```
128+
kind: Domain
129+
metadata:
130+
name: domain2
131+
namespace: domain_ns
132+
spec:
133+
monitoringExporter:
134+
configuration:
135+
metricsNameSnakeCase: true
136+
domainQualifier: true
137+
queries:
138+
- key: name
139+
keyName: server
140+
applicationRuntimes:
141+
key: name
142+
keyName: app
143+
componentRuntimes:
144+
type: WebAppComponentRuntime
145+
prefix: webapp_config_
146+
key: name
147+
values: [deploymentState, contextRoot, sourceInfo, openSessionsHighCount]
148+
servlets:
149+
prefix: weblogic_servlet_
150+
key: servletName
151+
values: invocationTotalCount
152+
```
153+
154+
155+
To use the Monitoring Exporter with Prometheus, see the directions [here](https://blogs.oracle.com/weblogicserver/post/using-prometheus-and-grafana-to-monitor-weblogic-server-on-kubernetes).
156+
123157

124158
## Samples
125159

@@ -139,7 +173,7 @@ you to change it, either by uploading a replacement or an addition to the querie
139173
Metrics will then be available from `<application-root>/metrics`.
140174

141175

142-
## Downloading the release
176+
## Download the release
143177

144178
You can find all the exporter releases on the [Releases page](https://github.com/oracle/weblogic-monitoring-exporter/releases/).
145179

@@ -149,7 +183,7 @@ To download the web application `wls-exporter.war` file and put your configurati
149183
bash getXXX.sh <your-config-file>
150184
```
151185

152-
## Building from source
186+
## Build from source
153187

154188
Use `mvn install` to build the web application. This will create `wls-exporter-<version>`, where _version_
155189
is the Maven-assigned version number.
@@ -163,9 +197,18 @@ The sidecar is a standalone process that runs the exporter.
163197

164198
### Build and run with Maven
165199

166-
There are two ways to build the sidecar implementation. The first is with Maven, using the same `mvn install` command
167-
specified [above](#building-from-source). Note that this requires JDK11 or later; building the project with JDK8 will
168-
skip the sidecar module. The alternative is to [build with Docker](#building-a-docker-image)
200+
There are two ways to build the sidecar implementation. The first is with Maven, using the same `mvn install` command
201+
specified [above](#build-from-source). Note that this requires JDK11 or later; building the project with JDK8 will
202+
skip the sidecar module. The alternative is to [build with Docker](#build-a-docker-image).
203+
204+
Instead of manually building them, if you want to use pre-built images, then you can pull a pre-created image from
205+
the [Oracle Container Registry](https://container-registry.oracle.com/ords/f?p=113:10::::::) (OCR) or from
206+
Google Container Registry (https://ghcr.io/), as follows:
207+
```
208+
docker pull container-registry.oracle.com/middleware/weblogic-monitoring-exporter:x.x.x
209+
OR
210+
docker pull ghcr.io/oracle/weblogic-monitoring-exporter:x.x.x
211+
```
169212

170213
After building, run:
171214
```
@@ -186,15 +229,15 @@ Use https | `false` | `WLS_SECURE`
186229

187230
### Configure the exporter
188231

189-
You configure the sidecar by sending a PUT request to the path `/configuration`.
190-
You can do this with `curl`; that is how the operator does it.
232+
You configure the sidecar by sending a PUT request to the path `/configuration`.
233+
You can do this with `curl`; that is how the operator does it.
191234

192235
```
193236
curl -X PUT -i -u myname:mypassword \
194237
-H "content-type: application/yaml" \
195238
--data-binary "@<path to yaml>" \
196239
http://localhost:8080/configuration
197-
```
240+
```
198241

199242
Replace `myname` and `mypassword` with the credentials expected by WebLogic Server for its REST API,
200243
and `<path to yaml>` with the relative path to the configuration to use.
@@ -203,16 +246,16 @@ and `<path to yaml>` with the relative path to the configuration to use.
203246

204247
After the exporter is configured, a GET to `http://localhost:8080/metrics` (or whatever port was chosen) will return the current metrics.
205248

206-
## Building a Docker image
249+
## Build a Docker image
207250

208-
If Docker is installed, you can build the image with the following command.
251+
If you don't want to use a pre-built image from OCR, you can use the following Docker command to build the Monitoring Exporter image.
209252

210253
```
211254
docker build . -t <image-name>
212255
```
213256

214-
This will build the project and create a Docker image with the specified name. It is not necessary even
215-
to do the Maven build first, as that will happen as part of creating the image. When running behind a firewall,
257+
This will build the project and create a Docker image with the specified name. It is not necessary even
258+
to do the Maven build first, as that will happen as part of creating the image. When running behind a firewall,
216259
it is necessary to specify a value for the `MAVEN_OPTS` and `https_proxy` variables on the command line. For example:
217260

218261
```
@@ -221,7 +264,7 @@ docker build . --build-arg MAVEN_OPTS="-Dhttps.proxyHost=www-proxy -Dhttps.proxy
221264
-t <image-name>
222265
```
223266

224-
This allows Docker to download the dependencies.
267+
This allows Docker to download the dependencies.
225268

226269

227270
## Contributing
@@ -239,4 +282,4 @@ vulnerability disclosure process.
239282
Copyright (c) 2019, 2022 Oracle and/or its affiliates.
240283

241284
Released under the Universal Permissive License v1.0 as shown at
242-
<https://oss.oracle.com/licenses/upl/>.
285+
<https://oss.oracle.com/licenses/upl/>.

0 commit comments

Comments
 (0)