Skip to content
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

Oracle input plugin for database performance #831

Closed
abarban opened this issue Mar 11, 2016 · 22 comments
Closed

Oracle input plugin for database performance #831

abarban opened this issue Mar 11, 2016 · 22 comments
Labels
help wanted Request for community participation, code, contribution new plugin plugin/input 1. Request for new input plugins 2. Issues/PRs that are related to input plugins

Comments

@abarban
Copy link

abarban commented Mar 11, 2016

I'm looking for the ability to have statistical data / performace by Oracle.

I am analyzing two solutions:

A. Go live using driver as:

B. by a demon read in Java that expose the data in JSON

Both have positive and negative sides, the A may have a long latency due to the connection to be restored each time, the B would be an external object to Telegraf.

As always willing to test and development.

@sparrc
Copy link
Contributor

sparrc commented Mar 11, 2016

From the Telegraf point of view, A would be the way to go

@menardorama
Copy link
Contributor

By an Oracle Point of view, having frequent connection/disconnection is a bad practice for the listener.

@abarban
Copy link
Author

abarban commented Mar 11, 2016

The reason that move me to try a little demon with java, single connection and light SQL!
there is a project like https://sourceforge.net/projects/ashv/ that can be a start point.
But I think that can be so useful try both solutions.

how can I be most useful?

@menardorama
Copy link
Contributor

If you want to try the A solution, you can have a look at what I did on Postgres #792

Moving it to Oracle wouldn't be a big deal

I guess that you are trying to build a dashboard based on ASH ?

@abarban
Copy link
Author

abarban commented Mar 11, 2016

First milestone is to have a dashboard with Top Activity graphs on multiple Oracle instance, without detail on sessions and query.

I'm thinking about live monitoring with a way to build dashboard for applications stack (accelerator, application, db).

@sparrc
Copy link
Contributor

sparrc commented Mar 11, 2016

going with A, why would it have to do frequent connect/disconnect? couldn't the plugin just cache and hold onto a connection?

@abarban
Copy link
Author

abarban commented Mar 11, 2016

Sure! I must try how it could work on Go! ;) I'm a junior on it.

@menardorama
Copy link
Contributor

Didn't know it was possible.

Is it just by not closing the connection and add a defer close ?
Le 11 mars 2016 12:56, "Cameron Sparr" notifications@github.com a écrit :

going with A, why would it have to do frequent connect/disconnect?
couldn't the plugin just cache and hold onto a connection?


Reply to this email directly or view it on GitHub
#831 (comment)
.

@sparrc
Copy link
Contributor

sparrc commented Mar 11, 2016

just making the connection a field on the plugin struct

@menardorama
Copy link
Contributor

ok it's a bit out of the subject of the issue, but do you have a link of an example ?

@sparrc sparrc added the help wanted Request for community participation, code, contribution label Mar 24, 2016
@bbczeuz
Copy link
Contributor

bbczeuz commented May 30, 2016

I started writing a universal DB Query plugin. Just to avoid duplication: Has anybody else started working on such a plugin?

It's based on golang database/sql, so Oracle, Postgres, Mysql should be supported (tested: Oracle XE 12.1 via go-oci8). It supports dynamic tagging based on column names, multiple queries.
But it's my first golang project, so the design might not be very advanced (I'm a c++ guy). It's very alpha now, but it works for my case. I'll test larger datasets in the next weeks.

@sparrc
Copy link
Contributor

sparrc commented May 30, 2016

thanks @bbczeuz, you can also ask in the issue for a generic db query plugin: #352

@StianOvrevage
Copy link
Contributor

@abarban You might get some inspiration from scollectors oracle collector: https://github.com/bosun-monitor/bosun/blob/master/cmd/scollector/collectors/oracle.go . Haven't used it myself (yet) so I have no idea how applicable it is.

@desa
Copy link
Contributor

desa commented Jul 26, 2016

@sparrc what the status of this?

@sparrc
Copy link
Contributor

sparrc commented Jul 26, 2016

not planned for any upcoming release

@desa
Copy link
Contributor

desa commented Jul 26, 2016

Been getting a bunch of interest in it here today at capital one.

@bbczeuz
Copy link
Contributor

