-
- Notifications
You must be signed in to change notification settings - Fork 212
Add postgres exporter #41
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
ansible/files/queries.yml Outdated
| usage: "GAUGE" | ||
| description: "The number of active backends" | ||
| | ||
| pg_stat_statements: |
There was a problem hiding this comment.
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!
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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" | |||
There was a problem hiding this comment.
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
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We have a few queries in here which could also be useful for tracking usage
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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..
| 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. |
| LGTM! @dragarcia FYI the supabase-external variable needs to be set to false when building the marketplace images |
Adds postgres exporter, aws cli, protected behind a
supabase_internalvariable.They're only built into the image when packer is invoked with the aforementioned variable set to true, e.g.: