Visualize, discover, and act on your data with metric visualizations and dashboards.
Ready to get the most from the data that's stored in your PostgreSQL database? Get started by adding some data feeds. When you're finished adding PostgreSQL data feeds, you'll use them to power your metrics.
This article includes:
- Should I create data feeds or connect directly to my PostgreSQL warehouse?
- Adding a PostgreSQL data feed
- Creating PostgreSQL metrics
Should I create data feeds or connect directly to my PostgreSQL warehouse?
In PowerMetrics you can connect to your PostgreSQL warehouse and create either data warehouse metrics or data feed metrics. Which solution is better for you and your data?
-
Data warehouse metrics are the recommended solution for database and data warehouse infrastructures. They may be right for you if you have a lot of data and want scalability (the amount of data that can be handled is only limited by the capacity of your warehouse), have stringent security policies (data is stored and managed in your data warehouse) and demand higher performance (performance can be optimized by tuning your warehouse).
- Data feed metrics are primarily used to connect to services using REST API to get data. They may be right for you if you process small amounts of data (the maximum data feed size is 10 MB. Each time the raw data is queried it needs to fit within this limit after the transformations are defined in the feed) and want a mixed storage model (metric history and data are stored in the metric layer in PowerMetrics and in the warehouse).
Adding a PostgreSQL data feed
If you’re using Network Policies to restrict IP access, before adding a data feed, make sure you've added our PowerMetrics IP addresses to your allow list. See the full list of PowerMetrics' Allow list IP addresses.
To add a PostgreSQL data feed:
- Add a new data feed by clicking the + button beside Data Feeds in the left navigation bar.
- Click Select data.
- On the Where is your data? page, click PostgreSQL.
- Select a pre-built or custom connection to use for your data feed.
- On the Configure data service page, fill in the following fields:
- Host: Enter the host name of the server.
- Port: 5432 is entered here by default.
- Database: Enter the name of the database you want to access.
- Driver: Select the desired driver.
- Username: Enter the PostgreSQL user name (one with a role that has access to the database).
- Password: Enter the password associated with the user name.
- SQL Query: Enter a query, replacing <databaseTable> with your data.
- At Columns, choose to include or exclude column headers.
- At Connection security, if you select Use SSL/TLS, optionally also select to Turn off certificate validation (not recommended) or Use TLS v1.2. Note: Choices here depend on the selected driver.
- If the database is behind a firewall but accessible using an SSH tunnel, click Use an SSH Tunnel and enter the required credentials.
- Click Get data.
- Ensure this is the data you're looking for, then click Continue.
- You're taken to the data feed editor, where you can make changes to the data feed or save it as-is. If you want to modify the data feed, go to this article for detailed editing information.
- Give the data feed a name and, optionally, enter a description.
- Click Save data feed.
The data feed is added to your account and is ready to use for custom metrics. To see a list of all your data feeds, click Data Feeds in the left navigation sidebar.
Creating PostgreSQL metrics
Now that you've created one or more PostgreSQL data feeds, you can return to them and use them to make metrics. A single data feed can be used to create a single or multiple metrics.
To create PostgreSQL metrics:
- In the left navigation sidebar, click Data Feeds to open your list of data feeds.
- Select the PostgreSQL data feed you want to use for your metric.
- Click either the +Add metric button in the top right corner of the window or open the Metrics tab and click +Add metric. (See below.)
-
Choose settings for your metric and click Save metric. If you need help, go here to learn more.
The metric is added to your list of metrics, accessed by clicking Metrics in the left navigation sidebar.