iamseth / oracledb_exporter

Prometheus Oracle database exporter.
MIT License
472 stars 242 forks source link

How to use Multi-Target Support? #445

Open dmitriy-shleht opened 2 months ago

dmitriy-shleht commented 2 months ago

I have Oracle RAC, I would like to collect metrics from two instances (nodes, ora01 and ora02)

What is the current behavior?

I tried to specify them through a comma, but it does not work and I get a mistake ORA-12514: TNS:listener does not currently know of service requested in connect descriptor oracle://SVC_ORACLEDB_EXPORTER:12345@ora01.fgr.my:1521/odaodb,ora02.fgr.my:1521/odaodb

How do I need to set the connection string to two instances in the DSN ?

What is the expected behavior?

I thought to turn to the copies I needed as it is written in readme /scrape?target=ora01:1521 OR scrape?target=ora02:1521

Please tell us about your environment:

Kubernetes

oracledb_exporter Version: 0.6.0

valrusu commented 2 months ago

Hi, I used 2 targets under a single job in Prometheus, and started 2 scrapers, each pointing to one specific instance:

  - job_name: oracle_job_name
    scrape_interval: 60s
    static_configs:
    - targets: ['localhost:9161','localhost:9162']

DSN used: oracle://dbuser:password@server:1521/service?sid=sidname Used the scan name for server.

Hope this helps.

bufanzey commented 1 month ago

In fact, I haven't found a solution either. I've seen many others asking the same question, and it seems that this feature is not supported by default. If you have a better solution, please share it with me.

lucian-vanghele commented 2 weeks ago

@dmitriy-shleht you are mixing 2 features (both broken actually): multi target and the multi-host . you can also see #339 and #334