pganalyze / collector

pganalyze statistics collector for gathering PostgreSQL metrics and log data
https://pganalyze.com
Other
329 stars 56 forks source link

Configuring Log Insights for pganalyze runnning on kubernetes pod #554

Open jahnavisana2812 opened 1 month ago

jahnavisana2812 commented 1 month ago

Hi, We are currently using the scaled version of pganalyze.I've set up the pganalyze collector using a Docker file and created a deployment, but I'm encountering issues accessing the logs from the PostgreSQL cluster due to permission restrictions (700 permissions on /pgdata/pg16). To work around this, I'm running a cron job to copy the log folder every 30 minutes and set the log location accordingly. However, it seems that the collector isn't able to properly access this location, and I'm not seeing the log insights. There's an error in the pganalyze container logs. Please help me resolve this?

Error:

E [default] Error uploading to S3: Post
"https://api.pganalyze.com/v2/snapshots/upload": POST
https://api.pganalyze.com/v2/snapshots/upload giving up after 1
attempt(s): context deadline exceeded
E [default] Could not collect activity for server: failed to
upload/send activity snapshot: Post
"https://api.pganalyze.com/v2/snapshots/upload": POST
https://api.pganalyze.com/v2/snapshots/upload giving up after 1
attempt(s): context deadline exceeded
lfittl commented 1 month ago

The error you're seeing in the collector logs appears to be related to a network problem, rather than something else - but its a bit hard to tell for sure.

You may find the documentation at https://pganalyze.com/docs/log-insights/setup/self-managed/troubleshooting#collector-test-error-permission-denied helpful - note that the pganalyze collector will typically run as the "pganalyze" user, which may need to be granted permissions on the log directory.

If this doesn't help resolve the issue I would recommend opening a support ticket and sharing a longer excerpt of the log output there, to help us understand what the issue is.