Skip to content

[BUG] scrapeinterval still being ignored on metrics #369

@ristagg

Description

@ristagg

Description

We configured a metric to scrape once every hour but whenever we ask for metrics, the interval is ignored and the metric runs again.

Steps to Reproduce

Create metric:

[[metric]]
context = "rs_time_24hours"
metricsdesc = { uptime_hours="uptime"}
request = "select /* TESTING2 */ round((sysdate-cast(startup_time as date))*24,2) as uptime_hours from v$instance"
ignorezeroresult = true
scrapeinterval = "60m"

Run exporter and check via curl or http request for the metric.

Expected Behavior

Metric should scrape once per hour

Actual Behavior

Metrics scrapes everytime we call the curl or http request.

Environment

  • OS: MacOSX
  • Oracle Database version: 19.28
  • Exporter version: 2.0.4

Screenshots / Logs

time=2025-09-26T14:25:57.589+01:00 level=INFO source=main.go:75 msg="FREE_INTERVAL end var is not present, will not periodically attempt to release memory"
time=2025-09-26T14:25:57.589+01:00 level=INFO source=main.go:82 msg="RESTART_INTERVAL env var is not present, so will not restart myself periodically"
time=2025-09-26T14:25:57.590+01:00 level=WARN source=config.go:203 msg="Configuring default database from CLI parameters is deprecated. Use of the '--config.file' argument is preferred. See https://github.com/oracle/oracle-db-appdev-monitoring?tab=readme-ov-file#standalone-binary"
time=2025-09-26T14:25:57.590+01:00 level=INFO source=collector.go:68 msg="Initializing database" database=default
time=2025-09-26T14:25:57.590+01:00 level=DEBUG source=database.go:131 msg="Launching connection to localhost:31545/opera_ateam_alpha.snsr0dvc0545.vcnphxcnedvcext.oraclevcn.com" database=default
time=2025-09-26T14:25:57.592+01:00 level=DEBUG source=database.go:138 msg="external authentication set to false" database=default
time=2025-09-26T14:25:57.592+01:00 level=INFO source=database.go:144 msg="Using Username/Password Authentication." database=default
time=2025-09-26T14:25:57.592+01:00 level=DEBUG source=database.go:191 msg="set max idle connections to 1374390452328" database=default
time=2025-09-26T14:25:57.592+01:00 level=DEBUG source=database.go:193 msg="set max open connections to 1374390452336" database=default
time=2025-09-26T14:25:57.592+01:00 level=DEBUG source=database.go:196 msg="Successfully configured connection to localhost:31545/opera_ateam_alpha.snsr0dvc0545.vcnphxcnedvcext.oraclevcn.com" database=default
time=2025-09-26T14:26:00.421+01:00 level=INFO source=database.go:211 msg="Connected as SYSDBA? FALSE" database=default
time=2025-09-26T14:26:16.587+01:00 level=DEBUG source=database.go:122 msg="Warmed connection pool" total=10 database=default
time=2025-09-26T14:26:16.758+01:00 level=DEBUG source=collector.go:245 msg="Successfully pinged Oracle database: localhost:31545/opera_ateam_alpha.snsr0dvc0545.vcnphxcnedvcext.oraclevcn.com" database=default
time=2025-09-26T14:26:16.760+01:00 level=DEBUG source=collector.go:259 msg="About to scrape metric" Context=rs_time_24hours MetricsDesc="map[uptime_hours:SQL statement elapsed time running]" MetricsType=map[] MetricsBuckets=map[] Labels=[] FieldToAppend="" IgnoreZeroResult=true Request="select /* TESTING2 */ round((sysdate-cast(startup_time as date))*24,2) as uptime_hours from v$instance\n" database=default
time=2025-09-26T14:26:16.760+01:00 level=DEBUG source=collector.go:423 msg="Calling function ScrapeGenericValues()"
time=2025-09-26T14:26:16.760+01:00 level=DEBUG source=collector.go:431 msg=labels !BADKEY=map[database:default]
time=2025-09-26T14:26:16.760+01:00 level=DEBUG source=collector.go:521 msg="Calling function GeneratePrometheusMetrics()"
time=2025-09-26T14:26:16.929+01:00 level=DEBUG source=collector.go:445 msg="Query result" value=758.38
time=2025-09-26T14:26:16.930+01:00 level=DEBUG source=collector.go:523 msg="ScrapeGenericValues() - metricsCount: 1"
time=2025-09-26T14:26:16.930+01:00 level=DEBUG source=collector.go:307 msg="Successfully scraped metric" Context=rs_time_24hours MetricDesc="map[uptime_hours:SQL statement elapsed time running]" duration=169.733375ms database=default
time=2025-09-26T14:26:16.930+01:00 level=INFO source=main.go:124 msg="Starting oracledb_exporter" version=2.0.4
time=2025-09-26T14:26:16.930+01:00 level=INFO source=main.go:125 msg="Build context" build="(go=go1.25.1, platform=darwin/arm64, user=, date=, tags=unknown)"
time=2025-09-26T14:26:16.930+01:00 level=INFO source=main.go:126 msg="Collect from: " metricPath=/metrics
time=2025-09-26T14:26:16.930+01:00 level=INFO source=main.go:177 msg="log.disable set to 1, so will not export the alert logs"
time=2025-09-26T14:26:16.934+01:00 level=INFO source=tls_config.go:347 msg="Listening on" address=[::]:9161
time=2025-09-26T14:26:16.934+01:00 level=INFO source=tls_config.go:350 msg="TLS is disabled." http2=false address=[::]:9161

Metadata

Metadata

Labels

bugSomething isn't working

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions