Skip to content

Conversation

@darora
Copy link
Contributor

@darora darora commented May 11, 2021

Adds postgres exporter, aws cli, protected behind a supabase_internal variable.

They're only built into the image when packer is invoked with the aforementioned variable set to true, e.g.:

$ packer build -timestamp-ui \ -var "ansible_arguments=--skip-tags,update-only,-v,-e,supabase_internal='true'" \ amazon-arm.json 
@darora darora requested a review from inian May 11, 2021 06:55
usage: "GAUGE"
description: "The number of active backends"

pg_stat_statements:
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This metric is probably the weirdest one here, in that it might be misleading unless you're paying attention to what the data means. Open to suggestions for better ones!

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This also requires pg_stat_statements to be enabled on the database (we should probably do this by default), so we should check that it doesn't fail drastically when it is disabled

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yup! Have that in one of the schemas that get initialized on the db.

There's not much we can do here in the way of checks; I think we'll implement that as a "get upset if you haven't received any data on this metric in the last 10 mins" sort of thign.

@@ -0,0 +1,27 @@
pg_database:
query: "SELECT SUM(pg_database_size(pg_database.datname)) / (1024 * 1024) as size_mb FROM pg_database"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

aha - this is great saves us fetching from their DB each time

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the pointer--will bring them in here

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I just realised that this is the generic "postgres" image (which anyone can use), so some of the auth/storage schema metrics will be irrelevant..

@inian
Copy link
Member

inian commented May 11, 2021

We might need to separate out the metrics which are specific to Supabase into our worker instead since these images also are pushed to AWS and DO marketplaces and we should figure out a way to keep those images as generic as possible.

@darora darora mentioned this pull request May 12, 2021
@inian
Copy link
Member

inian commented May 12, 2021

LGTM!

@dragarcia FYI the supabase-external variable needs to be set to false when building the marketplace images

@darora darora merged commit d26bec8 into develop May 12, 2021
@darora darora deleted the da/add-exporter branch May 12, 2021 05:01
damonrand pushed a commit to cepro/postgres that referenced this pull request Jun 15, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

4 participants