Skip to content

Instantly share code, notes, and snippets.

@tjheslin1
Last active February 1, 2019 06:07
Show Gist options
  • Save tjheslin1/5d74d5ad6c4b0dda8662c381590ddbbb to your computer and use it in GitHub Desktop.
Save tjheslin1/5d74d5ad6c4b0dda8662c381590ddbbb to your computer and use it in GitHub Desktop.
httpPort: 7000
cacheDuration: 60
probeConnectionWaitInSeconds: 10
databases:
- name: bobsDatabase
user: system
jdbcUrl: jdbc:oracle:thin:@localhost:1522:xe
probes:
- healthCheck
- noLabels
metricLabels:
exampleDefaultLabel: exampleDefaultValue
- name: alicesDatabase
user: system
jdbcUrl: jdbc:oracle:thin:@localhost:1523:xe
probes:
- healthCheck
- slowestQueries
connectionPool:
maxSize: 5
minIdle: 1
maxConnectionRetries: 10
connectionRetryDelayInSeconds: 60
probes:
- name: healthCheck
type: exists
query: SELECT 1 FROM DUAL
metricName: database_up
metricLabels: query="SELECT 1 FROM DUAL"
- name: slowestQueries
type: list
metricName: slowest_queries
metricLabels: sqlText="%s",sqlId="%s",username="%s",childNumber="%s",diskReads="%s",executions="%s",firstLoadTime="%s",lastLoadTime="%s"
query: |
SELECT * FROM
(SELECT
s.elapsed_time / s.executions / 1000 AS AVG_ELAPSED_TIME_IN_MILLIS,
SUBSTR(s.sql_fulltext, 1, 80) AS SQL_TEXT,
s.sql_id,
d.username,
s.child_number,
s.disk_reads,
s.executions,
s.first_load_time,
s.last_load_time
FROM v$sql s, dba_users d
WHERE s.parsing_user_id = d.user_id
AND trunc(TO_DATE(s.last_load_time, 'YYYY-MM-DD/HH24:MI:SS')) >= trunc(SYSDATE - 1)
ORDER BY elapsed_time DESC)
WHERE ROWNUM <= 5;
- name: noLabels
type: exists
query: SELECT 1 FROM DUAL
metricName: no_labels
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment