oracledb_exporter icon indicating copy to clipboard operation
oracledb_exporter copied to clipboard

How to use Multi-Target Support?

Open dmitriy-shleht opened this issue 10 months ago • 6 comments

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:[email protected]: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

dmitriy-shleht avatar May 03 '24 11:05 dmitriy-shleht

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.

valrusu avatar May 09 '24 16:05 valrusu

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.

bufanzey avatar May 31 '24 07:05 bufanzey

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

lucian-vanghele avatar Jun 25 '24 14:06 lucian-vanghele

@valrusu Is it possible to mask the password? Will the password be exposed in the Prometheus UI - under Targets Can scrape use wallet to obtain the password?

thomas-vt avatar Sep 10 '24 23:09 thomas-vt

You ca use oracle wallet instead of text password. Anyway, this is the password used by the exporter to connect to the oracle server, it has nothing to do with the scrapper or Prometheus UI. If you want to protect the /metrics endpoint with some form of authentication then you should read here: https://github.com/prometheus/exporter-toolkit/blob/master/docs/web-configuration.md

lucian-vanghele avatar Sep 11 '24 07:09 lucian-vanghele

@valrusu Is it possible to mask the password? Will the password be exposed in the Prometheus UI - under Targets Can scrape use wallet to obtain the password?

I was not able to use Oracle Wallet for passwords using this driver, but I did not spend too much time on it. It worked for me for other projects using the godror driver.

I'll update you if I get it set up. One issue is that I'd need a full client to create the wallet in the first place with mkstore.

valrusu avatar Oct 05 '24 14:10 valrusu