Visualice postgresql stats with Timelion

I was wondering how to make a Timelion visualisation for PostgreSQL stats. I was able to config Metricbeat module and collect data, it is sending data every 30s.

How can I draw the delta of the field "postgresql.database.rows.updated" as this field shows the total count of updated rows (and not the real progress). I want to show the different values occurring during the process (in my case every 30 seconds).

Thanks
Juan Manuel

@timroes can we please get some help?

Thanks.
Bhavya

Hi Juan,

you can use that knowledge that every package is 30 seconds apart and build an expression, that looks around like the following:

.es(metric=sum:postgressql.database.rows.updated).subtract(.es(metric=sum:postgressql.database.rows.updated, offset=-30s))

That will always subtract the value of 30s before from the current value and thus you only see the change. I stripped out unnecessary things in that expression, so you might need to make sure your working on the right index and timefield.

Cheers,
Tim

1 Like

@timroes Thanks for the response! I've resolved the problem using "exist" expression.

.es(_exists_:postgresql.database.rows.inserted).if(eq, 0, null, .es(index=metricbeat*, ....

But in the end I learned using the visual constructor of Kibana and derivate aggregate function.

Thanks!

1 Like

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.