Skip to content
Merged
Show file tree
Hide file tree
Changes from all 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
34 changes: 28 additions & 6 deletions packages/oracle/_dev/build/docs/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -65,20 +65,42 @@ The `database_audit` dataset collects Oracle Audit logs.

{{event "database_audit"}}

### Performance Metrics

{{fields "performance"}}

{{event "performance"}}

### Tablespace Metrics

Tablespace metrics describes the tablespace usage metrics of all types of tablespaces in the oracle database.

{{fields "tablespace"}}

{{event "tablespace"}}

### Sysmetrics

The system metrics value captured for the most current time interval for the long duration (60-seconds) are mentioned below

{{fields "sysmetric"}}

{{event "sysmetric"}}

### Memory Metrics

A Program Global Area (PGA) is a memory region that contains data and control information for a server process. It is nonshared memory created by Oracle Database when a server process is started. Access to the PGA is exclusive to the server process. Metrics concerning Program Global Area (PGA) memory are mentioned below.

{{fields "memory"}}

{{event "memory"}}

### System Statistics Metrics

The System Global Area (SGA) is a group of shared memory structures that contain data and control information for one Oracle Database instance. Metrics concerning System Global Area (SGA) memory are mentioned below.

{{fields "system_statistics"}}

{{event "system_statistics"}}

### Performance Metrics

Performance metrics give an overview of where time is spent in the system and enable comparisons of wait times across the system.

{{fields "performance"}}

{{event "performance"}}
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
14 changes: 14 additions & 0 deletions packages/oracle/data_stream/memory/agent/stream/stream.yml.hbs
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,88 @@
---
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
Copy link
Contributor

Choose a reason for hiding this comment

The 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
ignore_failure: true
- rename:
field: oracle.memory.aggregate_pga_auto_target
target_field: oracle.memory.pga.aggregate_auto_target
ignore_missing: true
ignore_failure: true
- rename:
field: oracle.memory.aggregate_pga_target_parameter
target_field: oracle.memory.pga.aggregate_target_parameter
ignore_missing: true
ignore_failure: true
- rename:
field: oracle.memory.total_pga_allocated
target_field: oracle.memory.pga.total_allocated
ignore_missing: true
ignore_failure: true
- rename:
field: oracle.memory.total_pga_used_for_auto_workareas
target_field: oracle.memory.pga.total_used_for_auto_workareas
ignore_missing: true
ignore_failure: true
- rename:
field: oracle.memory.global_memory_bound
target_field: oracle.memory.pga.global_memory_bound
ignore_missing: true
ignore_failure: true
- rename:
field: oracle.memory.total_pga_inuse
target_field: oracle.memory.pga.total_inuse
ignore_missing: true
ignore_failure: true
- rename:
field: oracle.memory.total_freeable_pga_memory
target_field: oracle.memory.pga.total_freeable_memory
ignore_missing: true
ignore_failure: true
- rename:
field: oracle.memory.maximum_pga_allocated
target_field: oracle.memory.pga.maximum_allocated
ignore_missing: true
ignore_failure: true
- rename:
field: oracle.memory.sga_total_memory
target_field: oracle.memory.sga.total_memory
ignore_missing: true
ignore_failure: true
- rename:
field: oracle.memory.sga_free_memory
target_field: oracle.memory.sga.free_memory
ignore_missing: true
ignore_failure: true

on_failure:
- set:
field: error.message
value: "{{ _ingest.on_failure_message }}"
20 changes: 20 additions & 0 deletions packages/oracle/data_stream/memory/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.memory
8 changes: 8 additions & 0 deletions packages/oracle/data_stream/memory/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
65 changes: 65 additions & 0 deletions packages/oracle/data_stream/memory/fields/fields.yml
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
23 changes: 23 additions & 0 deletions packages/oracle/data_stream/memory/manifest.yml
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
38 changes: 38 additions & 0 deletions packages/oracle/data_stream/memory/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": {
"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
Expand Up @@ -14,4 +14,10 @@ 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
Loading