-
Notifications
You must be signed in to change notification settings - Fork 598
[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 10 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 |
|---|---|---|
|
|
@@ -14,4 +14,12 @@ sql_queries: | |
| - query: SELECT total_cursors, current_cursors, sess_cur_cache_hits, parse_count_total, sess_cur_cache_hits / total_cursors as cachehits_totalcursors_ratio , sess_cur_cache_hits - parse_count_total as real_parses FROM ( SELECT sum ( decode ( name, 'opened cursors cumulative', value, 0)) total_cursors, sum ( decode ( name, 'opened cursors current',value,0)) current_cursors, sum ( decode ( name, 'session cursor cache hits',value,0)) sess_cur_cache_hits, sum ( decode ( name, 'parse count (total)',value,0)) parse_count_total FROM v$sysstat WHERE name IN ( 'opened cursors cumulative','opened cursors current','session cursor cache hits', 'parse count (total)' )) | ||
| response_format: table | ||
| - query: SELECT 'lock_requests' "Ratio" , AVG(gethitratio) FROM V$LIBRARYCACHE UNION SELECT 'pin_requests' "Ratio", AVG(pinhitratio) FROM V$LIBRARYCACHE UNION SELECT 'io_reloads' "Ratio", (SUM(reloads) / SUM(pins)) FROM V$LIBRARYCACHE | ||
| response_format: variables | ||
| response_format: variables | ||
| - query: SELECT COUNT(*) as "failed_db_jobs" FROM dba_jobs WHERE NVL(failures, 0) < > 0 | ||
| response_format: table | ||
| - query: select 'active_session_count' as name, count(s.status) as value from gv$session s, v$process p where p.addr=s.paddr and s.status='ACTIVE' union select 'inactive_session_count' as name, count(s.status) as value from gv$session s, v$process p where p.addr=s.paddr and s.status='INACTIVE' union select 'inactive_morethan_onehr' as name, count(s.status) as value from gv$session s, v$process p where p.addr=s.paddr and s.last_call_et > 3600 and s.status='INACTIVE' | ||
| response_format: variables | ||
| - query: select WAIT_CLASS, TOTAL_WAITS, round(100 * (TOTAL_WAITS / SUM_WAITS),2) PCT_WAITS, ROUND((TIME_WAITED / 100),2) TIME_WAITED_SECS, round(100 * (TIME_WAITED / SUM_TIME),2) PCT_TIME from (select WAIT_CLASS, TOTAL_WAITS, TIME_WAITED from V$SYSTEM_WAIT_CLASS where WAIT_CLASS != 'Idle'), (select sum(TOTAL_WAITS) SUM_WAITS, sum(TIME_WAITED) SUM_TIME from V$SYSTEM_WAIT_CLASS where WAIT_CLASS != 'Idle') order by 5 desc | ||
| response_format: table | ||
|
|
||
|
|
||
|
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. How many documents are created by these queries? Should we add request_merge flag? This question applies to all the oracle data streams.
Contributor
Author
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. pga_sga : 2 There is a scope of improvement in performance datastream (part of 8.4) which has 7 queries.
Contributor
Author
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. As per the discussion, a separate PR will be created for this as 8.4.0 features are needed, changing min kibana version to 8.4.0 for this integration
agithomas marked this conversation as resolved.
Outdated
|
||
| 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_session_count | ||
| 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_session_count | ||
| 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: | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -117,3 +117,47 @@ | |
| metric_type: gauge | ||
| description: | | ||
| Ratio of session cursor cache hits from total number of cursors. | ||
| - name: failed_db_jobs | ||
|
agithomas marked this conversation as resolved.
Outdated
|
||
| type: double | ||
| metric_type: gauge | ||
| description: This metric checks for failed DBMS jobs. | ||
| - name: session_count | ||
| type: group | ||
| field: | ||
| - name: active_session_count | ||
|
agithomas marked this conversation as resolved.
Outdated
|
||
| type: double | ||
| metric_type: gauge | ||
| description: Total count of sessions. | ||
| - name: inactive_morethan_onehr | ||
| type: double | ||
| metric_type: gauge | ||
| description: Total count of Inactive sessions. | ||
| - name: inactive_session_count | ||
| type: double | ||
| metric_type: gauge | ||
| description: Total inactive sessions more than one hour. | ||
|
agithomas marked this conversation as resolved.
Outdated
|
||
| - name: wait | ||
| type: group | ||
| field: | ||
| - name: pct_time | ||
| type: double | ||
| unit: percent | ||
| metric_type: gauge | ||
| description: Percentage of time waits that are not Idle wait class. | ||
| - name: pct_waits | ||
|
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. should we remove "wait" for last field names. Need to think if having these in the names better since the group name is "wait"?
Contributor
Author
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. Cannot remove |
||
| type: double | ||
| unit: percent | ||
| metric_type: gauge | ||
| description: Percentage of number of pct time waits that are not of Idle wait class. | ||
| - name: time_waited_secs | ||
| type: double | ||
| metric_type: gauge | ||
| unit: s | ||
| description: Amount of time spent in the wait class by the session. | ||
| - name: total_waits | ||
| type: double | ||
| metric_type: counter | ||
| description: Number of times waits of the class occurred for the session. | ||
| - name: wait_class | ||
| type: keyword | ||
| description: Every wait event belongs to a class of wait event. Wait classes can be one of the following - Administrative, Application, Cluster, Commit, Concurrency, Configuration, Idle, Network, Other, Scheduler, System IO, User IO | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,13 @@ | ||
| metricsets: ["query"] | ||
| period: {{period}} | ||
| hosts: | ||
| {{#each hosts}} | ||
| - {{this}} | ||
| {{/each}} | ||
| raw_data.enabled: 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', 'process count', 'max processes count', '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,36 @@ | ||
| --- | ||
| 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.pga_sga | ||
| ignore_missing: true | ||
| - foreach: | ||
| field: oracle.pga_sga | ||
| ignore_missing: true | ||
| processor: | ||
| gsub: | ||
| field: "_ingest._key" | ||
| pattern: " " | ||
| replacement: "_" | ||
| - rename: | ||
| field: oracle.pga_sga.cache_hit_percentage | ||
| target_field: oracle.pga_sga.cache_hit_pct | ||
| 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.pga_sga |
| 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,67 @@ | ||
| - name: oracle.pga_sga | ||
|
agithomas marked this conversation as resolved.
Outdated
|
||
| type: group | ||
| release: beta | ||
| fields: | ||
| - name: total_freeable_pga_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_percentage | ||
|
agithomas marked this conversation as resolved.
Outdated
|
||
| 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_pga_allocated | ||
| type: double | ||
| description: Maximum number of bytes of PGA memory allocated at one time since instance startup. | ||
| unit: byte | ||
| metric_type: gauge | ||
| - name: process_count | ||
| type: double | ||
| description: Number of processes active within up to the last 3 seconds. | ||
| metric_type: gauge | ||
| - name: total_pga_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_pga_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_pga_allocated | ||
| type: double | ||
| unit: byte | ||
| description: Current amount of PGA memory allocated by the instance. | ||
| metric_type: gauge | ||
| - name: total_pga_used_for_auto_workareas | ||
|
agithomas marked this conversation as resolved.
Outdated
|
||
| 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: max_processes_count | ||
| type: double | ||
| description: Maximum number of processes active at any one time since instance startup. | ||
| metric_type: gauge | ||
| - name: aggregate_pga_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_free_memory | ||
| type: double | ||
| unit: byte | ||
| description: Amount of free memory in the Shared pool. | ||
| metric_type: gauge | ||
| - name: sga_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: "Program Global Area and System Global Area metrics" | ||
| type: metrics | ||
| release: beta | ||
| streams: | ||
| - input: sql/metrics | ||
| enabled: false | ||
| title: Oracle Program Global Area and System Global Area metrics | ||
| description: Collect Oracle Program Global Area and System Global Area 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_pga_sga_metrics |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,38 @@ | ||
| { | ||
| "@timestamp": "2022-08-07T04:32:07.853Z", | ||
| "oracle": { | ||
| "pga_sga": { | ||
| "aggregate_pga_auto_target": 577658880, | ||
| "aggregate_pga_target_parameter": 805306368, | ||
| "max_processes_count": 95, | ||
| "total_pga_allocated": 207594496, | ||
| "total_pga_used_for_auto_workareas": 0, | ||
| "process_count": 85, | ||
| "global_memory_bound": 104857600, | ||
| "total_pga_inuse": 167798784, | ||
| "total_freeable_pga_memory": 14221312, | ||
| "cache_hit_percentage": 100, | ||
| "maximum_pga_allocated": 599693312 | ||
| } | ||
| }, | ||
| "service": { | ||
| "address": "0.0.0.0:1521", | ||
| "type": "sql" | ||
| }, | ||
| "data_stream": { | ||
| "namespace": "default", | ||
| "type": "metrics", | ||
| "dataset": "oracle.pga_sga" | ||
| }, | ||
| "metricset": { | ||
| "period": 60000, | ||
| "name": "query" | ||
| }, | ||
| "event": { | ||
| "duration": 53225246, | ||
| "agent_id_status": "verified", | ||
| "ingested": "2022-08-07T04:32:07Z", | ||
| "module": "sql", | ||
| "dataset": "oracle.pga_sga" | ||
| } | ||
| } |
Uh oh!
There was an error while loading. Please reload this page.