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

[Feature Request] Programmatically Add new data source to existed database #108

Open
JerryChin opened this issue Oct 24, 2017 · 6 comments

Comments

@JerryChin
Copy link

Hey guys, I want to add new data source as application is running, is that anyone interested in implementing this?

@fbacchella
Copy link
Member

It's not going to be easy. The one disk format is using one row of all values for each time stamp. So it's not possible to add a column of datasource without rewriting the whole file. I have code that does a check at startup of the application and migrate to a new rrdb file when needed.

@JerryChin
Copy link
Author

JerryChin commented Nov 22, 2017

I've tried a solution offered by popozhu on Stack-overflow, but it seems that rrdtool DOESN'T work with rrd file created by rrd4j, what else can I do?

@JerryChin
Copy link
Author

JerryChin commented Nov 22, 2017

My business scenario is as follows:

I have several nodes which offer many web API services, all requests are tracked per API, later these request count and outcome(success or failed) are sent in batch to a central handler where all rrd updates are processed here via kafka.

All these APIs have a unique path which are used as data source name, it's likely we will add a new API later, and I need a way to migrate it to existed RRD database without shutdown the central handler.

@fbacchella
Copy link
Member

one rrd per api ?

@JerryChin
Copy link
Author

@fbacchella nope. it's one datasource per api, one rrd per node, like the following:
Files Hierarchy

/data/rrd/
               |node1-ServiceStat.rrd
               |...
               |nodeN-ServiceStat.rrd

every RRD definitions are like:

RrdDef rrdDef = new RrdDef("/data/rrd/node1-ServiceStat.rrd", System.currentTimeMillis() / 1000, 60);
rrdDef.addDatasource("api_path1", DsType.GAUGE, 120, 0, Double.MAX_VALUE);
rrdDef.addDatasource("....", DsType.GAUGE, 120, 0, Double.MAX_VALUE);
rrdDef.addDatasource("api_pathN", DsType.GAUGE, 120, 0, Double.MAX_VALUE);
add one or more archives;

the problem I have is I am not able to add new data source to existed rrd database (as new APIs are added).

nodes are served as load balance.

@JerryChin
Copy link
Author

JerryChin commented Feb 6, 2018

Hey, @fbacchella can you help to solve the issue? I really add new data source to existed RRD db.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants