Giter Club home page Giter Club logo

Comments (18)

Jan-M avatar Jan-M commented on August 29, 2024

Are the stored procedures in a seperate schema? Are they plpgsql functions?

In theory as far as your config for that database is set to monitor sproc metrics at a given interval the data should be gathered.

from pgobserver.

kmoppel avatar kmoppel commented on August 29, 2024

the problem is most probably that currently "by default" only data from schemas named '%_api%' or '%_data' is gathered...so most probably you need to tailor the query from https://github.com/zalando/PGObserver/blob/master/gatherer/src/main/java/de/zalando/pgobserver/gatherer/SprocGatherer.java to meet your needs

...pg_namespace WHERE nspname LIKE '%_api%' ) apis ( name, rank ) where rank <= 2 ) OR schemaname LIKE '%_data'...

from pgobserver.

viperfx avatar viperfx commented on August 29, 2024

@Jan-M Yes the stored procedures are spread across different schemas on the database I am monitoring. They are plpgsql functions, yes.

from pgobserver.

Jan-M avatar Jan-M commented on August 29, 2024

As Kaarel mentioned the public gatherer contained our filter, I was somehow under the impression this is not the case. I have moved this filter to the config file where you can change/amend/remove it with the latest commit.

Can you give this a try?

from pgobserver.

viperfx avatar viperfx commented on August 29, 2024

I have set the deafult filter to this in the config file in my home folder. Compiled the files again and ./run.sh.
"default_schema_filter":""

I tried this and I thought this would be generic enough to catch all the sprocs in the database I am monitoring. However, it is still not populating any sprocs. Does it take time to populate? Even the 'Show all sprocs' does not show anything.

from pgobserver.

Jan-M avatar Jan-M commented on August 29, 2024

That is not good news, we will take a look into why this is happening.

from pgobserver.

Jan-M avatar Jan-M commented on August 29, 2024

Maybe you can do one more thing, check whether querying the view "pg_stat_user_functions" with the specified user does indeed yield any functions.

from pgobserver.

viperfx avatar viperfx commented on August 29, 2024

@Jan-M Yep! Using the pgobserver_gatherer user, I cannot view all the queries in pg_stat_statements. It shows .
Where is pg_stat_user_functions view located?

from pgobserver.

Jan-M avatar Jan-M commented on August 29, 2024

With my user I am able to run basically:

select * from pg_stat_user_functions;

What PG version are you running?

from pgobserver.

viperfx avatar viperfx commented on August 29, 2024

I am using PostgreSQL 9.3.5. I ran that query across many different users. I tried on the command line as postgres using psql too and all of them returned 0 rows. The table is there but it seems to be empty.

from pgobserver.

Jan-M avatar Jan-M commented on August 29, 2024

My first guess is, that you need to enable track_functions

http://www.postgresql.org/docs/9.3/static/monitoring-stats.html

track_functions (enum)
Enables tracking of function call counts and time used. Specify pl to track only procedural-language functions, all to also track SQL and C language functions. The default is none, which disables function statistics tracking. Only superusers can change this setting.

from pgobserver.

viperfx avatar viperfx commented on August 29, 2024

Ah ok! Yep they all seem to be commented out. Are there any other options that need to be turned out to get the most out of PGObserver?

from pgobserver.

Jan-M avatar Jan-M commented on August 29, 2024

Similarly you need to enable the pg_stat_statement module if you in the future want to track statements. I will update our readme with a link to this page.

from pgobserver.

viperfx avatar viperfx commented on August 29, 2024

Yep, this module has been enabled. Like I said I queried this table but the gatherer user was not able to view all the fields. Some fields needed extra permissions it seems.

from pgobserver.

Jan-M avatar Jan-M commented on August 29, 2024

The new version that covers pg stat statements contains a function to query this table that uses the security definer setting, so the gatherer role itself does not need super users privs ( which is needed to see the query column ), only during deployment super user privs are needed.

from pgobserver.

Jan-M avatar Jan-M commented on August 29, 2024

I am closing this for now, feel free to give more feedback if you run into troubles.

from pgobserver.

viperfx avatar viperfx commented on August 29, 2024

@Jan-M Could you show me how I would go about filtering by the name of sproc? For e.g. exclude sproc with the substring 'pldbg'.

from pgobserver.

Jan-M avatar Jan-M commented on August 29, 2024

https://github.com/zalando/PGObserver/blob/master/gatherer/src/main/java/de/zalando/pgobserver/gatherer/SprocGatherer.java

As you can see in the above file we just append the filter string to the query, thus I would try to set the filter to:

AND NOT f.funcname like '%pldbg%'

from pgobserver.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.