Comments (4)
Hi @shingou0120, I'm sorry for the late response - had many things around.
Generally, any database that has a driver in golang, supporting sql/database
interface, and supported by dburl
can be used by sql_exporter
.
Following your case I found next things:
-
Oracle DB is supported. 👍 The suitable driver for Oracle DB is likely https://github.com/sijms/go-ora.
-
As for IBM DB2 - it's a bit tricky. There is a driver written in go, but it's not supported by
dburl
dependency, so a pull request is needed on the upstream.
These drivers are rather specific, and aren't available out of the box, but it's not difficult to add them (one of them at the moment):
- add a driver to one of the maps here
- generate
drivers.go
by runningmake drivers-all
command - once
drivers.go
is generated, you can compile the binary withmake build
- done.
P.S. You can also create the binary only with custom drivers - populate the list custom
, and run make drivers-custom
before compiling the binary.
Let me know if you have any questions, I'm happy to assist. 👍
from sql_exporter.
Hey @burningalchemist ,
yes seems like the issue was by not using the v2 version of the oracle driver.
Thanks a lot for the lightning fast response and it is working like a charm now.
And keeping this project lightweight does make sense and if there is the possibility to add own drivers then it is more than perfect.
Thanks!
from sql_exporter.
Hey @burningalchemist,
I added the driver you mentioned to custom
section, did the make
for drivers-custom
and after that the build
.
After installing the binary and adding oracle://...
to the connection string I get the following error on execution of the binary:
sql: unknown driver \"oracle\" (forgotten import?)"
Do you know what I did wrong?
Is there any way for you to add the mentioned oracle driver directly to this project?
from sql_exporter.
Hey @JustNZ,
I just tested it, and it works fine. It's also that you need to use github.com/sijms/go-ora/v2
. This might be the cause of your issue.
Here's a short screencast, hope it helps:
Kapture.2023-08-22.at.17.08.40.mp4
As for adding oracle
driver by default - it's unlikely, since there's no way to test it, it also increases the application footprint, which is against the idea of this app - to be lightweight and simple. It's also a pretty niche solution. I'm also considering moving previously added Vertica
and Snowflake
drivers off.
I think adding a simple guide to add your own driver is the best option as it gives control and flexibility.
from sql_exporter.
Related Issues (20)
- Different collector file for each differrent job HOT 1
- Allow to set metric timestamp from query results
- Caching context deadline exceeded result HOT 6
- Context Deadline Exceeded HOT 9
- Support for MSSQL named pipe (np:) and shared memory (lpc:) DSNs HOT 16
- `up` metric to show that database connection was successful HOT 5
- parameter to set log file location HOT 8
- Add custom metrics to expose MSSQL server hostname HOT 1
- can we have the Postgres collector yml file example
- Is it possible to distinguish between the sql exporter process status and the target database? HOT 3
- Scrape each job separately HOT 2
- [helm] Support getting data-source-name from an existing secret HOT 12
- Ignore no rows returned HOT 6
- Better handling of NULL return values in certain cases HOT 6
- Environment variable substitution for DSN's HOT 3
- Cache Mechanism for sql exporter HOT 2
- clickhouse `context deadline exceeded` HOT 1
- Helm chart improvement: additionalContainers HOT 5
- Can it support the collection of cloud databases HOT 1
- unable to use -web.listen.address flag HOT 4
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from sql_exporter.