Coder Social home page Coder Social logo

Success callback about collector HOT 4 CLOSED

pganalyze avatar pganalyze commented on May 28, 2024
Success callback

from collector.

Comments (4)

lfittl avatar lfittl commented on May 28, 2024

@jglapa Interesting idea!

I wonder if you could check the modified time of the state file (typically at /var/lib/pganalyze-collector/state) and alert if its older than e.g. 15 minutes?

from collector.

jglapa avatar jglapa commented on May 28, 2024

From what I see the file /var/lib/pganalyze-collector/state is getting modified every run although the data is not submitted to pganalyze.

I'm currently troubleshooting the following problem:

  • I have a postgresql 9.6 installation on AWS RDS
  • I've configured everything as described in the manual
  • I'm using the newest collector
  • but when I run the collector with --dry-run I'm getting the following:
2017/04/21 15:07:25 V [xxx] Detected PostgreSQL Version 90601 (PostgreSQL 9.6.1 on x86_64-pc-linux-gnu, compiled by gcc (GCC) 4.8.2 20140120 (Red Hat 4.8.2-16), 64-bit)
2017/04/21 15:07:25 V [xxx] Found pganalyze.get_stat_statements() stats helper
2017/04/21 15:07:25 E [xxx] Error collecting pg_stat_statements
2017/04/21 15:07:25 E [xxx] Could not process database: pq: pg_stat_statements must be loaded via shared_preload_libraries

This must be an RDS issue since I've configured the shared_preload_libraries=pg_state_statements correctly in parameter group but psql shows rdsutils... ?,

([email protected]:5432) [test]  [] > \dx
                                     List of installed extensions
        Name        | Version |   Schema   |                        Description
--------------------+---------+------------+-----------------------------------------------------------
 pg_stat_statements | 1.4     | public     | track execution statistics of all SQL statements executed
 plpgsql            | 1.0     | pg_catalog | PL/pgSQL procedural language
(2 rows)


([email protected]:5432) [test]  [] > show shared_preload_libraries;
 shared_preload_libraries
--------------------------
 rdsutils
(1 row)

([email protected]:5432) [test]  [] > select * from pg_stat_statements ;
ERROR:  pg_stat_statements must be loaded via shared_preload_libraries
Time: 165.208 ms

Anyhow with this issue in place the /var/lib/pganalyze-collector/state mtime is still getting changed although an error is raised.

from collector.

lfittl avatar lfittl commented on May 28, 2024

@jglapa Fair point - for the specific issue you are seeing, first check that you have restarted your RDS server (otherwise changes to shared_preload_libraries don't take effect). We've also sometimes seen problems where RDS has an internal problem, and typically updating to the next minor PostgreSQL release fixed that.

On the success callback - I'm currently thinking we just make it --success-callback=/path/to/shell/script.sh, which gets triggered once for each server, with the first and only argument being the name of the server (as per the collector config file). That sound reasonable?

from collector.

jglapa avatar jglapa commented on May 28, 2024

--success-callback=/path/to/shell/script.sh

And how would we configure that?
This would require changing collector startup scripts (upstart right now)?

I was more thinking about a new property in the pganalyze-collector.conf file.

Passing the db config name when calling the script sound like a very good idea!

In my case I could either have 2 separate shell script( I have 2 db's) and simply ignore the passed parameter or have one script and make the distinction based on the parameter passed.

from collector.

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.