You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Introduce options to control memory usage, and general third-party updates (#55)
- add more control over memory usage
- update various dependencies
---------
Signed-off-by: dependabot[bot] <support@github.com>
Signed-off-by: Mark Nelson <mark.x.nelson@oracle.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
- Introduced a new feature to periodically restart the process if requested.
35
+
- Introduced a new feature to periodically attempt to free OS memory if requested.
36
+
- Updated some third-party dependencies.
37
+
29
38
### Version 1.1.1, November 28, 2023
30
39
31
40
This release just updates some third-party dependencies.
@@ -64,7 +73,6 @@ We always welcome input on features you would like to see supported. Please ope
64
73
Currently, we plan to address the following key features:
65
74
66
75
- Implement multiple database support - allow the exporter to publish metrics for multiple database instances,
67
-
- Implement vault support - allow the exporter to obtain database connection information from a secure vault,
68
76
- Implement connection storm protection - prevent the exporter from repeatedly connecting when the credentials fail, to prevent a storm of connections causing accounts to be locked across a large number of databases,
69
77
- Provide the option to have the Oracle client outside of the container image, e.g., on a shared volume,
70
78
- Implement the ability to update the configuration dynamically, i.e., without a restart,
@@ -204,6 +212,7 @@ Now, you provide the connection details using these variables:
204
212
-`DB_USERNAME` is the database username, e.g., `pdbadmin`
205
213
-`DB_PASSWORD` is the password for that user, e.g., `Welcome12345`
206
214
-`DB_CONNECT_STRING` is the connection string, e.g., `devdb_tp?TNS_ADMIN=/wallet`
215
+
-`ORACLE_HOME` is the location of the Oracle Instant Client, i.e., `/lib/oracle/21/client64/lib`. If you built your own container image, the path may be different.
207
216
208
217
To run the exporter in a container and expose the port, use a command like this, with the appropriate values for the environment variables, and mounting your `wallet` directory as `/wallet` in the container to provide access to the wallet:
@@ -477,11 +486,21 @@ An exmaple of [custom metrics for Transacational Event Queues](./custom-metrics-
477
486
If you run the exporter as a container image and want to include your custom metrics in the image itself, you can use the following example `Dockerfile` to create a new image:
478
487
479
488
```Dockerfile
480
-
FROM container-registry.oracle.com/database/observability-exporter:1.1.1
489
+
FROM container-registry.oracle.com/database/observability-exporter:1.2.0
If you are running in an environment with limited memory, or you are running a large number of exporters, you may want to control the exporter's usage of memory.
497
+
498
+
Under normal circumstances, the exporter process will retain OS memory that was used by the Go garbage collector but is no longer needed, in case it may be needed again in the future, unless the host OS is under memory pressure. The result of this behavior (which is the normal behavior of the Go runtime) is that the resident set size will not decrease until the host OS memory is almost all used. Under most circumstances, this will not cause any issues, but if you are in an environment where you need to conserve memory, the following options are provided:
499
+
500
+
- You may set the `FREE_INTERVAL` environment variable to a Go [duration string](https://pkg.go.dev/maze.io/x/duration), e.g., `60s` and run the exporter in debug mode by setting the `GODEBUG` environment variable to a value including `madvdontneed=1`, e.g., `GODEBUG=gctrace=1,madvdontneed=1`. The exporter will call the [FreeOSMemory()](https://pkg.go.dev/runtime/debug#FreeOSMemory) at the specified interval. This tells the Go runtime to attempt to release memory which is no longer needed. Please note that this does not guarantee that the memory will be released to the OS, but over time you should see the RSS shrink sooner than without these settings.
501
+
- You may set the `RESTART_INTERVAL` environment variable to a Go [duration string](https://pkg.go.dev/maze.io/x/duration), e.g., `10m`. The exporter will restart its own process at the specified iterval (by calling the OS `exec` syscall). As no new process is created, the process identifier (PID) does not change, but the machine code, data, heap, and stack of the process are replaced by those of the new program (source: [Wikipedia](https://en.wikipedia.org/wiki/Exec_(system_call))). This has the side effect of freeing the resident set, so that it will return to its original size.
502
+
- In addition to these, you may also set `GOMAXPROCS`, `GOGC`, and `GOMEMLIMIT` (see [documentation](https://pkg.go.dev/runtime#hdr-Environment_Variables)) to further limit the amount of resources that the Go runtime may use.
503
+
485
504
## Grafana dashboards
486
505
487
506
A sample Grafana dashboard definition is provided [in this directory](/docker-compose/grafana/dashboards). You can import this into your Grafana instance, and set it to use the Prometheus datasource that you have defined for the Prometheus instance that is collecting metrics from the exporter.
0 commit comments