bbczeuz commented Jul 26, 2016

I have some running code in my fork (zseng_dev_sqlquery branch), but plan on changing the config architecture to something like the snmp plugin's. There are some non public commits in my internal repo that fix null handling.
One thing I didn't yet find a clean solution: Integrating the Oracle client, so no manual installation is needed or dynamically load some driver for Oracle DB.

@danielnelson
Copy link
Contributor

#2785

@danielnelson danielnelson added feature request Requests for new plugin and for new features to existing plugins and removed plugin request labels Aug 12, 2017
@OlegKorchagin
Copy link

OlegKorchagin commented Mar 16, 2019

As a workaround, you can use the "inputs.prometheus" plugin to work with prometheus "oracle DB exporter"

This is not very convenient (and in fact rather inconvenient), but it's acceptable as a temporary solution.

  1. install oracle instant client ( or full client )
  2. get exporter from github page
    https://prometheus.io/docs/instrumenting/exporters/
    https://github.com/iamseth/oracledb_exporter/releases
  3. create config for telegraf plugin ( inputs.prometheus )
[[inputs.prometheus]]
  urls = ["http://localhost:9161/metrics"]
  response_timeout = "3s"
  [inputs.prometheus.tags]
    db="DBNAME"
  1. create wrapper for exporter
cd /opt/prometheus_oracle_exporter
sudo ln -s /usr/lib/oracle/12.2/client64/lib/libclntsh.so.12.1 libclntsh.so.18.1
vim wrapper_oracledb_exporter.sh

there must be a credentials, connection string and LD_LIBRARY_PATH

#!/bin/bash

SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )"
cd "$SCRIPT_DIR"

ORA_CLIENT="/usr/lib/oracle/12.2/client64"
export LD_LIBRARY_PATH="$ORA_CLIENT/lib:$SCRIPT_DIR"
export DATA_SOURCE_NAME='db_login:db_password@ORACLE_CONNECTION_STRING'
./oracledb_exporter
  1. start wrapper, restart telegraf

  2. unfortunately, almost all performance metrics go to separate influxdb measurements

in some case it may be changed by replace "fieldtoappend" to "labels " in default-metrics.toml, but not all ....

@OlegKorchagin
Copy link

Also, I am not an expert in license compatibility, but it could be possible to borrow the code of this project ( also golang, MIT license ) for the plugin being created

https://github.com/iamseth/oracledb_exporter

@toni-moreno
Copy link
Contributor

toni-moreno commented Mar 16, 2019

Hi @OlegKorchagin , have you tested this one ? It seems a good starting point to get Oracle Performace metrics into influxdb.

https://github.com/rsolorzano2410/sqlcollector

You can see a config file example here.

https://github.com/rsolorzano2410/sqlcollector/blob/master/src/main/resources/conf/SQLCollector.xml

@unflag unflag mentioned this issue Dec 15, 2020
3 tasks
@sjwang90 sjwang90 added new plugin and removed feature request Requests for new plugin and for new features to existing plugins labels Jan 29, 2021
@sjwang90 sjwang90 added the plugin/input 1. Request for new input plugins 2. Issues/PRs that are related to input plugins label Jan 29, 2021
@sjwang90 sjwang90 changed the title proposal for Oracle input plugin Oracle input plugin for database performance Jun 16, 2021
@reimda
Copy link
Contributor

reimda commented Jul 25, 2022

We have heard reports of people successfully using https://github.com/bonitoo-io/telegraf-input-oracle to collect oracle performance data. It is listed in the external plugins doc. https://github.com/influxdata/telegraf/blob/master/EXTERNAL_PLUGINS.md#inputs

The dev team doesn't have plans to implement this as an internal plugin because many oracle go drivers require cgo or don't have acceptable licensing. There is also an external workaround so I'm closing this issue.

If anyone has a way around the licensing and gco problems and wants to implement an internal oracle plugin to improve usability or functionality over the external plugin, please submit a PR and we would be happy to review it.

@reimda reimda closed this as completed Jul 25, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted Request for community participation, code, contribution new plugin plugin/input 1. Request for new input plugins 2. Issues/PRs that are related to input plugins
Projects
None yet
Development

Successfully merging a pull request may close this issue.