-
Notifications
You must be signed in to change notification settings - Fork 621
[oracle] Enhancement to capture system statistics metrics, pga metrics, sga metrics #3967
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
Changes from 20 commits
3359cdb
6116731
8f25af3
e600817
f731214
f65f54e
42bbf49
938baed
bd7c267
846b858
1ebb3b6
f3f7963
4ef6f57
f45a2b4
6a2c2c6
68c2d20
d273d13
54b4357
9bb4a3a
c9f4116
d17cee2
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,14 @@ | ||
| metricsets: ["query"] | ||
| period: {{period}} | ||
| hosts: | ||
| {{#each hosts}} | ||
| - {{this}} | ||
| {{/each}} | ||
| raw_data.enabled: true | ||
| merge_results: true | ||
| driver: "oracle" | ||
| sql_queries: | ||
| - query: select name, value from V$PGASTAT where name in ('aggregate PGA auto target','global memory bound', 'total PGA allocated', 'total PGA used for auto workareas', 'total PGA inuse', 'maximum PGA allocated', 'total freeable PGA memory', 'cache hit percentage', 'aggregate PGA target parameter') | ||
| response_format: variables | ||
| - query: select 'sga free memory' as NAME, sum(decode(name,'free memory',bytes)) as VALUE from v$sgastat where pool = 'shared pool' union select 'sga total memory' as NAME, sum(bytes) as VALUE from v$sgastat where pool = 'shared pool' | ||
| response_format: variables |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,77 @@ | ||
| --- | ||
| description: Pipeline for processing Oracle Program Global Area and System Global Area metrics | ||
| processors: | ||
| - remove: | ||
| field: sql.driver | ||
| ignore_missing: true | ||
| ignore_failure: true | ||
| - remove: | ||
| field: sql.query | ||
| ignore_missing: true | ||
| ignore_failure: true | ||
| - rename: | ||
| field: sql | ||
| target_field: oracle | ||
| ignore_missing: true | ||
| ignore_failure: true | ||
| - rename: | ||
| field: oracle.metrics | ||
| target_field: oracle.memory | ||
| ignore_missing: true | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Do you consider adding ignore_failure for rest of the fields ? Because the other datastreams has ignore_failure for all the fields. |
||
| - foreach: | ||
| field: oracle.memory | ||
| ignore_missing: true | ||
| processor: | ||
| gsub: | ||
| field: "_ingest._key" | ||
| pattern: " " | ||
| replacement: "_" | ||
| - rename: | ||
| field: oracle.memory.cache_hit_percentage | ||
| target_field: oracle.memory.pga.cache_hit_pct | ||
| ignore_missing: true | ||
| - rename: | ||
| field: oracle.memory.aggregate_pga_auto_target | ||
| target_field: oracle.memory.pga.aggregate_auto_target | ||
| ignore_missing: true | ||
| - rename: | ||
| field: oracle.memory.aggregate_pga_target_parameter | ||
| target_field: oracle.memory.pga.aggregate_target_parameter | ||
| ignore_missing: true | ||
| - rename: | ||
| field: oracle.memory.total_pga_allocated | ||
| target_field: oracle.memory.pga.total_allocated | ||
| ignore_missing: true | ||
| - rename: | ||
| field: oracle.memory.total_pga_used_for_auto_workareas | ||
| target_field: oracle.memory.pga.total_used_for_auto_workareas | ||
| ignore_missing: true | ||
| - rename: | ||
| field: oracle.memory.global_memory_bound | ||
| target_field: oracle.memory.pga.global_memory_bound | ||
| ignore_missing: true | ||
| - rename: | ||
| field: oracle.memory.total_pga_inuse | ||
| target_field: oracle.memory.pga.total_inuse | ||
| ignore_missing: true | ||
| - rename: | ||
| field: oracle.memory.total_freeable_pga_memory | ||
| target_field: oracle.memory.pga.total_freeable_memory | ||
| ignore_missing: true | ||
| - rename: | ||
| field: oracle.memory.maximum_pga_allocated | ||
| target_field: oracle.memory.pga.maximum_allocated | ||
| ignore_missing: true | ||
| - rename: | ||
| field: oracle.memory.sga_total_memory | ||
| target_field: oracle.memory.sga.total_memory | ||
| ignore_missing: true | ||
| - rename: | ||
| field: oracle.memory.sga_free_memory | ||
| target_field: oracle.memory.sga.free_memory | ||
| ignore_missing: true | ||
|
|
||
| on_failure: | ||
| - set: | ||
| field: error.message | ||
| value: "{{ _ingest.on_failure_message }}" | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,20 @@ | ||
| - name: data_stream.type | ||
| type: constant_keyword | ||
| description: Data stream type. | ||
| - name: data_stream.dataset | ||
| type: constant_keyword | ||
| description: Data stream dataset. | ||
| - name: data_stream.namespace | ||
| type: constant_keyword | ||
| description: Data stream namespace. | ||
| - name: '@timestamp' | ||
| type: date | ||
| description: Event timestamp. | ||
| - name: event.module | ||
| type: constant_keyword | ||
| description: Event module | ||
| value: sql | ||
| - name: event.dataset | ||
| type: constant_keyword | ||
| description: Event module | ||
| value: oracle.memory |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,8 @@ | ||
| - external: ecs | ||
| name: host.ip | ||
| - external: ecs | ||
| name: ecs.version | ||
| - external: ecs | ||
| name: service.address | ||
| - external: ecs | ||
| name: service.type |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,65 @@ | ||
| - name: oracle.memory | ||
| type: group | ||
| release: beta | ||
| fields: | ||
| - name: pga | ||
| type: group | ||
| fields: | ||
| - name: total_freeable_memory | ||
| type: double | ||
| description: Number of bytes of PGA memory in all processes that could be freed back to the operating system. | ||
| unit: byte | ||
| metric_type: gauge | ||
| - name: cache_hit_pct | ||
| type: double | ||
| description: A metric computed by the Oracle Database to reflect the performance of the PGA memory component, cumulative since instance startup. | ||
| unit: percent | ||
| metric_type: gauge | ||
| - name: maximum_allocated | ||
| type: double | ||
| description: Maximum number of bytes of PGA memory allocated at one time since instance startup. | ||
| unit: byte | ||
| metric_type: gauge | ||
| - name: total_inuse | ||
| type: double | ||
| unit: byte | ||
| description: Indicates how much PGA memory is currently consumed by work areas. This number can be used to determine how much memory is consumed by other consumers of the PGA memory (for example, PL/SQL or Java). | ||
| metric_type: gauge | ||
| - name: global_memory_bound | ||
| type: double | ||
| unit: byte | ||
| description: Maximum size of a work area executed in automatic mode. | ||
| metric_type: gauge | ||
| - name: aggregate_auto_target | ||
| type: double | ||
| unit: byte | ||
| description: Amount of PGA memory the Oracle Database can use for work areas running in automatic mode. | ||
| metric_type: gauge | ||
| - name: total_allocated | ||
| type: double | ||
| unit: byte | ||
| description: Current amount of PGA memory allocated by the instance. | ||
| metric_type: gauge | ||
| - name: total_used_for_auto_workareas | ||
| type: double | ||
| unit: byte | ||
| description: Indicates how much PGA memory is currently consumed by work areas running under the automatic memory management mode. This number can be used to determine how much memory is consumed by other consumers of the PGA memory (for example, PL/SQL or Java). | ||
| metric_type: gauge | ||
| - name: aggregate_target_parameter | ||
| type: double | ||
| unit: byte | ||
| metric_type: gauge | ||
| description: Current value of the PGA_AGGREGATE_TARGET initialization parameter. If this parameter is not set, then its value is 0 and automatic management of PGA memory is disabled. | ||
| - name: sga | ||
| type: group | ||
| fields: | ||
| - name: free_memory | ||
| type: double | ||
| unit: byte | ||
| description: Amount of free memory in the Shared pool. | ||
| metric_type: gauge | ||
| - name: total_memory | ||
| type: double | ||
| unit: byte | ||
| description: Amount of total memory in the Shared pool. | ||
| metric_type: gauge |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,23 @@ | ||
| title: "Memory metrics" | ||
| type: metrics | ||
| release: beta | ||
| streams: | ||
| - input: sql/metrics | ||
| enabled: false | ||
| title: Oracle memory metrics | ||
| description: Collect memory metrics | ||
| vars: | ||
| - name: period | ||
| type: text | ||
| title: Period | ||
| default: 60s | ||
| multi: false | ||
| show_user: true | ||
| - name: tags | ||
| type: text | ||
| title: Tags | ||
| multi: true | ||
| required: true | ||
| show_user: false | ||
| default: | ||
| - oracle_memory_metrics |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,38 @@ | ||
| { | ||
| "@timestamp": "2022-08-07T04:32:07.853Z", | ||
| "oracle": { | ||
| "memory": { | ||
| "pga": { | ||
| "total_inuse": 171153408, | ||
| "aggregate_auto_target": 579262464, | ||
| "total_allocated": 212888576, | ||
| "maximum_allocated": 694778880, | ||
| "total_freeable_memory": 14876672, | ||
| "global_memory_bound": 104857600, | ||
| "aggregate_target_parameter": 805306368, | ||
| "total_used_for_auto_workareas": 738304, | ||
| "cache_hit_pct": 100 | ||
| } | ||
| } | ||
| }, | ||
| "service": { | ||
| "address": "0.0.0.0:1521", | ||
| "type": "sql" | ||
| }, | ||
| "data_stream": { | ||
| "namespace": "default", | ||
| "type": "metrics", | ||
| "dataset": "oracle.memory" | ||
| }, | ||
| "metricset": { | ||
| "period": 60000, | ||
| "name": "query" | ||
| }, | ||
| "event": { | ||
| "duration": 53225246, | ||
| "agent_id_status": "verified", | ||
| "ingested": "2022-08-07T04:32:07Z", | ||
| "module": "sql", | ||
| "dataset": "oracle.memory" | ||
| } | ||
| } |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -83,6 +83,83 @@ processors: | |
| target_field: oracle.performance.cursors.session.cache_hits | ||
| ignore_missing: true | ||
| ignore_failure: true | ||
| - rename: | ||
| field: oracle.performance.active_session_count | ||
| target_field: oracle.performance.session_count.active | ||
| ignore_missing: true | ||
| ignore_failure: true | ||
| - rename: | ||
| field: oracle.performance.inactive_morethan_onehr | ||
| target_field: oracle.performance.session_count.inactive_morethan_onehr | ||
| ignore_missing: true | ||
| ignore_failure: true | ||
| - rename: | ||
| field: oracle.performance.inactive_session_count | ||
| target_field: oracle.performance.session_count.inactive | ||
| ignore_missing: true | ||
| ignore_failure: true | ||
| - rename: | ||
| field: oracle.performance.pct_time | ||
| target_field: oracle.performance.wait.pct_time | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Can we make sure these oracle.performance.wait.* fields are there in the sample events? also I am not able to locate them in the README file also. |
||
| ignore_missing: true | ||
| ignore_failure: true | ||
| - rename: | ||
| field: oracle.performance.pct_waits | ||
| target_field: oracle.performance.wait.pct_waits | ||
| ignore_missing: true | ||
| ignore_failure: true | ||
| - rename: | ||
| field: oracle.performance.time_waited_secs | ||
| target_field: oracle.performance.wait.time_waited_secs | ||
| ignore_missing: true | ||
| ignore_failure: true | ||
| - rename: | ||
| field: oracle.performance.total_waits | ||
| target_field: oracle.performance.wait.total_waits | ||
| ignore_missing: true | ||
| ignore_failure: true | ||
| - rename: | ||
| field: oracle.performance.wait_class | ||
| target_field: oracle.performance.wait.wait_class | ||
| ignore_missing: true | ||
| ignore_failure: true | ||
| - foreach: | ||
| field: oracle.performance | ||
| ignore_missing: true | ||
| processor: | ||
| gsub: | ||
| field: "_ingest._key" | ||
| pattern: " " | ||
| replacement: "_" | ||
| - foreach: | ||
| field: oracle.performance | ||
| ignore_failure: true | ||
| ignore_missing: true | ||
| processor: | ||
| gsub: | ||
| field: "_ingest._key" | ||
| pattern: "\\(%\\)" | ||
| replacement: "pct" | ||
|
|
||
| - foreach: | ||
| field: oracle.performance | ||
| ignore_missing: true | ||
| ignore_failure: true | ||
| processor: | ||
| gsub: | ||
| field: "_ingest._key" | ||
| pattern: "%" | ||
| replacement: "pct" | ||
|
|
||
| - foreach: | ||
| field: oracle.performance | ||
| ignore_missing: true | ||
| ignore_failure: true | ||
| processor: | ||
| gsub: | ||
| field: "_ingest._key" | ||
| pattern: "/" | ||
| replacement: "" | ||
|
|
||
| on_failure: | ||
| - set: | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.