oracle / oracle-db-appdev-monitoring

Metrics exporter and samples for unified observability for data-centric app dev and microservices
http://developer.oracle.com/microservices
Other
78 stars 23 forks source link

Wrong path in LD_LIBRARY_PATH and ORACLE_HOME #136

Closed AOzhogin closed 3 weeks ago

AOzhogin commented 1 month ago

Hi, Image: amd64 container-registry.oracle.com/database/observability-exporter:1.5.0 id: 7a38e0ddd3e6 Registry: container-registry.oracle.com DB: Oracle 19.0.0.0.0

Problem: I noticed errors in the container log and decided to take a look, as a result I came across a problem with the paths, but i dont fix my problem.

1. caller=collector.go:346 level=error msg="Error scraping metric" Context=activity MetricsDesc="map[value:Generic counter metric from v$sysstat view in Oracle.]" time=44.085579ms error="**driver: bad connection**"
2. caller=collector.go:346 level=error msg="Error scraping metric" Context=db_platform MetricsDesc="map[value:Database platform]" time=48.104538ms error="driver: bad connection"
3. caller=collector.go:346 level=error msg="Error scraping metric" Context=db_system MetricsDesc="map[value:Database system resources metric]" time=1.375944ms error="driver: bad connection"

Other database queries are working.

bash-4.4$ env
>   LD_LIBRARY_PATH=/usr/lib/oracle/21/client64/lib
    CUSTOM_METRICS=/exporter/custom_metrics.toml
>   ORACLE_HOME=/usr/lib/oracle/21/client64
    HOSTNAME=f4fa135a9694
    VERSION=1.0.0
    PWD=/
    HOME=/
    DB_PASSWORD=any_pwd
    DEBIAN_FRONTEND=noninteractive
    DB_CONNECT_STRING=(DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=any_host)(PORT=1521))(CONNECT_DATA=(SID=any_sid)))
    TERM=xterm
    DB_USERNAME=any_user
    SHLVL=1
>   PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/lib/oracle/21/client64/bin
    _=/usr/bin/env

bash-4.4$ cd /usr/lib/oracle/
bash-4.4$ ls -la
    total 12
    drwxr-xr-x 3 root root 4096 Sep 30 17:51 .
    dr-xr-xr-x 1 root root 4096 Sep 30 17:51 ..
    drwxr-xr-x 3 root root 4096 Sep 30 17:51 19.23

bash-4.4$ ls 19.23/
    client64

bash-4.4$ ls 19.23/client64/
    bin  lib
markxnelson commented 1 month ago

Hi @AOzhogin Thanks for reporting this issue. I am pretty sure this is just becuase of the difference between the arm and amd versions of instant client - they put the .so files in different directories, so we added both paths so it would work on either architecture.
I will double check on this to make sure everything is working as expected and update this issue. Thanks!

markxnelson commented 3 weeks ago

checked on this, and fixed in 1.5.1

markxnelson commented 3 weeks ago

I think this is fixed now, will close this issue. Please reopen if you still see problems. Thanks very much for reporting the issue.