Skip to content
Merged
Show file tree
Hide file tree
Changes from 10 commits
Commits
Show all changes
21 commits
Select commit Hold shift + click to select a range
3359cdb
Enhancement to capture system statistics metrics, pga metrics, sga me…
agithomas Aug 8, 2022
6116731
Added dashboard images, fixed sample files
agithomas Aug 8, 2022
8f25af3
Fixes based on review comments
agithomas Sep 7, 2022
e600817
Changes made to support the field_name changes
agithomas Sep 12, 2022
f731214
Merge branch 'feature-3911' of github.com:agithomas/integrations into…
agithomas Sep 12, 2022
f65f54e
Fixed the issue number
agithomas Sep 12, 2022
42bbf49
Update packages/oracle/changelog.yml
agithomas Sep 13, 2022
938baed
Correct field mapping description
agithomas Sep 15, 2022
bd7c267
Merge branch 'feature-3911' of github.com:agithomas/integrations into…
agithomas Sep 15, 2022
846b858
Made adjustments to field names
agithomas Sep 15, 2022
1ebb3b6
Modified field names
agithomas Sep 15, 2022
f3f7963
Static testing fixes
agithomas Sep 15, 2022
4ef6f57
Field mapping changes made
agithomas Sep 19, 2022
f45a2b4
Fixed README file issues
agithomas Sep 19, 2022
6a2c2c6
Changed datastream name from pga_stat to memory
agithomas Sep 19, 2022
68c2d20
Renamed pga-sga to memory. Added screenshot
agithomas Sep 20, 2022
d273d13
Modified dashboard to support field name changes
agithomas Sep 20, 2022
54b4357
Added new dashboard screenshot
agithomas Sep 20, 2022
9bb4a3a
Fixed dashboard compatibility issue, typo issues
agithomas Sep 20, 2022
c9f4116
Removed empty line
agithomas Sep 20, 2022
d17cee2
Added additional documentation
agithomas Sep 20, 2022
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions packages/oracle/_dev/build/docs/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -82,3 +82,15 @@ The `database_audit` dataset collects Oracle Audit logs.
{{fields "sysmetric"}}

{{event "sysmetric"}}

### PGA SGA Metrics
Comment thread
agithomas marked this conversation as resolved.
Outdated

{{fields "pga_sga"}}

{{event "pga_sga"}}

### System Statistics Metrics

{{fields "system_statistics"}}

{{event "system_statistics"}}
5 changes: 5 additions & 0 deletions packages/oracle/changelog.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,9 @@
# newer versions go on top
- version: "1.4.0"
changes:
- description: Enhancement to capture system statistics metrics, pga metrics, sga metrics.
type: enhancement
link: https://github.com/elastic/integrations/pull/3967
- version: "1.3.0"
changes:
- description: Update package to ECS 8.4.0
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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


Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The 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.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

pga_sga : 2
sysmetric : 1
system_statistics : 1

There is a scope of improvement in performance datastream (part of 8.4) which has 7 queries.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The 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

Comment thread
agithomas marked this conversation as resolved.
Outdated
Original file line number Diff line number Diff line change
Expand Up @@ -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

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The 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:
Expand Down
44 changes: 44 additions & 0 deletions packages/oracle/data_stream/performance/fields/fields.yml
Original file line number Diff line number Diff line change
Expand Up @@ -117,3 +117,47 @@
metric_type: gauge
description: |
Ratio of session cursor cache hits from total number of cursors.
- name: failed_db_jobs
Comment thread
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
Comment thread
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.
Comment thread
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

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The 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"?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

- name: pct_time
          type: double
          unit: percent
          metric_type: gauge
          description: Percentage of time waits that are not Idle wait class.
        - name: pct_waits
          type: double
          unit: percent
          metric_type: gauge
          description: Percentage of number of pct time waits that are not of Idle wait class.

Cannot remove wait because, it will lead to conflicts / confusions

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
13 changes: 13 additions & 0 deletions packages/oracle/data_stream/pga_sga/agent/stream/stream.yml.hbs
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 }}"
20 changes: 20 additions & 0 deletions packages/oracle/data_stream/pga_sga/fields/base-fields.yml
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
8 changes: 8 additions & 0 deletions packages/oracle/data_stream/pga_sga/fields/ecs.yml
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
67 changes: 67 additions & 0 deletions packages/oracle/data_stream/pga_sga/fields/fields.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
- name: oracle.pga_sga
Comment thread
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
Comment thread
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
Comment thread
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
23 changes: 23 additions & 0 deletions packages/oracle/data_stream/pga_sga/manifest.yml
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
38 changes: 38 additions & 0 deletions packages/oracle/data_stream/pga_sga/sample_event.json
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"
}
}
Loading