Skip to content

Adding scrapeinterval to metric stops it being collected #172

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
jasonhill-ds opened this issue Jan 22, 2025 · 1 comment
Open

Adding scrapeinterval to metric stops it being collected #172

jasonhill-ds opened this issue Jan 22, 2025 · 1 comment
Assignees

Comments

@jasonhill-ds
Copy link

jasonhill-ds commented Jan 22, 2025

Have deployed exporter using Docker Compose and passed --scrape.interval=15s as below:

  exporter-oracle:
    image: container-registry.oracle.com/database/observability-exporter:1.5.2
    container_name: exporter-oracle
    command: '--scrape.interval=15s'
    ports:
      - 9161:9161
    restart: unless-stopped
    environment:
      - DB_USERNAME=****
      - DB_PASSWORD=****
      - DB_CONNECT_STRING=*****/****
      - CUSTOM_METRICS=/exporter/txeventq-metrics.toml,/exporter/more-txeventq-metrics.toml
    volumes:
      - ./exporter-oracle:/exporter
    networks:
      - monitoring

The container runs with the commandline arg set as expected:

bash-4.4# ps -ef
UID          PID    PPID  C STIME TTY          TIME CMD
1000           1       0  0 03:39 ?        00:00:00 /oracledb_exporter --scrape.interval=15s

Have metric in default-metrics.toml defined as below:

[[metric]]
context = "tablespace"
labels = [ "tablespace", "type" ]
metricsdesc = { bytes = "Generic counter metric of tablespaces bytes in Oracle.", max_bytes = "Generic counter metric of tablespaces max bytes in Oracle.", free = "Generic counter metric of tablespaces free bytes in Oracle.", used_percent = "Gauge metric showing as a percentage of how much of the tablespace has been used." }
request = '''
SELECT
    dt.tablespace_name as tablespace,
    dt.contents as type,
    dt.block_size * dtum.used_space as bytes,
    dt.block_size * dtum.tablespace_size as max_bytes,
    dt.block_size * (dtum.tablespace_size - dtum.used_space) as free,
    dtum.used_percent
FROM  dba_tablespace_usage_metrics dtum, dba_tablespaces dt
WHERE dtum.tablespace_name = dt.tablespace_name
and dt.contents != 'TEMPORARY'
union
SELECT
    dt.tablespace_name as tablespace,
    'TEMPORARY' as type,
    dt.tablespace_size - dt.free_space as bytes,
    dt.tablespace_size as max_bytes,
    dt.free_space as free,
    ((dt.tablespace_size - dt.free_space) / dt.tablespace_size)
FROM  dba_temp_free_space dt
order by tablespace
'''
scrapeinterval = "2m"

However, the tablespace metric never appears to get scraped. Other metrics without a scrapinterval set get scraped (on request) as expected.

@anders-swanson anders-swanson self-assigned this Jan 23, 2025
@anders-swanson
Copy link
Member

Thanks for reporting this, we're taking a look.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants