Comments (8)
Value field must be a integer and not a string. I guess you need to remove the decode call.
from oracledb_exporter.
Here the correct request:
[[metric]]
context = "rman_backup_status"
labels = [ "start_time", "input_type" ]
metricsdesc = { value="Gauge metric with rman backup status (5:FAILED; 4:RUNNING WITH ERRORS; 3:COMPLETED WITH ERRORS; 2:RUNNING WITH WARNINGS; 1:COMPLETED WITH WARNINGS; 0:COMPLETED)." }
request = "SELECT to_char(start_time, 'yyyy-mm-dd hh24:mi:ss') as start_time, input_type, status as value FROM v$rman_backup_job_details WHERE start_time = (SELECT max(start_time) FROM v$rman_backup_job_details)"
from oracledb_exporter.
SELECT
to_char(start_time, 'yyyy-mm-dd hh24:mi:ss') as start_time, input_type, status as value
FROM
v$rman_backup_job_details
WHERE
start_time = (SELECT max(start_time) FROM v$rman_backup_job_details)
from oracledb_exporter.
Thanks Yannig!
I know the Value field must be a integer,so I try to use the decode call to switch the value type such as 'FAILED' --> 5 , the Value field default type is varchar.
Actually, when I use the v$rman_status table,its seems to be ok,but i dont know why. em...
Sorry for disturbing.
Thanks again.
from oracledb_exporter.
Sorry, I miss the point. Did you try to add TO_NUMBER around decode ?
from oracledb_exporter.
Yeah,I have tried it, but still can't parse it.
from oracledb_exporter.
I had a similar problem with rman metrics and I did some testing. I can confirm that converting VALUE to integer solves the problem:
[[metric]]
context = "rman_backup_status"
labels = [ "start_time", "input_type" ]
metricsdesc = { value="Gauge metric with rman backup status (5:FAILED; 4:RUNNING WITH ERRORS; 3:COMPLETED WITH ERRORS; 2:RUNNING WITH WARNINGS; 1:COMPLETED WITH WARNINGS; 0:COMPLETED)." }
request = '''
SELECT to_char(start_time, 'yyyy-mm-dd hh24:mi:ss') as start_time
, input_type
, cast( decode(status, 'FAILED', 5, 'RUNNING WITH ERRORS', 4, 'COMPLETED WITH ERRORS', 3, 'RUNNING WITH WARNINGS', 2, 'COMPLETED WITH WARNINGS', 1, 0) as integer) as value
FROM v$rman_backup_job_details
WHERE start_time = (SELECT max(start_time) FROM v$rman_backup_job_details)
'''
Output:
# HELP oracledb_rman_backup_status_value Gauge metric with rman backup status (5:FAILED; 4:RUNNING WITH ERRORS; 3:COMPLETED WITH ERRORS; 2:RUNNING WITH WARNINGS; 1:COMPLETED WITH WARNINGS; 0:COMPLETED).
# TYPE oracledb_rman_backup_status_value gauge
oracledb_rman_backup_status_value{input_type="DB FULL",start_time="2019-09-12 09:48:43"} 5
I am new to Prometheus so correct me if I am wrong: Using input_type and start_time as labels is not the Prometheus way. It would be better to create three metrics:
oracledb_rman_lastbackup_result
oracledb_rman_lastbackup_type
oracledb_rman_lastbackup_starttime
from oracledb_exporter.
Yes, it is a good practice. You can not do calculations on a label.
from oracledb_exporter.
Related Issues (20)
- Update to latest version of golang.org/x/net due to security vulnerability HOT 2
- DATA_SOURCE_NAME EnvVar unparseable if password contains hash/pound/# symbol HOT 2
- Metrics not accesible from outside the container
- "unknown URL option: as" HOT 1
- level=error errorpingingoracle:="unknown URL option: connect_timeout" HOT 1
- Multiple remote source (DB oracle), one instance oracledb_exporter
- Oracle binaries in docker image too old for autonomous DB with TLS HOT 1
- caller=collector.go:262 level=error errorpingingoracle:="unknown URL option: wallet_location" HOT 5
- Data is not coming from prometheus to grafana
- panic: runtime error: invalid memory address or nil pointer dereference HOT 2
- Some sql queries are taking time to execute, cause of which none of the queries are scraping data in time.
- Requesting queries with different execution intervals HOT 1
- level=error errorpingingoracle:="missing port in address" HOT 7
- Where is the actual queries that are running from the default metrics? HOT 1
- docker hub version is too old (iamseth/oracledb_exporter)
- Allow using multiple environment variables like DATA_SOURCE_NAME to query different databases HOT 1
- ASM sysdba DATA_SOURCE_NAME wrong example in README.md
- Read data source from file (Docker secrets)
- Incorrect Tablespace values HOT 3
- Release 0.6.0 not satrt HOT 5
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from oracledb_exporter.