From 27e278c5837e5ce4f9022642057393aba25e46f0 Mon Sep 17 00:00:00 2001 From: atovpeko Date: Tue, 17 Dec 2024 14:25:44 +0200 Subject: [PATCH 01/39] draft --- _partials/_grafana-connect.md | 5 +- .../observability-alerting/grafana.md | 185 ++++++++++++++++++ .../grafana/create-dashboard-and-panel.md | 111 ----------- .../grafana/geospatial-dashboards.md | 66 ------- .../observability-alerting/grafana/index.md | 21 -- .../grafana/installation.md | 12 -- use-timescale/page-index/page-index.js | 28 +-- 7 files changed, 192 insertions(+), 236 deletions(-) create mode 100644 use-timescale/integrations/observability-alerting/grafana.md delete mode 100644 use-timescale/integrations/observability-alerting/grafana/create-dashboard-and-panel.md delete mode 100644 use-timescale/integrations/observability-alerting/grafana/geospatial-dashboards.md delete mode 100644 use-timescale/integrations/observability-alerting/grafana/index.md delete mode 100644 use-timescale/integrations/observability-alerting/grafana/installation.md diff --git a/_partials/_grafana-connect.md b/_partials/_grafana-connect.md index 6eecdf3c64..289b431ef7 100644 --- a/_partials/_grafana-connect.md +++ b/_partials/_grafana-connect.md @@ -3,8 +3,7 @@ import ImportPrerequisites from "versionContent/_partials/_migrate_import_prereq ## Add Timescale as a data source in Grafana -Grafana is and open source analytics and monitoring solution. You use Grafana to visualize queries -directly from your $SERVICE_LONG. +You use Grafana to visualize queries directly from your $SERVICE_LONG. ### Prerequisites @@ -12,7 +11,7 @@ directly from your $SERVICE_LONG. * Install self-managed Grafana, or sign up for [Grafana Cloud][install-grafana] -### Add your $SERVICE_LONG as a data source in Grafana +### Add your $SERVICE_LONG as a data source To connect the data in your $SERVICE_LONG to Grafana: diff --git a/use-timescale/integrations/observability-alerting/grafana.md b/use-timescale/integrations/observability-alerting/grafana.md new file mode 100644 index 0000000000..804eb0f5f7 --- /dev/null +++ b/use-timescale/integrations/observability-alerting/grafana.md @@ -0,0 +1,185 @@ +--- +title: Getting started with Grafana and Timescale +excerpt: Use Grafana to visualize time-series data stored in Timescale +products: [cloud] +keywords: [Grafana, visualizations, analytics, monitoring] +--- + +import GrafanaConnect from "versionContent/_partials/_grafana-connect.mdx"; + +# Get started with Grafana and Timescale + +Grafana is an analytics and monitoring tool that you can use to visualize time-series data. This page shows you how to set up Grafana with Timescale and create a dashboard and panel. It also provides an example of how to visualize geospatial data. + + + + +## Create a Grafana dashboard and panel + +Grafana is organized into `Dashboards` and `Panels`. A dashboard represents a +view into the performance of a system, and each dashboard consists of one or +more panels, which represent information about a specific metric related to +that system. + + + +1. **Create a new dashboard** + + Hover your mouse over the `+` icon in the far left of the Grafana user + interface to bring up a `Create` menu. Select `Dashboard`. When your new + dashboard is created, you'll see a `New Panel` screen, with options for + `Add Query` and `Choose Visualization`. In the future, if you already have a + dashboard with panels, you can click the `+` icon at the top of the Grafana + user interface to add a panel to an existing dashboard. + +1. **Click `Choose Visualization` to add a new panel** + + There are several options for different Grafana visualizations. This example uses the `Graph` + visualization. + +1. **Configure the panel** + + There are multiple ways to configure, but you can accept all the defaults to create a simple `Lines` graph. + +1. **Navigate to the `Queries` tab** + +1. **Set the query database to the dataset you are using** + +1. **Run your queries** + + You can edit the queries directly or use the built-in query editor. If you are visualizing time-series data, select + `Time series` in the `Format As` drop-down. + + + +### Use the time filter function + +Grafana time-series panels include a tool that lets you filter on a given time +range, called a time filter. Grafana allows you to link the user interface +construct in a Grafana panel with the query itself using the `$__timefilter()` +function. + +This example of a modified query uses the `$__timefilter()` function to set +the `pickup_datetime` column as the filtering range for your visualizations: + +```sql +SELECT + --1-- + time_bucket('1 day', pickup_datetime) AS "time", + --2-- + COUNT(*) +FROM rides +WHERE $__timeFilter(pickup_datetime) +``` + +### Reference elements in the query + +You can group your visualizations by the time buckets you've selected, +and order the results by the time buckets as well. So, the `GROUP BY` and +`ORDER BY` statements reference `time`. + +For example: + +```sql +SELECT + --1-- + time_bucket('1 day', pickup_datetime) AS time, + --2-- + COUNT(*) +FROM rides +WHERE $__timeFilter(pickup_datetime) +GROUP BY time +ORDER BY time +``` + +When you visualize this query in Grafana, you see this: + +Visualizing time-series data in Grafana + +You can adjust the `time_bucket` function and compare the graphs, like this: + +```sql +SELECT + --1-- + time_bucket('5m', pickup_datetime) AS time, + --2-- + COUNT(*) +FROM rides +WHERE $__timeFilter(pickup_datetime) +GROUP BY time +ORDER BY time +``` + +When you visualize this query, it looks like this: + + + +## Use Grafana to visualize geospatial data stored in Timescale + +Grafana includes a WorldMap visualization so you can see geospatial data +overlaid on a map. This can be helpful to understand how data +changes based on its location. + +### Build a geospatial query in Grafana + +This section visualizes taxi rides in Manhattan, where the distance traveled +was greater than 5 miles. It uses the same query as the [NYC Taxi Cab][nyc-taxi] +tutorial as a starting point. + + + +1. In your Grafana dashboard, create a new panel, select `New Visualization`, + and select `Worldmap Panel`. +1. Navigate to the `Queries` tab. +1. Select your data source. +1. In the `Format as` dropdown, select `Table`. Click `Edit SQL` and enter the + query you want to use. This examples uses this query: + + ```sql + SELECT time_bucket('5m', rides.pickup_datetime) AS time, + rides.trip_distance AS value, + rides.pickup_latitude AS latitude, + rides.pickup_longitude AS longitude + FROM rides + WHERE $__timeFilter(rides.pickup_datetime) AND + ST_Distance(pickup_geom, + ST_Transform(ST_SetSRID(ST_MakePoint(-73.9851,40.7589),4326),2163) + ) < 2000 + GROUP BY time, + rides.trip_distance, + rides.pickup_latitude, + rides.pickup_longitude + ORDER BY time + LIMIT 500; + ``` + +1. Configure the visualization by navigating to the `Visualization` tab. Make + sure the `Map Data Options` are set to `table` and `current`. +1. In the `Field Mappings` section, set the `Table Query Format` to `Table`. +1. Map the `Latitude Field` to the `latitude` variable, the `Longitude Field` + to the `longitude` variable, and the `Metric` field to the `value` variable. +1. In the `Map Visual Options` section, set the `Min Circle Size` to `1`, and + the `Max Circle Size` to `5`. +1. In the `Threshold Options` section, set the `Thresholds` to `2,5,10`. This + automatically configures a set of colors, which you can adjust later. + + + + + + + +[nyc-taxi]: /tutorials/:currentVersion:/nyc-taxi-cab +[grafana-website]: https://www.grafana.com +[install-grafana]: /use-timescale/:currentVersion:/integrations/observability-alerting/grafana/installation +[tutorial-grafana-dashboards]: /use-timescale/:currentVersion:/integrations/observability-alerting/grafana/create-dashboard-and-panel/ +[tutorial-grafana-geospatial]: /use-timescale/:currentVersion:/integrations/observability-alerting/grafana/geospatial-dashboards/ + diff --git a/use-timescale/integrations/observability-alerting/grafana/create-dashboard-and-panel.md b/use-timescale/integrations/observability-alerting/grafana/create-dashboard-and-panel.md deleted file mode 100644 index 64103b482e..0000000000 --- a/use-timescale/integrations/observability-alerting/grafana/create-dashboard-and-panel.md +++ /dev/null @@ -1,111 +0,0 @@ ---- -title: Create a Grafana dashboard and panel -excerpt: Visualize your data in Grafana -products: [cloud, mst, self_hosted] -keywords: [Grafana, visualizations, analytics] ---- - -# Creating a Grafana dashboard and panel - -Grafana is organized into `Dashboards` and `Panels`. A dashboard represents a -view into the performance of a system, and each dashboard consists of one or -more panels, which represents information about a specific metric related to -that system. - -## Create a new Grafana dashboard and panel - -Start by creating a new dashboard. - - - -### Creating a new Grafana dashboard and panel - -1. Hover your mouse over the `+` icon in the far left of the Grafana user - interface to bring up a `Create` menu. Select `Dashboard`. When you new - dashboard is created, you'll see a `New Panel` screen, with options for - `Add Query` and `Choose Visualization`. In the future, if you already have a - dashboard with panels, you can click the `+` icon at the top of the Grafana - user interface to add a panel to an existing dashboard. -1. Click `Choose Visualization` to add a new panel. There are several options - for different Grafana visualizations. This example uses the `Graph` - visualization. -1. There are multiple ways to configure the panel, but you can accept all the - defaults to create a simple `Lines` graph. -1. In the far left section of the Grafana user interface, navigate to the - `Queries` tab. -1. Set the query database to the dataset you are using. -1. You can edit the query directly, or use the built-in query editor. - - - If you are visualizing time series data in Grafana, make sure you select - `Time series` from the `Format As` drop down in the query builder. - - - - -## The time filter function - -Grafana time-series panels include a tool that lets you filter on a given time -range, called a time filter. Grafana allows you to link the user interface -construct in a Grafana panel with the query itself using the `$__timefilter()` -function. - -This example of a modified query uses the `$__timefilter()` function to set -the `pickup_datetime` column as the filtering range for your visualizations: - -```sql -SELECT - --1-- - time_bucket('1 day', pickup_datetime) AS "time", - --2-- - COUNT(*) -FROM rides -WHERE $__timeFilter(pickup_datetime) -``` - -## Referencing elements in the query - -You can group your visualizations by the time buckets you've selected, -and order the results by the time buckets as well. So, the `GROUP BY` and -`ORDER BY` statements reference `time`. - -For example: - -```sql -SELECT - --1-- - time_bucket('1 day', pickup_datetime) AS time, - --2-- - COUNT(*) -FROM rides -WHERE $__timeFilter(pickup_datetime) -GROUP BY time -ORDER BY time -``` - -When you visualize this query in Grafana, you see this: - -Visualizing time-series data in Grafana - -You can adjust the `time_bucket` function and compare the graphs, like this: - -```sql -SELECT - --1-- - time_bucket('5m', pickup_datetime) AS time, - --2-- - COUNT(*) -FROM rides -WHERE $__timeFilter(pickup_datetime) -GROUP BY time -ORDER BY time -``` - -When you visualize this query, it looks like this: - - diff --git a/use-timescale/integrations/observability-alerting/grafana/geospatial-dashboards.md b/use-timescale/integrations/observability-alerting/grafana/geospatial-dashboards.md deleted file mode 100644 index b6fca166f7..0000000000 --- a/use-timescale/integrations/observability-alerting/grafana/geospatial-dashboards.md +++ /dev/null @@ -1,66 +0,0 @@ ---- -title: Use Grafana to visualize geospatial data -excerpt: Create a Grafana visualization to see geospatial data on a map -products: [cloud, mst, self_hosted] -keywords: [Grafana, visualizations, analytics, geospatial data] ---- - -# Use Grafana to visualize geospatial data stored in Timescale - -Grafana includes a WorldMap visualization so you can see geospatial data -overlaid on a map. This can be helpful to understand how data -changes based on its location. - -## Build a geospatial query in Grafana - -This section visualizes taxi rides in Manhattan, where the distance traveled -was greater than 5 miles. It uses the same query as the [NYC Taxi Cab][nyc-taxi] -tutorial as a starting point. - - - -### Building a geospatial query in Grafana - -1. In your Grafana dashboard, create a new panel, select `New Visualization`, - and select `Worldmap Panel`. -1. Navigate to the `Queries` tab. -1. Select your data source. -1. In the `Format as` dropdown, select `Table`. Click `Edit SQL` and enter the - query you want to use. This examples uses this query: - - ```sql - SELECT time_bucket('5m', rides.pickup_datetime) AS time, - rides.trip_distance AS value, - rides.pickup_latitude AS latitude, - rides.pickup_longitude AS longitude - FROM rides - WHERE $__timeFilter(rides.pickup_datetime) AND - ST_Distance(pickup_geom, - ST_Transform(ST_SetSRID(ST_MakePoint(-73.9851,40.7589),4326),2163) - ) < 2000 - GROUP BY time, - rides.trip_distance, - rides.pickup_latitude, - rides.pickup_longitude - ORDER BY time - LIMIT 500; - ``` - -1. Configure the visualization by navigating to the `Visualization` tab. Make - sure the `Map Data Options` are set to `table` and `current`. -1. In the `Field Mappings` section, set the `Table Query Format` to `Table`. -1. Map the `Latitude Field` to the `latitude` variable, the `Longitude Field` - to the `longitude` variable, and the `Metric` field to the `value` variable. -1. In the `Map Visual Options` section, set the `Min Circle Size` to `1`, and - the `Max Circle Size` to `5`. -1. In the `Threshold Options` section, set the `Thresholds` to `2,5,10`. This - automatically configures a set of colors, which you can adjust later. - - - - - -[nyc-taxi]: /tutorials/:currentVersion:/nyc-taxi-cab diff --git a/use-timescale/integrations/observability-alerting/grafana/index.md b/use-timescale/integrations/observability-alerting/grafana/index.md deleted file mode 100644 index 2789929c02..0000000000 --- a/use-timescale/integrations/observability-alerting/grafana/index.md +++ /dev/null @@ -1,21 +0,0 @@ ---- -title: Getting started with Grafana and Timescale -excerpt: Use Grafana to visualize time-series data stored in Timescale -products: [cloud] -keywords: [Grafana, visualizations, analytics, monitoring] ---- - -# Getting Started with Grafana and Timescale - -[Grafana][grafana-website] is an analytics and monitoring tool that -you can use to visualize time-series data. This section shows you how to: - -* Set up [Timescale and Grafana][install-grafana]. -* Create a [Grafana dashboard and panel][tutorial-grafana-dashboards] to - visualize data in Timescale. -* Visualize [geospatial data in Grafana][tutorial-grafana-geospatial]. - -[grafana-website]: https://www.grafana.com -[install-grafana]: /use-timescale/:currentVersion:/integrations/observability-alerting/grafana/installation -[tutorial-grafana-dashboards]: /use-timescale/:currentVersion:/integrations/observability-alerting/grafana/create-dashboard-and-panel/ -[tutorial-grafana-geospatial]: /use-timescale/:currentVersion:/integrations/observability-alerting/grafana/geospatial-dashboards/ diff --git a/use-timescale/integrations/observability-alerting/grafana/installation.md b/use-timescale/integrations/observability-alerting/grafana/installation.md deleted file mode 100644 index bebf8e659f..0000000000 --- a/use-timescale/integrations/observability-alerting/grafana/installation.md +++ /dev/null @@ -1,12 +0,0 @@ ---- -title: Set up Timescale and Grafana -excerpt: Use Grafana to visualize your Timescale data -products: [cloud] -keywords: [Grafana, visualization, analytics] ---- - -import GrafanaConnect from "versionContent/_partials/_grafana-connect.mdx"; - -# Set up Timescale and Grafana - - diff --git a/use-timescale/page-index/page-index.js b/use-timescale/page-index/page-index.js index 4bfc0dde11..00bbf8f177 100644 --- a/use-timescale/page-index/page-index.js +++ b/use-timescale/page-index/page-index.js @@ -840,34 +840,16 @@ module.exports = [ excerpt: "Integrate your Timescale database with third-party observability and alerting solutions", children: [ - { - title: "Grafana", - href: "grafana", - excerpt: "Use Grafana with Timescale", - children: - [ - { - title: "Installing Grafana", - href: "installation", - excerpt: "Installing Grafana and connecting it to your Timescale service" - }, - { - title: "Create a Grafana dashboard and panel", - href: "create-dashboard-and-panel", - excerpt: "Create a Grafana dashboard and panel to display your Timescale data", - }, - { - title: "Use Grafana to visualize geospatial data", - href: "geospatial-dashboards", - excerpt: "Use Grafana to visualize geospatial data in Timescale", - }, - ] - }, { title: "Tableau", href: "tableau", excerpt: "Use Tableau with Timescale", }, + { + title: "Grafana", + href: "grafana", + excerpt: "Use Grafana with Timescale", + }, ] }, ], From c7621e09c79c8865bb822adbcffc6b5e5d41c72d Mon Sep 17 00:00:00 2001 From: atovpeko Date: Tue, 17 Dec 2024 17:34:30 +0200 Subject: [PATCH 02/39] draft --- use-timescale/page-index/page-index.js | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/use-timescale/page-index/page-index.js b/use-timescale/page-index/page-index.js index 00bbf8f177..8eb412c40c 100644 --- a/use-timescale/page-index/page-index.js +++ b/use-timescale/page-index/page-index.js @@ -840,16 +840,16 @@ module.exports = [ excerpt: "Integrate your Timescale database with third-party observability and alerting solutions", children: [ - { - title: "Tableau", - href: "tableau", - excerpt: "Use Tableau with Timescale", - }, { title: "Grafana", href: "grafana", excerpt: "Use Grafana with Timescale", }, + { + title: "Tableau", + href: "tableau", + excerpt: "Use Tableau with Timescale", + } ] }, ], From e2bd4b7c9bdedfa49feb668e0341765aa0e3c374 Mon Sep 17 00:00:00 2001 From: atovpeko Date: Tue, 17 Dec 2024 21:24:31 +0200 Subject: [PATCH 03/39] draft --- use-timescale/integrations/observability-alerting/grafana.md | 3 --- 1 file changed, 3 deletions(-) diff --git a/use-timescale/integrations/observability-alerting/grafana.md b/use-timescale/integrations/observability-alerting/grafana.md index 804eb0f5f7..748bc22798 100644 --- a/use-timescale/integrations/observability-alerting/grafana.md +++ b/use-timescale/integrations/observability-alerting/grafana.md @@ -13,7 +13,6 @@ Grafana is an analytics and monitoring tool that you can use to visualize time-s - ## Create a Grafana dashboard and panel Grafana is organized into `Dashboards` and `Panels`. A dashboard represents a @@ -175,8 +174,6 @@ alt="Visualizing time series data in PostgreSQL using the Grafana Worldmap"/> - - [nyc-taxi]: /tutorials/:currentVersion:/nyc-taxi-cab [grafana-website]: https://www.grafana.com [install-grafana]: /use-timescale/:currentVersion:/integrations/observability-alerting/grafana/installation From d5f90856d78913f8f185b5f8cbf0f8f519a73b10 Mon Sep 17 00:00:00 2001 From: atovpeko Date: Tue, 17 Dec 2024 22:16:26 +0200 Subject: [PATCH 04/39] draft --- _partials/_grafana-connect.md | 2 +- .../observability-alerting/grafana.md | 69 +++++++++---------- 2 files changed, 34 insertions(+), 37 deletions(-) diff --git a/_partials/_grafana-connect.md b/_partials/_grafana-connect.md index 289b431ef7..101203560c 100644 --- a/_partials/_grafana-connect.md +++ b/_partials/_grafana-connect.md @@ -19,7 +19,7 @@ To connect the data in your $SERVICE_LONG to Grafana: 1. **Log in to Grafana** - In your browser, log in to either : + In your browser, log in to either: - Self-hosted Grafana: at `http://localhost:3000/`. The default credentials are `admin`, `admin`. - Grafana Cloud: use the URL and credentials you set when you created your account. 1. **Add your $SERVICE_LONG as a data source** diff --git a/use-timescale/integrations/observability-alerting/grafana.md b/use-timescale/integrations/observability-alerting/grafana.md index 748bc22798..644216ad24 100644 --- a/use-timescale/integrations/observability-alerting/grafana.md +++ b/use-timescale/integrations/observability-alerting/grafana.md @@ -15,7 +15,7 @@ Grafana is an analytics and monitoring tool that you can use to visualize time-s ## Create a Grafana dashboard and panel -Grafana is organized into `Dashboards` and `Panels`. A dashboard represents a +Grafana is organized into dashboards and panels. A dashboard represents a view into the performance of a system, and each dashboard consists of one or more panels, which represent information about a specific metric related to that system. @@ -24,26 +24,20 @@ that system. 1. **Create a new dashboard** - Hover your mouse over the `+` icon in the far left of the Grafana user - interface to bring up a `Create` menu. Select `Dashboard`. When your new + Hover your mouse over the `+` icon in the far left of the Grafana user + interface to bring up a `Create` menu, then select `Dashboard`. When your new dashboard is created, you'll see a `New Panel` screen, with options for `Add Query` and `Choose Visualization`. In the future, if you already have a dashboard with panels, you can click the `+` icon at the top of the Grafana user interface to add a panel to an existing dashboard. - -1. **Click `Choose Visualization` to add a new panel** +1. **Click `Choose Visualization` to add a new panel** There are several options for different Grafana visualizations. This example uses the `Graph` visualization. - 1. **Configure the panel** There are multiple ways to configure, but you can accept all the defaults to create a simple `Lines` graph. - -1. **Navigate to the `Queries` tab** - -1. **Set the query database to the dataset you are using** - +1. **Navigate to the `Queries` tab and set the query database to the dataset you are using** 1. **Run your queries** You can edit the queries directly or use the built-in query editor. If you are visualizing time-series data, select @@ -53,12 +47,11 @@ that system. ### Use the time filter function -Grafana time-series panels include a tool that lets you filter on a given time -range, called a time filter. Grafana allows you to link the user interface +Grafana time-series panels include a time filter. You can link the user interface construct in a Grafana panel with the query itself using the `$__timefilter()` function. -This example of a modified query uses the `$__timefilter()` function to set +This example uses the `$__timefilter()` function to set the `pickup_datetime` column as the filtering range for your visualizations: ```sql @@ -73,8 +66,7 @@ WHERE $__timeFilter(pickup_datetime) ### Reference elements in the query -You can group your visualizations by the time buckets you've selected, -and order the results by the time buckets as well. So, the `GROUP BY` and +You can group your visualizations and order the results by time buckets. In this case, the `GROUP BY` and `ORDER BY` statements reference `time`. For example: @@ -97,7 +89,7 @@ When you visualize this query in Grafana, you see this: width={1375} height={944} src="https://assets.iobeam.com/images/docs/screenshots-for-grafana-tutorial/grafana_query_results.png" alt="Visualizing time-series data in Grafana"/> -You can adjust the `time_bucket` function and compare the graphs, like this: +You can adjust the `time_bucket` function and compare the graphs: ```sql SELECT @@ -132,12 +124,13 @@ tutorial as a starting point. -1. In your Grafana dashboard, create a new panel, select `New Visualization`, - and select `Worldmap Panel`. -1. Navigate to the `Queries` tab. -1. Select your data source. -1. In the `Format as` dropdown, select `Table`. Click `Edit SQL` and enter the - query you want to use. This examples uses this query: +1. **In your Grafana dashboard, create a new panel** +1. **Select `New Visualization` >`Worldmap Panel`** +1. **Navigate to the `Queries` tab and select your data source** +1. **In the `Format as` dropdown, select `Table`** +1. **Click `Edit SQL` and enter the query you want to use** + + This procedure uses the following query: ```sql SELECT time_bucket('5m', rides.pickup_datetime) AS time, @@ -157,20 +150,24 @@ tutorial as a starting point. LIMIT 500; ``` -1. Configure the visualization by navigating to the `Visualization` tab. Make - sure the `Map Data Options` are set to `table` and `current`. -1. In the `Field Mappings` section, set the `Table Query Format` to `Table`. -1. Map the `Latitude Field` to the `latitude` variable, the `Longitude Field` +1. **Configure the visualization by navigating to the `Visualization` tab** + + Make sure the `Map Data Options` are set to `table` and `current`. +1. **In the `Field Mappings` section, set the `Table Query Format` to `Table`** +1. **Map fields to variables** + + Map the `Latitude Field` to the `latitude` variable, the `Longitude Field` to the `longitude` variable, and the `Metric` field to the `value` variable. -1. In the `Map Visual Options` section, set the `Min Circle Size` to `1`, and - the `Max Circle Size` to `5`. -1. In the `Threshold Options` section, set the `Thresholds` to `2,5,10`. This - automatically configures a set of colors, which you can adjust later. - - +1. **In the `Map Visual Options` section, set the `Min Circle Size` to `1`, and + the `Max Circle Size` to `5`** +1. **In the `Threshold Options` section, set the `Thresholds` to `2,5,10`** + + This automatically configures a set of colors, which you can adjust later. + + Visualizing time series data in PostgreSQL using the Grafana Worldmap From f0eab761d7615e126fc298ae7f61d96fc740ce82 Mon Sep 17 00:00:00 2001 From: atovpeko Date: Tue, 17 Dec 2024 22:27:35 +0200 Subject: [PATCH 05/39] draft --- use-timescale/integrations/observability-alerting/grafana.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/use-timescale/integrations/observability-alerting/grafana.md b/use-timescale/integrations/observability-alerting/grafana.md index 644216ad24..47e3a160ee 100644 --- a/use-timescale/integrations/observability-alerting/grafana.md +++ b/use-timescale/integrations/observability-alerting/grafana.md @@ -110,7 +110,7 @@ width={1375} height={944} src="https://assets.iobeam.com/images/docs/screenshots-for-grafana-tutorial/grafana_query_results_5m.png" alt="Visualizing time-series data in Grafana"/> -## Use Grafana to visualize geospatial data stored in Timescale +## Use Grafana to visualize geospatial data Grafana includes a WorldMap visualization so you can see geospatial data overlaid on a map. This can be helpful to understand how data From 97d8d69d429006ddeab89e49b5def46eaaf45dd2 Mon Sep 17 00:00:00 2001 From: atovpeko Date: Tue, 17 Dec 2024 22:30:59 +0200 Subject: [PATCH 06/39] draft --- .../integrations/observability-alerting/grafana.md | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/use-timescale/integrations/observability-alerting/grafana.md b/use-timescale/integrations/observability-alerting/grafana.md index 47e3a160ee..5d9b3e49d8 100644 --- a/use-timescale/integrations/observability-alerting/grafana.md +++ b/use-timescale/integrations/observability-alerting/grafana.md @@ -66,7 +66,7 @@ WHERE $__timeFilter(pickup_datetime) ### Reference elements in the query -You can group your visualizations and order the results by time buckets. In this case, the `GROUP BY` and +You can group your visualizations and order the results by [time buckets][time-buckets]. In this case, the `GROUP BY` and `ORDER BY` statements reference `time`. For example: @@ -110,14 +110,12 @@ width={1375} height={944} src="https://assets.iobeam.com/images/docs/screenshots-for-grafana-tutorial/grafana_query_results_5m.png" alt="Visualizing time-series data in Grafana"/> -## Use Grafana to visualize geospatial data +## Visualize geospatial data Grafana includes a WorldMap visualization so you can see geospatial data overlaid on a map. This can be helpful to understand how data changes based on its location. -### Build a geospatial query in Grafana - This section visualizes taxi rides in Manhattan, where the distance traveled was greater than 5 miles. It uses the same query as the [NYC Taxi Cab][nyc-taxi] tutorial as a starting point. @@ -176,4 +174,5 @@ tutorial as a starting point. [install-grafana]: /use-timescale/:currentVersion:/integrations/observability-alerting/grafana/installation [tutorial-grafana-dashboards]: /use-timescale/:currentVersion:/integrations/observability-alerting/grafana/create-dashboard-and-panel/ [tutorial-grafana-geospatial]: /use-timescale/:currentVersion:/integrations/observability-alerting/grafana/geospatial-dashboards/ +[time-buckets]: /use-timescale/:currentVersion:/time-buckets/ From da83fe45c895f3c8bd0ddac454336db1f814ad5f Mon Sep 17 00:00:00 2001 From: atovpeko <114177030+atovpeko@users.noreply.github.com> Date: Wed, 18 Dec 2024 17:12:05 +0200 Subject: [PATCH 07/39] Update use-timescale/integrations/observability-alerting/grafana.md Co-authored-by: Iain Cox Signed-off-by: atovpeko <114177030+atovpeko@users.noreply.github.com> --- use-timescale/integrations/observability-alerting/grafana.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/use-timescale/integrations/observability-alerting/grafana.md b/use-timescale/integrations/observability-alerting/grafana.md index 5d9b3e49d8..3f41a36019 100644 --- a/use-timescale/integrations/observability-alerting/grafana.md +++ b/use-timescale/integrations/observability-alerting/grafana.md @@ -1,5 +1,5 @@ --- -title: Getting started with Grafana and Timescale +title: Integrate Grafana and Timescale Cloud excerpt: Use Grafana to visualize time-series data stored in Timescale products: [cloud] keywords: [Grafana, visualizations, analytics, monitoring] From 9aadc85d3f448d5630fd73f29b2d11e2b9491bec Mon Sep 17 00:00:00 2001 From: atovpeko <114177030+atovpeko@users.noreply.github.com> Date: Wed, 18 Dec 2024 17:12:18 +0200 Subject: [PATCH 08/39] Update use-timescale/integrations/observability-alerting/grafana.md Co-authored-by: Iain Cox Signed-off-by: atovpeko <114177030+atovpeko@users.noreply.github.com> --- use-timescale/integrations/observability-alerting/grafana.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/use-timescale/integrations/observability-alerting/grafana.md b/use-timescale/integrations/observability-alerting/grafana.md index 3f41a36019..dd48db6c51 100644 --- a/use-timescale/integrations/observability-alerting/grafana.md +++ b/use-timescale/integrations/observability-alerting/grafana.md @@ -1,6 +1,6 @@ --- title: Integrate Grafana and Timescale Cloud -excerpt: Use Grafana to visualize time-series data stored in Timescale +excerpt: Use Grafana to visualize time-series data stored in a Timescale Cloud service products: [cloud] keywords: [Grafana, visualizations, analytics, monitoring] --- From 17d2b9cf9cfc1416b989c80e7d6ee438e2952ccf Mon Sep 17 00:00:00 2001 From: atovpeko <114177030+atovpeko@users.noreply.github.com> Date: Wed, 18 Dec 2024 17:12:26 +0200 Subject: [PATCH 09/39] Update use-timescale/integrations/observability-alerting/grafana.md Co-authored-by: Iain Cox Signed-off-by: atovpeko <114177030+atovpeko@users.noreply.github.com> --- use-timescale/integrations/observability-alerting/grafana.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/use-timescale/integrations/observability-alerting/grafana.md b/use-timescale/integrations/observability-alerting/grafana.md index dd48db6c51..2ba04ea797 100644 --- a/use-timescale/integrations/observability-alerting/grafana.md +++ b/use-timescale/integrations/observability-alerting/grafana.md @@ -7,7 +7,7 @@ keywords: [Grafana, visualizations, analytics, monitoring] import GrafanaConnect from "versionContent/_partials/_grafana-connect.mdx"; -# Get started with Grafana and Timescale +# Integrate Grafana and Timescale Cloud Grafana is an analytics and monitoring tool that you can use to visualize time-series data. This page shows you how to set up Grafana with Timescale and create a dashboard and panel. It also provides an example of how to visualize geospatial data. From 9416833f294a68bb09f9394179e0672cbbb5b5d0 Mon Sep 17 00:00:00 2001 From: atovpeko <114177030+atovpeko@users.noreply.github.com> Date: Wed, 18 Dec 2024 17:12:49 +0200 Subject: [PATCH 10/39] Update use-timescale/integrations/observability-alerting/grafana.md Co-authored-by: Iain Cox Signed-off-by: atovpeko <114177030+atovpeko@users.noreply.github.com> --- use-timescale/integrations/observability-alerting/grafana.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/use-timescale/integrations/observability-alerting/grafana.md b/use-timescale/integrations/observability-alerting/grafana.md index 2ba04ea797..40c44b9ae6 100644 --- a/use-timescale/integrations/observability-alerting/grafana.md +++ b/use-timescale/integrations/observability-alerting/grafana.md @@ -9,7 +9,9 @@ import GrafanaConnect from "versionContent/_partials/_grafana-connect.mdx"; # Integrate Grafana and Timescale Cloud -Grafana is an analytics and monitoring tool that you can use to visualize time-series data. This page shows you how to set up Grafana with Timescale and create a dashboard and panel. It also provides an example of how to visualize geospatial data. +You can use [Grafana](https://grafana.com/docs/) to monitor, visualize and perform analytics on data stored in your $SERVICE_LONG. + +This page shows you how to connect Grafana with a $SERVICE_LONG, create a dashboard and panel, then visualize geospatial data. From 011323e108ac98900fc4cd972fd9611e3ac2aa72 Mon Sep 17 00:00:00 2001 From: atovpeko Date: Wed, 18 Dec 2024 21:46:25 +0200 Subject: [PATCH 11/39] updated file locations --- _partials/_grafana-connect.md | 34 +++-- _partials/_migrate_import_prerequisites.md | 12 +- .../observability-alerting/grafana.md | 132 +++++++++--------- 3 files changed, 90 insertions(+), 88 deletions(-) diff --git a/_partials/_grafana-connect.md b/_partials/_grafana-connect.md index 101203560c..f9bc1f03e1 100644 --- a/_partials/_grafana-connect.md +++ b/_partials/_grafana-connect.md @@ -1,17 +1,13 @@ import ImportPrerequisites from "versionContent/_partials/_migrate_import_prerequisites.mdx"; -## Add Timescale as a data source in Grafana - -You use Grafana to visualize queries directly from your $SERVICE_LONG. - -### Prerequisites +## Prerequisites -* Install self-managed Grafana, or sign up for [Grafana Cloud][install-grafana] +* Install [self-managed Grafana][grafana-self-managed], or sign up for [Grafana Cloud][grafana-cloud] -### Add your $SERVICE_LONG as a data source +## Add your $SERVICE_LONG as a data source To connect the data in your $SERVICE_LONG to Grafana: @@ -25,22 +21,30 @@ To connect the data in your $SERVICE_LONG to Grafana: 1. **Add your $SERVICE_LONG as a data source** 1. In the Grafana dashboard, navigate to `Configuration` > `Data sources`, then click `Add data source`. 1. In `Add data source`, select `PostgreSQL`. - 1. Configure the data source using the connection in `$TARGET`: + 1. Configure the data source using the connection in `$TARGET`: - `Name`: the name to use for the dataset - - `Host`: the host and port for your $SERVICE_SHORT, in this format: `:`. - - For example: `example.tsdb.cloud.timescale.com:35177`. + - `Host`: the host and port for your $SERVICE_SHORT, in this format: `:` - `Database`: `tsdb` - `User`: `tsdbadmin`, or another privileged user - `Password`: the password for `User` - `TLS/SSL Mode`: select `require` - `PostgreSQL details`: enable `TimescaleDB` - Leave the default setting for all other fields - 1. Click `Save & test`. + + Get the values for `Host` and `Password` from the connection string generated when you created your $SERVICE_LONG. For example, in the following connection string: + + ```bash + postgres://tsdbadmin:krifchuf3r8c5onn@s5pq0es2cy.vfbtkqzhtm.tsdb.cloud.timescale.com:39941/tsdb?sslmode=require + ``` + + `krifchuf3r8c5onn` is the password and `s5pq0es2cy.vfbtkqzhtm.tsdb.cloud.timescale.com:39941` is the host and port in the required format. + + 1. Click `Save & test`. - Grafana checks that your details are set correctly. + Grafana checks that your details are set correctly. -[install-grafana]: https://grafana.com/get/ -[cloud-login]: https://console.cloud.timescale.com/ +[grafana-self-managed]: https://grafana.com/get/?tab=self-managed +[grafana-cloud]: https://grafana.com/get/ +[cloud-login]: https://console.cloud.timescale.com/ \ No newline at end of file diff --git a/_partials/_migrate_import_prerequisites.md b/_partials/_migrate_import_prerequisites.md index 1744d9bf4d..80728344a0 100644 --- a/_partials/_migrate_import_prerequisites.md +++ b/_partials/_migrate_import_prerequisites.md @@ -3,14 +3,10 @@ Before you import your data: - [Create a target Timescale Cloud service][created-a-database-service-in-timescale]. - Each Timescale Cloud service [has a single database] that supports the - [most popular extensions][all available extensions]. Timescale Cloud services do not support [tablespaces], - and [there is no superuser associated with a Timescale service][no-superuser-for-timescale-instance]. + Each Timescale Cloud service has a single database that supports the + [most popular extensions][all-available-extensions]. Timescale Cloud services do not support tablespaces, + and there is no superuser associated with a Timescale service. [created-a-database-service-in-timescale]: /getting-started/:currentVersion:/services/ -[has a single database]: /migrate/:currentVersion:/troubleshooting/#only-one-database-per-instance -[all available extensions]: /migrate/:currentVersion:/troubleshooting/#extension-availability -[tablespaces]: /migrate/:currentVersion:/troubleshooting/#tablespaces -[no-superuser-for-timescale-instance]: /migrate/:currentVersion:/troubleshooting/#superuser-privileges -[create-ec2-instance]: https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/EC2_GetStarted.html#ec2-launch-instance +[all-available-extensions]: /use-timescale/:currentVersion:/extensions/ diff --git a/use-timescale/integrations/observability-alerting/grafana.md b/use-timescale/integrations/observability-alerting/grafana.md index 40c44b9ae6..09788488c8 100644 --- a/use-timescale/integrations/observability-alerting/grafana.md +++ b/use-timescale/integrations/observability-alerting/grafana.md @@ -11,7 +11,7 @@ import GrafanaConnect from "versionContent/_partials/_grafana-connect.mdx"; You can use [Grafana](https://grafana.com/docs/) to monitor, visualize and perform analytics on data stored in your $SERVICE_LONG. -This page shows you how to connect Grafana with a $SERVICE_LONG, create a dashboard and panel, then visualize geospatial data. +This page shows you how to connect Grafana with a $SERVICE_LONG, create a dashboard and panel, then visualize geospatial data. @@ -47,70 +47,72 @@ that system. -### Use the time filter function - -Grafana time-series panels include a time filter. You can link the user interface -construct in a Grafana panel with the query itself using the `$__timefilter()` -function. - -This example uses the `$__timefilter()` function to set -the `pickup_datetime` column as the filtering range for your visualizations: - -```sql -SELECT - --1-- - time_bucket('1 day', pickup_datetime) AS "time", - --2-- - COUNT(*) -FROM rides -WHERE $__timeFilter(pickup_datetime) -``` - -### Reference elements in the query - -You can group your visualizations and order the results by [time buckets][time-buckets]. In this case, the `GROUP BY` and -`ORDER BY` statements reference `time`. - -For example: - -```sql -SELECT - --1-- - time_bucket('1 day', pickup_datetime) AS time, - --2-- - COUNT(*) -FROM rides -WHERE $__timeFilter(pickup_datetime) -GROUP BY time -ORDER BY time -``` - -When you visualize this query in Grafana, you see this: - -Visualizing time-series data in Grafana - -You can adjust the `time_bucket` function and compare the graphs: - -```sql -SELECT - --1-- - time_bucket('5m', pickup_datetime) AS time, - --2-- - COUNT(*) -FROM rides -WHERE $__timeFilter(pickup_datetime) -GROUP BY time -ORDER BY time -``` - -When you visualize this query, it looks like this: - - +## Use the time filter function + +Grafana time-series panels include a time filter. + + + +1. **Call `$__timefilter()` to link the user interface construct in a Grafana panel with the query.** + + For example, to set the `pickup_datetime` column as the filtering range for your visualizations: + + ```sql + SELECT + --1-- + time_bucket('1 day', pickup_datetime) AS "time", + --2-- + COUNT(*) + FROM rides + WHERE $__timeFilter(pickup_datetime) + ``` + +1. **Group your visualizations and order the results by [time buckets][time-buckets].** + + In this case, the `GROUP BY` and `ORDER BY` statements reference `time`. + + For example: + + ```sql + SELECT + --1-- + time_bucket('1 day', pickup_datetime) AS time, + --2-- + COUNT(*) + FROM rides + WHERE $__timeFilter(pickup_datetime) + GROUP BY time + ORDER BY time + ``` + + When you visualize this query in Grafana, you see this: + + Visualizing time-series data in Grafana + + You can adjust the `time_bucket` function and compare the graphs: + + ```sql + SELECT + --1-- + time_bucket('5m', pickup_datetime) AS time, + --2-- + COUNT(*) + FROM rides + WHERE $__timeFilter(pickup_datetime) + GROUP BY time + ORDER BY time + ``` + + When you visualize this query, it looks like this: + + Visualizing time-series data in Grafana + + ## Visualize geospatial data From 07b81d102d26e7eaea223c4ef9773990d0e35526 Mon Sep 17 00:00:00 2001 From: atovpeko Date: Wed, 18 Dec 2024 21:53:29 +0200 Subject: [PATCH 12/39] review comments --- _partials/_migrate_prerequisites.md | 12 ++++-------- use-timescale/extensions/index.md | 2 +- 2 files changed, 5 insertions(+), 9 deletions(-) diff --git a/_partials/_migrate_prerequisites.md b/_partials/_migrate_prerequisites.md index 56d5c0bc74..914a6caa3b 100644 --- a/_partials/_migrate_prerequisites.md +++ b/_partials/_migrate_prerequisites.md @@ -7,18 +7,14 @@ Before you migrate your data: - [Create a target Timescale Cloud service][created-a-database-service-in-timescale]. - Each Timescale Cloud service [has a single database] that supports the - [most popular extensions][all available extensions]. Timescale Cloud services do not support [tablespaces], - and [there is no superuser associated with a Timescale service][no-superuser-for-timescale-instance]. + Each Timescale Cloud service has a single database that supports the + [most popular extensions][all-available-extensions]. Timescale Cloud services do not support tablespaces, + and there is no superuser associated with a Timescale service. We recommend creating a Timescale Cloud instance with at least 8 CPUs for a smoother migration experience. A higher-spec instance can significantly reduce the overall migration window. - To ensure that maintenance does not run while migration is in progress, best practice is to [adjust the maintenance window][adjust-maintenance-window]. [created-a-database-service-in-timescale]: /getting-started/:currentVersion:/services/ -[has a single database]: /migrate/:currentVersion:/troubleshooting/#only-one-database-per-instance -[all available extensions]: /migrate/:currentVersion:/troubleshooting/#extension-availability -[tablespaces]: /migrate/:currentVersion:/troubleshooting/#tablespaces -[no-superuser-for-timescale-instance]: /migrate/:currentVersion:/troubleshooting/#superuser-privileges -[pg_hbaconf]: https://www.timescale.com/blog/5-common-connection-errors-in-postgresql-and-how-to-solve-them/#no-pg_hbaconf-entry-for-host +[all-available-extensions]: /use-timescale/:currentVersion:/extensions [create-ec2-instance]: https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/EC2_GetStarted.html#ec2-launch-instance [adjust-maintenance-window]: /use-timescale/:currentVersion:/upgrades/#adjusting-your-maintenance-window diff --git a/use-timescale/extensions/index.md b/use-timescale/extensions/index.md index e5ca6d1c35..b523bfb89d 100644 --- a/use-timescale/extensions/index.md +++ b/use-timescale/extensions/index.md @@ -11,8 +11,8 @@ tags: [extensions] You can use PostgreSQL extensions with Timescale. These are the currently supported extensions: -- [PostgreSQL built-in extensions][built-ins] - [Timescale extensions][timescale-extensions] +- [PostgreSQL built-in extensions][built-ins] - [Third-party extensions][third-party] ## Timescale extensions From 3ff5870e0eeb3f7399c21f2d38e8586c74aa6b7f Mon Sep 17 00:00:00 2001 From: atovpeko Date: Thu, 19 Dec 2024 12:01:14 +0200 Subject: [PATCH 13/39] draft --- .../integrations/query-admin/about-psql.md | 109 -------------- .../integrations/query-admin/psql.md | 135 ++++++++++++++---- use-timescale/page-index/page-index.js | 5 - 3 files changed, 110 insertions(+), 139 deletions(-) delete mode 100644 use-timescale/integrations/query-admin/about-psql.md diff --git a/use-timescale/integrations/query-admin/about-psql.md b/use-timescale/integrations/query-admin/about-psql.md deleted file mode 100644 index a6dbe65897..0000000000 --- a/use-timescale/integrations/query-admin/about-psql.md +++ /dev/null @@ -1,109 +0,0 @@ ---- -title: About psql -excerpt: Connect to your database with the psql command line tool -products: [cloud, mst, self_hosted] -keywords: [connect, psql] ---- - -# About psql - -The `psql` command line tool is widely used for interacting with a PostgreSQL or -Timescale instance, and it is available for all operating systems. Most of -the instructions in the Timescale documentation assume you are using `psql`. - -To use `psql` to connect to your database, you need the connection details for -your PostgreSQL server. For more information about how to retrieve your -connection details, see the [about connecting][about-connecting] section. - -## Connecting to your database with psql - -There are two different ways you can use `psql` to connect to your database. - -You can provide the details using parameter flags, like this: - -```bash -psql -h -p -U -W -d -``` - -Alternatively, you can use a service URL to provide the details, like this: - -```bash -psql postgres://@:/?sslmode=require -``` - -If you configured your Timescale service to connect using -[SSL mode][ssl-mode], use: - -```bash -psql "postgres://tsdbadmin@/tsdb?sslmode=verify-full" -``` - -When you run one of these commands, you are prompted for your password. If you -don't want to prompted, you can supply your password directly within the service -URL instead, like this: - -```bash -psql "postgres://:@:/?sslmode=require" -``` - -## Common psql commands - -When you start using `psql`, these are the commands you are likely to use most -frequently: - -|Command|Description| -|-|-| -|`\c `|Connect to a new database| -|`\d `|Show the details of a table| -|`\df`|List functions in the current database| -|`\df+`|List all functions with more details| -|`\di`|List all indexes from all tables| -|`\dn`|List all schemas in the current database| -|`\dt`|List available tables| -|`\du`|List PostgreSQL database roles| -|`\dv`|List views in current schema| -|`\dv+`|List all views with more details| -|`\dx`|Show all installed extensions| -|`ef `|Edit a function| -|`\h`|Show help on syntax of SQL commands| -|`\l`|List available databases| -|`\password `|Change the password for the user| -|`\q`|Quit `psql`| -|`\set`|Show system variables list| -|`\timing`|Show how long a query took to execute| -|`\x`|Show expanded query results| -|`\?`|List all `psql` slash commands| - -* For a more comprehensive list of `psql` commands, see the - [Timescale psql cheat sheet][psql-cheat-sheet]. -* For more information about all `psql` commands, see the - [psql documentation][psql-docs]. - -### Save query results to a file - -When you run queries in `psql`, the results are shown in the console by default. -If you are running queries that have a lot of results, you might like to save -the results into a comma-separated `.csv` file instead. You can do this using -the `COPY` command. For example: - -```sql -\copy (SELECT * FROM ...) TO '/tmp/output.csv' (format CSV); -``` - -This command sends the results of the query to a new file called `output.csv` in -the `/tmp/` directory. You can open the file using any spreadsheet program. - -### Edit queries in a text editor - -Sometimes, queries can get very long, and you might make a mistake when you try -typing it the first time around. If you have made a mistake in a long query, -instead of retyping it, you can use a built-in text editor, which is based on -`Vim`. Launch the query editor with the `\e` command. Your previous query is -loaded into the editor. When you have made your changes, press `Esc`, then type -`:`+`w`+`q` to save the changes, and return to the command prompt. Access the -edited query by pressing `↑`, and press `Enter` to run it. - -[about-connecting]: /use-timescale/:currentVersion:/integrations/query-admin/about-connecting/ -[psql-cheat-sheet]: https://www.timescale.com/learn/postgres-cheat-sheet -[psql-docs]: https://www.postgresql.org/docs/13/app-psql.html -[ssl-mode]: /use-timescale/:currentVersion:/security/strict-ssl/ diff --git a/use-timescale/integrations/query-admin/psql.md b/use-timescale/integrations/query-admin/psql.md index 1ca4a0190d..0ce770440a 100644 --- a/use-timescale/integrations/query-admin/psql.md +++ b/use-timescale/integrations/query-admin/psql.md @@ -1,15 +1,18 @@ --- -title: Install the psql connection tool -excerpt: How to install the psql client for PostgreSQL +title: Connect to a Timescale Cloud service with psql +excerpt: Install the psql client for PostgreSQL and connect to your service products: [cloud, mst, self_hosted] keywords: [connect, psql] --- -# Install the psql connection tool +# Connect using psql -The `psql` command line tool is widely used for interacting with a PostgreSQL or -Timescale instance, and it is available for all operating systems. Most of -the instructions in the Timescale documentation assume you are using `psql`. +You use `psql` command line tool to interact with your $SERVICE_LONG. Most procedures in the $COMPANY documentation assume you are using `psql`. + +To use `psql` to connect to your database, you need the connection details for your PostgreSQL server. For more information about how to retrieve your +connection details, see the [about connecting][about-connecting] section. + +## Install psql Before you start, check that you don't already have `psql` installed. It is sometimes installed by default, depending on your operating system and other @@ -36,22 +39,21 @@ wmic -## Install PostgreSQL package on macOS +### Install PostgreSQL package on macOS The `psql` tool is installed by default on macOS systems when you install PostgreSQL, and this is the most effective way to install the tool. -On macOS you can use Homebrew or MacPorts to install the PostgreSQL package + +You can use Homebrew or MacPorts to install the PostgreSQL package or just the `psql` tool. - + -### Installing PostgreSQL package using Homebrew - -1. Install Homebrew, if you don't already have it: +1. Install Homebrew if you don't already have it: ```bash /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)" @@ -80,8 +82,6 @@ or just the `psql` tool. -### Installing PostgreSQL package using MacPorts - 1. Install MacPorts by downloading and running the package installer.. For more information about MacPorts, including installation instructions, see the [MacPorts documentation][macports]. @@ -104,7 +104,7 @@ or just the `psql` tool. -## Install psql on macOS +### Install psql on macOS If you do not want to install the entire PostgreSQL package, you can install the `psql` tool on its own. `libpqxx` is the official C++ client API for PostgreSQL. @@ -114,8 +114,6 @@ If you do not want to install the entire PostgreSQL package, you can install the -### Installing psql using Homebrew - 1. Install Homebrew, if you don't already have it: ```bash @@ -154,8 +152,6 @@ If you do not want to install the entire PostgreSQL package, you can install the -### Installing psql using MacPorts - 1. Install MacPorts by downloading and running the package installer. For more information about MacPorts, including installation instructions, see the [MacPorts documentation][macports]. @@ -177,15 +173,13 @@ If you do not want to install the entire PostgreSQL package, you can install the -## Install psql on Debian and Ubuntu +### Install psql on Debian and Ubuntu You can use the `apt` package manager on Debian and Ubuntu systems to install the `psql` tool. -### Installing psql using the apt package manager - 1. Make sure your `apt` repository is up to date: ```bash @@ -200,7 +194,7 @@ the `psql` tool. -## Install psql on Windows +### Install psql on Windows The `psql` tool is installed by default on Windows systems when you install PostgreSQL, and this is the most effective way to install the tool. These @@ -209,8 +203,6 @@ EnterpriseDB. -### Installing psql on Windows - 1. Download and run the PostgreSQL installer from [www.enterprisedb.com][windows-installer]. 1. In the `Select Components` dialog, check `Command Line Tools`, along with @@ -219,6 +211,99 @@ EnterpriseDB. +## Connect to your database + +There are two different ways you can use `psql` to connect to your database. + +You can provide the details using parameter flags, like this: + +```bash +psql -h -p -U -W -d +``` + +Alternatively, you can use a service URL to provide the details, like this: + +```bash +psql postgres://@:/?sslmode=require +``` + +If you configured your Timescale service to connect using +[SSL mode][ssl-mode], use: + +```bash +psql "postgres://tsdbadmin@/tsdb?sslmode=verify-full" +``` + +When you run one of these commands, you are prompted for your password. If you +don't want to be prompted, you can supply your password directly within the service +URL instead, like this: + +```bash +psql "postgres://:@:/?sslmode=require" +``` + +## Common psql commands + +When you start using `psql`, these are the commands you are likely to use most +frequently: + +|Command|Description| +|-|-| +|`\c `|Connect to a new database| +|`\d `|Show the details of a table| +|`\df`|List functions in the current database| +|`\df+`|List all functions with more details| +|`\di`|List all indexes from all tables| +|`\dn`|List all schemas in the current database| +|`\dt`|List available tables| +|`\du`|List PostgreSQL database roles| +|`\dv`|List views in current schema| +|`\dv+`|List all views with more details| +|`\dx`|Show all installed extensions| +|`ef `|Edit a function| +|`\h`|Show help on syntax of SQL commands| +|`\l`|List available databases| +|`\password `|Change the password for the user| +|`\q`|Quit `psql`| +|`\set`|Show system variables list| +|`\timing`|Show how long a query took to execute| +|`\x`|Show expanded query results| +|`\?`|List all `psql` slash commands| + +* For a more comprehensive list of `psql` commands, see the + [Timescale psql cheat sheet][psql-cheat-sheet]. +* For more information about all `psql` commands, see the + [psql documentation][psql-docs]. + +## Save query results to a file + +When you run queries in `psql`, the results are shown in the Console by default. +If you are running queries that have a lot of results, you might like to save +the results into a comma-separated `.csv` file instead. You can do this using +the `COPY` command. For example: + +```sql +\copy (SELECT * FROM ...) TO '/tmp/output.csv' (format CSV); +``` + +This command sends the results of the query to a new file called `output.csv` in +the `/tmp/` directory. You can open the file using any spreadsheet program. + +### Edit queries in a text editor + +Sometimes, queries can get very long, and you might make a mistake when you try +typing it the first time around. If you have made a mistake in a long query, +instead of retyping it, you can use a built-in text editor, which is based on +`Vim`. Launch the query editor with the `\e` command. Your previous query is +loaded into the editor. When you have made your changes, press `Esc`, then type +`:`+`w`+`q` to save the changes, and return to the command prompt. Access the +edited query by pressing `↑`, and press `Enter` to run it. + + +[about-connecting]: /use-timescale/:currentVersion:/integrations/query-admin/about-connecting/ +[psql-cheat-sheet]: https://www.timescale.com/learn/postgres-cheat-sheet +[psql-docs]: https://www.postgresql.org/docs/13/app-psql.html +[ssl-mode]: /use-timescale/:currentVersion:/security/strict-ssl/ [homebrew]: https://docs.brew.sh/Installation [macports]: https://guide.macports.org/#installing.macports [windows-installer]: https://www.postgresql.org/download/windows/ diff --git a/use-timescale/page-index/page-index.js b/use-timescale/page-index/page-index.js index 4bfc0dde11..c0f18e46b0 100644 --- a/use-timescale/page-index/page-index.js +++ b/use-timescale/page-index/page-index.js @@ -784,11 +784,6 @@ module.exports = [ href: "about-connecting", excerpt: "Learn about using connecting to your Timescale database", }, - { - title: "About psql", - href: "about-psql", - excerpt: "Learn about using psql to connect to Timescale", - }, { title: "Install psql", href: "psql", From 2e00b9841b794b759f3d7e0b0f4ed74ebe237249 Mon Sep 17 00:00:00 2001 From: atovpeko Date: Thu, 19 Dec 2024 17:17:32 +0200 Subject: [PATCH 14/39] draft --- _partials/_grafana-connect.md | 20 +++++----- .../observability-alerting/grafana.md | 40 +++++++++---------- 2 files changed, 30 insertions(+), 30 deletions(-) diff --git a/_partials/_grafana-connect.md b/_partials/_grafana-connect.md index f9bc1f03e1..8d24a02161 100644 --- a/_partials/_grafana-connect.md +++ b/_partials/_grafana-connect.md @@ -19,25 +19,25 @@ To connect the data in your $SERVICE_LONG to Grafana: - Self-hosted Grafana: at `http://localhost:3000/`. The default credentials are `admin`, `admin`. - Grafana Cloud: use the URL and credentials you set when you created your account. 1. **Add your $SERVICE_LONG as a data source** - 1. In the Grafana dashboard, navigate to `Configuration` > `Data sources`, then click `Add data source`. - 1. In `Add data source`, select `PostgreSQL`. - 1. Configure the data source using the connection in `$TARGET`: - - `Name`: the name to use for the dataset - - `Host`: the host and port for your $SERVICE_SHORT, in this format: `:` - - `Database`: `tsdb` - - `User`: `tsdbadmin`, or another privileged user + 1. Open `Connections` > `Data sources`, then click `Add new data source`. + 1. Select `PostgreSQL` from the list. + 1. Configure the following fields: + - `Host URL`: the host and port for your $SERVICE_SHORT, in this format: `:` + - `Database name`: the name to use for the dataset + - `Username`: `tsdbadmin`, or another privileged user - `Password`: the password for `User` + - `Database`: `tsdb` - `TLS/SSL Mode`: select `require` - - `PostgreSQL details`: enable `TimescaleDB` + - `PostgreSQL options`: enable `TimescaleDB` - Leave the default setting for all other fields - Get the values for `Host` and `Password` from the connection string generated when you created your $SERVICE_LONG. For example, in the following connection string: + Get the values for `Host URL` and `Password` from the connection string generated when you created your $SERVICE_LONG. For example, in the following connection string: ```bash postgres://tsdbadmin:krifchuf3r8c5onn@s5pq0es2cy.vfbtkqzhtm.tsdb.cloud.timescale.com:39941/tsdb?sslmode=require ``` - `krifchuf3r8c5onn` is the password and `s5pq0es2cy.vfbtkqzhtm.tsdb.cloud.timescale.com:39941` is the host and port in the required format. + `krifchuf3r8c5onn` is the password and `s5pq0es2cy.vfbtkqzhtm.tsdb.cloud.timescale.com:39941` is the host URL in the required format. 1. Click `Save & test`. diff --git a/use-timescale/integrations/observability-alerting/grafana.md b/use-timescale/integrations/observability-alerting/grafana.md index 09788488c8..213fdd99dd 100644 --- a/use-timescale/integrations/observability-alerting/grafana.md +++ b/use-timescale/integrations/observability-alerting/grafana.md @@ -26,24 +26,24 @@ that system. 1. **Create a new dashboard** - Hover your mouse over the `+` icon in the far left of the Grafana user - interface to bring up a `Create` menu, then select `Dashboard`. When your new - dashboard is created, you'll see a `New Panel` screen, with options for - `Add Query` and `Choose Visualization`. In the future, if you already have a - dashboard with panels, you can click the `+` icon at the top of the Grafana - user interface to add a panel to an existing dashboard. -1. **Click `Choose Visualization` to add a new panel** + 1. On the `Dashboards` page, click `New` and select `New dashboard`. - There are several options for different Grafana visualizations. This example uses the `Graph` - visualization. -1. **Configure the panel** + 1. Click `Save dashboard`. Give your dashboard a title, a description, and a folder to store it in, then click **Save**. + + You now have an empty dashboard. + +1. **Add a new panel** - There are multiple ways to configure, but you can accept all the defaults to create a simple `Lines` graph. -1. **Navigate to the `Queries` tab and set the query database to the dataset you are using** -1. **Run your queries** + 1. Open your dashboard and click `Add visualization`. + + 1. Select from the list of pre-configured data sources or configure a new one. - You can edit the queries directly or use the built-in query editor. If you are visualizing time-series data, select - `Time series` in the `Format As` drop-down. + 1. Run your queries. You can edit the queries directly or use the built-in query editor. If you are visualizing time-series data, select + `Time series` in the `Format` drop-down. + + 1. Configure a title, a description, and other options for your panel, then click `Save dashboard`. + + You now have a dashboard with one panel. Add more panels to a dashboard by clicking `Add` at the top right and selecting `Vizualization` from the drop-down. @@ -126,11 +126,11 @@ tutorial as a starting point. -1. **In your Grafana dashboard, create a new panel** -1. **Select `New Visualization` >`Worldmap Panel`** -1. **Navigate to the `Queries` tab and select your data source** -1. **In the `Format as` dropdown, select `Table`** -1. **Click `Edit SQL` and enter the query you want to use** +1. **In your Grafana dashboard, click `Add` > `Vizualization`.** +1. **Select `Geomap` in the visualization type drop-down.** +1. **In the `Queries` tab, select your data source** +1. **In the `Format` drop-down, select `Table`** +1. **In the mode switcher toggle `Code` and enter the query you want to use** This procedure uses the following query: From 01d4bc4e6bdfb06e236e7ba04e907841977b00b1 Mon Sep 17 00:00:00 2001 From: atovpeko Date: Fri, 20 Dec 2024 12:44:14 +0200 Subject: [PATCH 15/39] draft --- .../observability-alerting/grafana.md | 70 ++++++++++++------- 1 file changed, 45 insertions(+), 25 deletions(-) diff --git a/use-timescale/integrations/observability-alerting/grafana.md b/use-timescale/integrations/observability-alerting/grafana.md index 213fdd99dd..e11aa2478f 100644 --- a/use-timescale/integrations/observability-alerting/grafana.md +++ b/use-timescale/integrations/observability-alerting/grafana.md @@ -116,7 +116,7 @@ Grafana time-series panels include a time filter. ## Visualize geospatial data -Grafana includes a WorldMap visualization so you can see geospatial data +Grafana includes a Geomap panel so you can see geospatial data overlaid on a map. This can be helpful to understand how data changes based on its location. @@ -126,33 +126,53 @@ tutorial as a starting point. -1. **In your Grafana dashboard, click `Add` > `Vizualization`.** -1. **Select `Geomap` in the visualization type drop-down.** -1. **In the `Queries` tab, select your data source** -1. **In the `Format` drop-down, select `Table`** -1. **In the mode switcher toggle `Code` and enter the query you want to use** +1. **Add a geospatial vizualization** + + 1. In your Grafana dashboard, click `Add` > `Vizualization`. + + 1. Select `Geomap` in the visualization type drop-down. + +1. **Configure the data format** + + 1. In the `Queries` tab, select your data source. + + 1. In the `Format` drop-down, select `Table`. + + 1. **In the mode switcher, toggle `Code` and enter the query, then click `Run`** - This procedure uses the following query: + For example: + + ```sql + SELECT time_bucket('5m', rides.pickup_datetime) AS time, + rides.trip_distance AS value, + rides.pickup_latitude AS latitude, + rides.pickup_longitude AS longitude + FROM rides + WHERE ides.trip_distance > 5 + GROUP BY time, + rides.trip_distance, + rides.pickup_latitude, + rides.pickup_longitude + ORDER BY time + LIMIT 500; + ``` + +1. **Customize the GeoMap settings** + + Configure the following in the `Panel options` section on the right: + + 1. Map layers > Data > Query A + 2. Configure the following: + • Layers: add markers or Circles to display points on the map. + • Base layer: choose a map tile layer (e.g., OpenStreetMap, Mapbox, or custom). + • Data layer: bind the latitude and longitude (or geohash) fields from your query. + • Set the metric or value to visualize (e.g., size, color). + 3. Style Options: + • Adjust marker size, color, and opacity. + • Configure tooltips to display relevant information when hovering over points. + - ```sql - SELECT time_bucket('5m', rides.pickup_datetime) AS time, - rides.trip_distance AS value, - rides.pickup_latitude AS latitude, - rides.pickup_longitude AS longitude - FROM rides - WHERE $__timeFilter(rides.pickup_datetime) AND - ST_Distance(pickup_geom, - ST_Transform(ST_SetSRID(ST_MakePoint(-73.9851,40.7589),4326),2163) - ) < 2000 - GROUP BY time, - rides.trip_distance, - rides.pickup_latitude, - rides.pickup_longitude - ORDER BY time - LIMIT 500; - ``` -1. **Configure the visualization by navigating to the `Visualization` tab** Make sure the `Map Data Options` are set to `table` and `current`. 1. **In the `Field Mappings` section, set the `Table Query Format` to `Table`** From 171633cae76003771fc0017fba5c10d83b6fab17 Mon Sep 17 00:00:00 2001 From: atovpeko Date: Fri, 20 Dec 2024 14:15:21 +0200 Subject: [PATCH 16/39] draft --- .../observability-alerting/grafana.md | 37 ++++++------------- 1 file changed, 11 insertions(+), 26 deletions(-) diff --git a/use-timescale/integrations/observability-alerting/grafana.md b/use-timescale/integrations/observability-alerting/grafana.md index e11aa2478f..e4fd0b6357 100644 --- a/use-timescale/integrations/observability-alerting/grafana.md +++ b/use-timescale/integrations/observability-alerting/grafana.md @@ -148,7 +148,7 @@ tutorial as a starting point. rides.pickup_latitude AS latitude, rides.pickup_longitude AS longitude FROM rides - WHERE ides.trip_distance > 5 + WHERE rides.trip_distance > 5 GROUP BY time, rides.trip_distance, rides.pickup_latitude, @@ -159,37 +159,22 @@ tutorial as a starting point. 1. **Customize the GeoMap settings** - Configure the following in the `Panel options` section on the right: + With default settings, the vizualization uses green circles of the fixed size. Configure at least the following for a more representative view: - 1. Map layers > Data > Query A - 2. Configure the following: - • Layers: add markers or Circles to display points on the map. - • Base layer: choose a map tile layer (e.g., OpenStreetMap, Mapbox, or custom). - • Data layer: bind the latitude and longitude (or geohash) fields from your query. - • Set the metric or value to visualize (e.g., size, color). - 3. Style Options: - • Adjust marker size, color, and opacity. - • Configure tooltips to display relevant information when hovering over points. + 1. `Map layers` > `Styles` > `Size` > `value`. + This changes the size of the circle depending on the value, with bigger circles representing bigger values. + + 1. `Map layers` > `Styles` > `Color` > `value`. + 1. `Thresholds` > Add `threshold`. + Add thresholds for 7 and 10, to mark rides over 7 and 10 miles in different colors, respectively. - Make sure the `Map Data Options` are set to `table` and `current`. -1. **In the `Field Mappings` section, set the `Table Query Format` to `Table`** -1. **Map fields to variables** - - Map the `Latitude Field` to the `latitude` variable, the `Longitude Field` - to the `longitude` variable, and the `Metric` field to the `value` variable. -1. **In the `Map Visual Options` section, set the `Min Circle Size` to `1`, and - the `Max Circle Size` to `5`** -1. **In the `Threshold Options` section, set the `Thresholds` to `2,5,10`** - - This automatically configures a set of colors, which you can adjust later. + You now have a vizualization that looks like this: - Visualizing time series data in PostgreSQL using the Grafana Worldmap + ![Timescale and Grafana integration](https://assets.timescale.com/docs/images/timescale-grafana-integration.png) + From dde18e23532723ea29d995c8dc75fec05d136145 Mon Sep 17 00:00:00 2001 From: atovpeko Date: Fri, 20 Dec 2024 15:04:11 +0200 Subject: [PATCH 17/39] new procedure with geomap --- _partials/_grafana-connect.md | 18 ++--- .../observability-alerting/grafana.md | 66 +++++++++---------- 2 files changed, 39 insertions(+), 45 deletions(-) diff --git a/_partials/_grafana-connect.md b/_partials/_grafana-connect.md index 8d24a02161..f110d37d04 100644 --- a/_partials/_grafana-connect.md +++ b/_partials/_grafana-connect.md @@ -5,7 +5,7 @@ import ImportPrerequisites from "versionContent/_partials/_migrate_import_prereq -* Install [self-managed Grafana][grafana-self-managed], or sign up for [Grafana Cloud][grafana-cloud] +* Install [self-managed Grafana][grafana-self-managed], or sign up for [Grafana Cloud][grafana-cloud]. ## Add your $SERVICE_LONG as a data source @@ -22,14 +22,14 @@ To connect the data in your $SERVICE_LONG to Grafana: 1. Open `Connections` > `Data sources`, then click `Add new data source`. 1. Select `PostgreSQL` from the list. 1. Configure the following fields: - - `Host URL`: the host and port for your $SERVICE_SHORT, in this format: `:` - - `Database name`: the name to use for the dataset - - `Username`: `tsdbadmin`, or another privileged user - - `Password`: the password for `User` - - `Database`: `tsdb` - - `TLS/SSL Mode`: select `require` - - `PostgreSQL options`: enable `TimescaleDB` - - Leave the default setting for all other fields + - `Host URL`: the host and port for your $SERVICE_SHORT, in this format: `:`. + - `Database name`: the name to use for the dataset. + - `Username`: `tsdbadmin`, or another privileged user. + - `Password`: the password for `User`. + - `Database`: `tsdb`. + - `TLS/SSL Mode`: select `require`. + - `PostgreSQL options`: enable `TimescaleDB`. + - Leave the default setting for all other fields. Get the values for `Host URL` and `Password` from the connection string generated when you created your $SERVICE_LONG. For example, in the following connection string: diff --git a/use-timescale/integrations/observability-alerting/grafana.md b/use-timescale/integrations/observability-alerting/grafana.md index e4fd0b6357..e60b0f37b8 100644 --- a/use-timescale/integrations/observability-alerting/grafana.md +++ b/use-timescale/integrations/observability-alerting/grafana.md @@ -24,26 +24,25 @@ that system. -1. **Create a new dashboard** +1. **On the `Dashboards` page, click `New` and select `New dashboard`** - 1. On the `Dashboards` page, click `New` and select `New dashboard`. +1. **Click `Add visualization`** - 1. Click `Save dashboard`. Give your dashboard a title, a description, and a folder to store it in, then click **Save**. - - You now have an empty dashboard. +1. **Select the data source** -1. **Add a new panel** + Select your $SERVICE_LONG from the list of pre-configured data sources or configure a new one. - 1. Open your dashboard and click `Add visualization`. - - 1. Select from the list of pre-configured data sources or configure a new one. +1. **Configure your panel** + + Select the visualization type. The type defines specific fields to configure in addition to standard ones, such as the panel name. - 1. Run your queries. You can edit the queries directly or use the built-in query editor. If you are visualizing time-series data, select - `Time series` in the `Format` drop-down. +1. **Run your queries** - 1. Configure a title, a description, and other options for your panel, then click `Save dashboard`. + You can edit the queries directly or use the built-in query editor. If you are visualizing time-series data, select `Time series` in the `Format` drop-down. + +1. **Click `Save dashboard`** - You now have a dashboard with one panel. Add more panels to a dashboard by clicking `Add` at the top right and selecting `Vizualization` from the drop-down. + You now have a dashboard with one panel. Add more panels to a dashboard by clicking `Add` at the top right and selecting `Visualization` from the drop-down. @@ -53,7 +52,7 @@ Grafana time-series panels include a time filter. -1. **Call `$__timefilter()` to link the user interface construct in a Grafana panel with the query.** +1. **Call `$__timefilter()` to link the user interface construct in a Grafana panel with the query** For example, to set the `pickup_datetime` column as the filtering range for your visualizations: @@ -67,9 +66,9 @@ Grafana time-series panels include a time filter. WHERE $__timeFilter(pickup_datetime) ``` -1. **Group your visualizations and order the results by [time buckets][time-buckets].** +1. **Group your visualizations and order the results by [time buckets][time-buckets]** - In this case, the `GROUP BY` and `ORDER BY` statements reference `time`. + In this case, the `GROUP BY` and `ORDER BY` statements reference `time`. For example: @@ -86,11 +85,9 @@ Grafana time-series panels include a time filter. ``` When you visualize this query in Grafana, you see this: - - Visualizing time-series data in Grafana - + + ![Timescale and Grafana query results](https://assets.timescale.com/docs/images/grafana_query_results.png) + You can adjust the `time_bucket` function and compare the graphs: ```sql @@ -106,11 +103,8 @@ Grafana time-series panels include a time filter. ``` When you visualize this query, it looks like this: - - Visualizing time-series data in Grafana + + ![Timescale and Grafana query results in time buckets](https://assets.timescale.com/docs/images/grafana_query_results_5m.png) @@ -126,9 +120,9 @@ tutorial as a starting point. -1. **Add a geospatial vizualization** +1. **Add a geospatial visualization** - 1. In your Grafana dashboard, click `Add` > `Vizualization`. + 1. In your Grafana dashboard, click `Add` > `Visualization`. 1. Select `Geomap` in the visualization type drop-down. @@ -138,7 +132,7 @@ tutorial as a starting point. 1. In the `Format` drop-down, select `Table`. - 1. **In the mode switcher, toggle `Code` and enter the query, then click `Run`** + 1. In the mode switcher, toggle `Code` and enter the query, then click `Run`. For example: @@ -157,21 +151,21 @@ tutorial as a starting point. LIMIT 500; ``` -1. **Customize the GeoMap settings** +1. **Customize the Geomap settings** - With default settings, the vizualization uses green circles of the fixed size. Configure at least the following for a more representative view: + With default settings, the visualization uses green circles of the fixed size. Configure at least the following for a more representative view: - 1. `Map layers` > `Styles` > `Size` > `value`. + -`Map layers` > `Styles` > `Size` > `value`. This changes the size of the circle depending on the value, with bigger circles representing bigger values. - - 1. `Map layers` > `Styles` > `Color` > `value`. - 1. `Thresholds` > Add `threshold`. + - `Map layers` > `Styles` > `Color` > `value`. + + - `Thresholds` > Add `threshold`. Add thresholds for 7 and 10, to mark rides over 7 and 10 miles in different colors, respectively. - You now have a vizualization that looks like this: + You now have a visualization that looks like this: ![Timescale and Grafana integration](https://assets.timescale.com/docs/images/timescale-grafana-integration.png) From 0af7b1fe7e05f0eecace660f35d0e921802735d6 Mon Sep 17 00:00:00 2001 From: atovpeko Date: Fri, 20 Dec 2024 15:13:18 +0200 Subject: [PATCH 18/39] new procedure with geomap --- _partials/_grafana-connect.md | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) diff --git a/_partials/_grafana-connect.md b/_partials/_grafana-connect.md index f110d37d04..5f8614481c 100644 --- a/_partials/_grafana-connect.md +++ b/_partials/_grafana-connect.md @@ -1,11 +1,7 @@ - -import ImportPrerequisites from "versionContent/_partials/_migrate_import_prerequisites.mdx"; - ## Prerequisites - - -* Install [self-managed Grafana][grafana-self-managed], or sign up for [Grafana Cloud][grafana-cloud]. +* [Create a target $SERVICE_LONG][create-service] +* Install [self-managed Grafana][grafana-self-managed], or sign up for [Grafana Cloud][grafana-cloud] ## Add your $SERVICE_LONG as a data source @@ -39,12 +35,13 @@ To connect the data in your $SERVICE_LONG to Grafana: `krifchuf3r8c5onn` is the password and `s5pq0es2cy.vfbtkqzhtm.tsdb.cloud.timescale.com:39941` is the host URL in the required format. - 1. Click `Save & test`. - + 1. **Click `Save & test`** + Grafana checks that your details are set correctly. [grafana-self-managed]: https://grafana.com/get/?tab=self-managed [grafana-cloud]: https://grafana.com/get/ -[cloud-login]: https://console.cloud.timescale.com/ \ No newline at end of file +[cloud-login]: https://console.cloud.timescale.com/ +[create-service]: getting-started/:currentVersion:/services \ No newline at end of file From 4b1c60ae6c995da553aadc93d12fe9879fdb517f Mon Sep 17 00:00:00 2001 From: atovpeko Date: Mon, 23 Dec 2024 10:03:32 +0200 Subject: [PATCH 19/39] internal links repointed --- tutorials/blockchain-analyze/index.md | 2 +- tutorials/energy-data/index.md | 2 +- tutorials/nyc-taxi-geospatial/index.md | 2 +- use-timescale/ingest-data/ingest-telegraf.md | 2 +- use-timescale/integrations/observability-alerting/grafana.md | 4 ++-- 5 files changed, 6 insertions(+), 6 deletions(-) diff --git a/tutorials/blockchain-analyze/index.md b/tutorials/blockchain-analyze/index.md index 16ce5a6694..aad12305f8 100644 --- a/tutorials/blockchain-analyze/index.md +++ b/tutorials/blockchain-analyze/index.md @@ -56,4 +56,4 @@ to graph the output in Grafana. [blockchain-query]: /tutorials/:currentVersion:/blockchain-query/beginner-blockchain-query/ [blockchain-def]: https://www.pcmag.com/encyclopedia/term/blockchain [transactions-def]: https://www.pcmag.com/encyclopedia/term/bitcoin-transaction -[grafana-setup]: /use-timescale/:currentVersion:/integrations/observability-alerting/grafana/installation/ +[grafana-setup]: /use-timescale/:currentVersion:/integrations/observability-alerting/grafana/#add-your-timescale-cloud-service-as-a-data-source diff --git a/tutorials/energy-data/index.md b/tutorials/energy-data/index.md index a6f93a0a94..c6be1e2dad 100644 --- a/tutorials/energy-data/index.md +++ b/tutorials/energy-data/index.md @@ -58,4 +58,4 @@ you through the steps to visualize the results in Grafana. [query-energy]: /tutorials/:currentVersion:/energy-data/query-energy/ [compress-energy]: /tutorials/:currentVersion:/energy-data/compress-energy/ [cloud-install]: /getting-started/:currentVersion:/#create-your-timescale-account -[grafana-setup]: /use-timescale/:currentVersion:/integrations/observability-alerting/grafana/installation/ +[grafana-setup]: /use-timescale/:currentVersion:/integrations/observability-alerting/grafana/#add-your-timescale-cloud-service-as-a-data-source diff --git a/tutorials/nyc-taxi-geospatial/index.md b/tutorials/nyc-taxi-geospatial/index.md index f7f614a793..ca16c2021a 100644 --- a/tutorials/nyc-taxi-geospatial/index.md +++ b/tutorials/nyc-taxi-geospatial/index.md @@ -63,4 +63,4 @@ information, and plotting the results in Grafana. [cloud-install]: /getting-started/:currentVersion:/#create-your-timescale-account [beginner-fleet]: /tutorials/:currentVersion:/nyc-taxi-cab/ [plot-nyc]: /tutorials/:currentVersion:/nyc-taxi-geospatial/plot-nyc/ -[grafana-setup]: /use-timescale/:currentVersion:/integrations/observability-alerting/grafana/installation/ +[grafana-setup]: /use-timescale/:currentVersion:/integrations/observability-alerting/grafana/#add-your-timescale-cloud-service-as-a-data-source diff --git a/use-timescale/ingest-data/ingest-telegraf.md b/use-timescale/ingest-data/ingest-telegraf.md index edcbce97e6..9874e9ff1f 100644 --- a/use-timescale/ingest-data/ingest-telegraf.md +++ b/use-timescale/ingest-data/ingest-telegraf.md @@ -158,5 +158,5 @@ see the [PostgreQL output plugin][output-plugin]. [install-telegraf]: https://docs.influxdata.com/telegraf/v1.21/introduction/installation/ [create-service]: /getting-started/latest/ [connect-timescaledb]: /use-timescale/:currentVersion:/integrations/query-admin/about-connecting/ -[grafana]: /use-timescale/:currentVersion:/integrations/observability-alerting/grafana/installation/ +[grafana]: /use-timescale/:currentVersion:/integrations/observability-alerting/grafana/ [about-hypertables]: /use-timescale/:currentVersion:/hypertables/about-hypertables/ diff --git a/use-timescale/integrations/observability-alerting/grafana.md b/use-timescale/integrations/observability-alerting/grafana.md index e60b0f37b8..933d528fe0 100644 --- a/use-timescale/integrations/observability-alerting/grafana.md +++ b/use-timescale/integrations/observability-alerting/grafana.md @@ -175,7 +175,7 @@ tutorial as a starting point. [nyc-taxi]: /tutorials/:currentVersion:/nyc-taxi-cab [grafana-website]: https://www.grafana.com [install-grafana]: /use-timescale/:currentVersion:/integrations/observability-alerting/grafana/installation -[tutorial-grafana-dashboards]: /use-timescale/:currentVersion:/integrations/observability-alerting/grafana/create-dashboard-and-panel/ -[tutorial-grafana-geospatial]: /use-timescale/:currentVersion:/integrations/observability-alerting/grafana/geospatial-dashboards/ +[tutorial-grafana-dashboards]: /use-timescale/:currentVersion:/integrations/observability-alerting/grafana/#create-a-grafana-dashboard-and-panel +[tutorial-grafana-geospatial]: /use-timescale/:currentVersion:/integrations/observability-alerting/grafana/#visualize-geospatial-data [time-buckets]: /use-timescale/:currentVersion:/time-buckets/ From 924221c1081c05945850ddf399b4e6d33a56d910 Mon Sep 17 00:00:00 2001 From: atovpeko Date: Mon, 23 Dec 2024 13:49:45 +0200 Subject: [PATCH 20/39] psql consolidated --- mst/installation-mst.md | 2 +- mst/migrate-to-mst.md | 2 +- quick-start/ruby.md | 2 +- self-hosted/install/installation-macos.md | 2 +- self-hosted/install/installation-source.md | 2 +- self-hosted/migration/entire-database.md | 2 +- self-hosted/migration/schema-then-data.md | 2 +- .../index.md | 2 +- .../query-admin/about-connecting.md | 2 +- .../integrations/query-admin/psql.md | 308 +++++++----------- .../metrics-logging/service-metrics.md | 2 +- use-timescale/page-index/page-index.js | 2 +- 12 files changed, 131 insertions(+), 199 deletions(-) diff --git a/mst/installation-mst.md b/mst/installation-mst.md index 7db99ce030..77fa20a4d8 100644 --- a/mst/installation-mst.md +++ b/mst/installation-mst.md @@ -122,7 +122,7 @@ You can always [contact us][contact] if you need help working something out, or if you want to have a chat. [contact]: https://www.timescale.com/contact -[install-psql]: /use-timescale/:currentVersion:/integrations/query-admin/about-psql/ +[install-psql]: /use-timescale/:currentVersion:/integrations/query-admin/psql/ [mst-docs]: /mst/:currentVersion:/ [tutorials]: /tutorials/:currentVersion:/ [mst-signup]: https://www.timescale.com/mst-signup diff --git a/mst/migrate-to-mst.md b/mst/migrate-to-mst.md index 79c80d6339..e8dcc38ed2 100644 --- a/mst/migrate-to-mst.md +++ b/mst/migrate-to-mst.md @@ -129,7 +129,7 @@ them. The migration still occurs successfully. [install-mst]: /mst/:currentVersion:/installation-mst/#create-your-first-service [pg_dump]: https://www.postgresql.org/docs/current/app-pgdump.html [pg_restore]: https://www.postgresql.org/docs/current/app-pgrestore.html -[psql]: /use-timescale/:currentVersion:/integrations/query-admin/about-psql/ +[psql]: /use-timescale/:currentVersion:/integrations/query-admin/psql/ [upgrading-postgresql]: https://kb-managed.timescale.com/en/articles/5368016-perform-a-postgresql-major-version-upgrade [upgrading-postgresql-self-hosted]: /self-hosted/:currentVersion:/upgrades/upgrade-pg/ [upgrading-timescaledb]: /self-hosted/:currentVersion:/upgrades/major-upgrade/ \ No newline at end of file diff --git a/quick-start/ruby.md b/quick-start/ruby.md index aa8efc96f8..842a0f4b3d 100644 --- a/quick-start/ruby.md +++ b/quick-start/ruby.md @@ -720,7 +720,7 @@ page by page, or all pages together, and group by path or not: [add-performance]: #add-performance-and-path-attributes-to-pageload [explore]: #explore-aggregation-functions [install]: /getting-started/latest/ -[psql-install]: /use-timescale/:currentVersion:/integrations/query-admin/about-psql/ +[psql-install]: /use-timescale/:currentVersion:/integrations/query-admin/psql/ [rails-guide]: https://guides.rubyonrails.org/getting_started.html [ab]: https://httpd.apache.org/docs/2.4/programs/ab.html [active-record-query]: https://guides.rubyonrails.org/active_record_querying.html diff --git a/self-hosted/install/installation-macos.md b/self-hosted/install/installation-macos.md index 9c13ef1ee8..46df6334c7 100644 --- a/self-hosted/install/installation-macos.md +++ b/self-hosted/install/installation-macos.md @@ -80,7 +80,7 @@ And that is it! You have TimescaleDB running on a database on a self-hosted inst For the latest functionality, install MacOS 14 Sanoma. The oldest supported version is macOS 10.15 Catalina [homebrew]: https://docs.brew.sh/Installation -[install-psql]: /use-timescale/:currentVersion:/integrations/query-admin/about-psql/ +[install-psql]: /use-timescale/:currentVersion:/integrations/query-admin/psql/ [macports]: https://guide.macports.org/#installing.macports [install-from-source]: /self-hosted/:currentVersion:/install/installation-source/ [install-postgresql]: https://www.postgresql.org/download/macosx/ \ No newline at end of file diff --git a/self-hosted/install/installation-source.md b/self-hosted/install/installation-source.md index 374efd6bda..6d98665790 100644 --- a/self-hosted/install/installation-source.md +++ b/self-hosted/install/installation-source.md @@ -73,7 +73,7 @@ And that is it! You have TimescaleDB running on a database on a self-hosted inst -[install-psql]: /use-timescale/:currentVersion:/integrations/query-admin/about-psql/ +[install-psql]: /use-timescale/:currentVersion:/integrations/query-admin/psql/ [config]: /self-hosted/:currentVersion:/configuration/ [postgres-download]: https://www.postgresql.org/download/ [cmake-download]: https://cmake.org/download/ diff --git a/self-hosted/migration/entire-database.md b/self-hosted/migration/entire-database.md index b368da421b..66a135f041 100644 --- a/self-hosted/migration/entire-database.md +++ b/self-hosted/migration/entire-database.md @@ -118,7 +118,7 @@ information about compression and decompression, see [Compression][compression]. [migrate-separately]: /self-hosted/:currentVersion:/migration/schema-then-data/ [pg_dump]: https://www.postgresql.org/docs/current/app-pgdump.html [pg_restore]: https://www.postgresql.org/docs/current/app-pgrestore.html -[psql]: /use-timescale/:currentVersion:/integrations/query-admin/about-psql/ +[psql]: /use-timescale/:currentVersion:/integrations/query-admin/psql/ [timescaledb_pre_restore]: /api/:currentVersion:/administration/#timescaledb_pre_restore [timescaledb_post_restore]: /api/:currentVersion:/administration/#timescaledb_post_restore [upgrading-postgresql-self-hosted]: /self-hosted/:currentVersion:/upgrades/upgrade-pg/ diff --git a/self-hosted/migration/schema-then-data.md b/self-hosted/migration/schema-then-data.md index 056b29c168..0091cec014 100644 --- a/self-hosted/migration/schema-then-data.md +++ b/self-hosted/migration/schema-then-data.md @@ -210,7 +210,7 @@ the [compression section](https://docs.timescale.com/use-timescale/latest/compre [install-selfhosted]: /self-hosted/:currentVersion:/install/ [pg_dump]: https://www.postgresql.org/docs/current/app-pgdump.html [pg_restore]: https://www.postgresql.org/docs/current/app-pgrestore.html -[psql]: /use-timescale/:currentVersion:/integrations/query-admin/about-psql/ +[psql]: /use-timescale/:currentVersion:/integrations/query-admin/psql/ [timescaledb-parallel-copy]: https://github.com/timescale/timescaledb-parallel-copy [upgrading-postgresql]: https://kb-managed.timescale.com/en/articles/5368016-perform-a-postgresql-major-version-upgrade [upgrading-postgresql-self-hosted]: /self-hosted/:currentVersion:/upgrades/upgrade-pg/ diff --git a/tutorials/OLD-financial-candlestick-tick-data/index.md b/tutorials/OLD-financial-candlestick-tick-data/index.md index 4b339e733c..4d0dea5a07 100644 --- a/tutorials/OLD-financial-candlestick-tick-data/index.md +++ b/tutorials/OLD-financial-candlestick-tick-data/index.md @@ -73,4 +73,4 @@ Follow this tutorial and see how to set up your TimescaleDB database to consume [create]: /tutorials/:currentVersion:/financial-candlestick-tick-data/create-candlestick-aggregates [query]: /tutorials/:currentVersion:/financial-candlestick-tick-data/query-candlestick-views [manage]: /tutorials/:currentVersion:/financial-candlestick-tick-data/advanced-data-management -[psql]: /use-timescale/:currentVersion:/integrations/query-admin/about-psql/ +[psql]: /use-timescale/:currentVersion:/integrations/query-admin/psql/ diff --git a/use-timescale/integrations/query-admin/about-connecting.md b/use-timescale/integrations/query-admin/about-connecting.md index 12ba4d6c0c..16cc6e75ea 100644 --- a/use-timescale/integrations/query-admin/about-connecting.md +++ b/use-timescale/integrations/query-admin/about-connecting.md @@ -85,5 +85,5 @@ for accessing your database, and add additional authentication requirements. -[about-psql]: /use-timescale/:currentVersion:/integrations/query-admin/about-psql/ +[about-psql]: /use-timescale/:currentVersion:/integrations/query-admin/psql/ [tsc-portal]: https://console.cloud.timescale.com/ diff --git a/use-timescale/integrations/query-admin/psql.md b/use-timescale/integrations/query-admin/psql.md index 0ce770440a..9e4afd580e 100644 --- a/use-timescale/integrations/query-admin/psql.md +++ b/use-timescale/integrations/query-admin/psql.md @@ -5,244 +5,177 @@ products: [cloud, mst, self_hosted] keywords: [connect, psql] --- -# Connect using psql +# Connect with psql You use `psql` command line tool to interact with your $SERVICE_LONG. Most procedures in the $COMPANY documentation assume you are using `psql`. -To use `psql` to connect to your database, you need the connection details for your PostgreSQL server. For more information about how to retrieve your -connection details, see the [about connecting][about-connecting] section. +To use `psql` to connect to your database, you need the connection details for your PostgreSQL server. Find those in the connection string generated during service creation. For more information, see [Connecting to Timescale][about-connecting]. -## Install psql - -Before you start, check that you don't already have `psql` installed. It is -sometimes installed by default, depending on your operating system and other -packages you have installed over time: - - - - - -```bash -psql --version -``` - - - - - -```powershell -wmic -/output:C:\list.txt product get name, version -``` - - - - - -### Install PostgreSQL package on macOS - -The `psql` tool is installed by default on macOS systems when you install -PostgreSQL, and this is the most effective way to install the tool. - -You can use Homebrew or MacPorts to install the PostgreSQL package -or just the `psql` tool. - - - - - - - -1. Install Homebrew if you don't already have it: - - ```bash - /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)" - ``` - - For more information about Homebrew, including installation instructions, - see the [Homebrew documentation][homebrew]. -1. Make sure your Homebrew repository is up to date: - - ```bash - brew doctor - brew update - ``` - -1. Install PostgreSQL: - - ```bash - brew install postgresql - ``` - - - - - - - - - -1. Install MacPorts by downloading and running the package installer.. - For more information about MacPorts, including installation instructions, - see the [MacPorts documentation][macports]. -1. Install the latest version of Postgresql: +1. **Check for an existing installation** + `psql` is sometimes installed by default, depending on your operating system and other packages you have installed over time. + + + + + ```bash - sudo port install postgresql + psql --version ``` - - For example, to install version *14* replace `postgresql` with `postgresql14`. -1. View the files that were installed: - - ```bash - port contents postgresql + + + + + + ```powershell + wmic + /output:C:\list.txt product get name, version ``` + + + + - - - - - - -### Install psql on macOS +1. **Install psql** -If you do not want to install the entire PostgreSQL package, you can install the `psql` tool on its own. `libpqxx` is the official C++ client API for PostgreSQL. + If there is no existing installation, take the following steps to install `psql` depending on your platform. + + + + - + Install using Homebrew or MacPorts. `libpqxx` is the official C++ client API for PostgreSQL. - + - Homebrew - + -1. Install Homebrew, if you don't already have it: + 1. Install Homebrew, if you don't already have it: - ```bash - /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)" - ``` + ```bash + /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)" + ``` - For more information about Homebrew, including installation instructions, - see the [Homebrew documentation][homebrew]. -1. Make sure your Homebrew repository is up to date: + For more information about Homebrew, including installation instructions, see the [Homebrew documentation][homebrew]. + + 1. Make sure your Homebrew repository is up to date: - ```bash - brew doctor - brew update - ``` + ```bash + brew doctor + brew update + ``` -1. Install `psql`: + 1. Install `psql`: - ```bash - brew install libpq - ``` + ```bash + brew install libpq + ``` -1. Update your path to include the `psql` tool. + 1. Update your path to include the `psql` tool: - ```bash - brew link --force libpq - ``` + ```bash + brew link --force libpq + ``` - On Intel chips, the symbolic link is added to `/usr/local/bin`. On Apple - Silicon, the symbolic link is added to `/opt/homebrew/bin`. + On Intel chips, the symbolic link is added to `/usr/local/bin`. On Apple Silicon, the symbolic link is added to `/opt/homebrew/bin`. - + - + - MacPorts - + - + 1. Install MacPorts by downloading and running the package installer. -1. Install MacPorts by downloading and running the package installer. - For more information about MacPorts, including installation instructions, - see the [MacPorts documentation][macports]. -1. Install the latest version of libpqxx: + For more information about MacPorts, including installation instructions, see the [MacPorts documentation][macports]. - ```bash - sudo port install libpqxx - ``` + 1. Install the latest version of `libpqxx`: -1. View the files that were installed by libpqxx: + ```bash + sudo port install libpqxx + ``` + + 1. View the files that were installed by `libpqxx`: - ```bash - port contents libpqxx - ``` + ```bash + port contents libpqxx + ``` + + - + + + - + Install `psql` on Debian and Ubuntu with the `apt` package manager. - + -### Install psql on Debian and Ubuntu + 1. Make sure your `apt` repository is up to date: -You can use the `apt` package manager on Debian and Ubuntu systems to install -the `psql` tool. + ```bash + sudo apt-get update + ``` - + 1. Install the `postgresql-client` package: -1. Make sure your `apt` repository is up to date: + ```bash + sudo apt-get install postgresql-client + ``` - ```bash - sudo apt-get update - ``` + -1. Install the `postgresql-client` package: + - ```bash - sudo apt-get install postgresql-client - ``` + - + `psql` is installed by default when you install PostgreSQL. This procedure uses the interactive installer provided by PostgreSQL and EnterpriseDB. -### Install psql on Windows + -The `psql` tool is installed by default on Windows systems when you install -PostgreSQL, and this is the most effective way to install the tool. These -instructions use the interactive installer provided by PostgreSQL and -EnterpriseDB. + 1. Download and run the PostgreSQL installer from [www.enterprisedb.com][windows-installer]. + + 1. In the `Select Components` dialog, check `Command Line Tools`, along with any other components you want to install, and click `Next`. - + 1. Complete the installation wizard to install the package. -1. Download and run the PostgreSQL installer from - [www.enterprisedb.com][windows-installer]. -1. In the `Select Components` dialog, check `Command Line Tools`, along with - any other components you want to install, and click `Next`. -1. Complete the installation wizard to install the package. + - + -## Connect to your database + -There are two different ways you can use `psql` to connect to your database. +1. **Connect to your database** -You can provide the details using parameter flags, like this: + There are two different ways you can use `psql` to connect to your database. -```bash -psql -h -p -U -W -d -``` + - With parameter flags: + + ```bash + psql -h -p -U -W -d + ``` -Alternatively, you can use a service URL to provide the details, like this: + - With a service URL: -```bash -psql postgres://@:/?sslmode=require -``` + - If you have configured the [SSL mode][ssl-mode] connection: -If you configured your Timescale service to connect using -[SSL mode][ssl-mode], use: + ```bash + psql "postgres://tsdbadmin@/tsdb?sslmode=verify-full" + ``` -```bash -psql "postgres://tsdbadmin@/tsdb?sslmode=verify-full" -``` + - If you haven't configured the SSL mode connection: + + ```bash + psql postgres://@:/?sslmode=require + ``` -When you run one of these commands, you are prompted for your password. If you -don't want to be prompted, you can supply your password directly within the service -URL instead, like this: + - If you want to supply your password directly within the service URL instead of being prompted for it: -```bash -psql "postgres://:@:/?sslmode=require" -``` + ```bash + psql "postgres://:@:/?sslmode=require" + ``` -## Common psql commands +## Useful psql commands When you start using `psql`, these are the commands you are likely to use most frequently: @@ -270,14 +203,11 @@ frequently: |`\x`|Show expanded query results| |`\?`|List all `psql` slash commands| -* For a more comprehensive list of `psql` commands, see the - [Timescale psql cheat sheet][psql-cheat-sheet]. -* For more information about all `psql` commands, see the - [psql documentation][psql-docs]. +For more on `psql` commands, see the [Timescale psql cheat sheet][psql-cheat-sheet] and [psql documentation][psql-docs]. -## Save query results to a file +### Save query results to a file -When you run queries in `psql`, the results are shown in the Console by default. +When you run queries in `psql`, the results are shown in the console by default. If you are running queries that have a lot of results, you might like to save the results into a comma-separated `.csv` file instead. You can do this using the `COPY` command. For example: @@ -299,7 +229,6 @@ loaded into the editor. When you have made your changes, press `Esc`, then type `:`+`w`+`q` to save the changes, and return to the command prompt. Access the edited query by pressing `↑`, and press `Enter` to run it. - [about-connecting]: /use-timescale/:currentVersion:/integrations/query-admin/about-connecting/ [psql-cheat-sheet]: https://www.timescale.com/learn/postgres-cheat-sheet [psql-docs]: https://www.postgresql.org/docs/13/app-psql.html @@ -307,3 +236,6 @@ edited query by pressing `↑`, and press `Enter` to run it. [homebrew]: https://docs.brew.sh/Installation [macports]: https://guide.macports.org/#installing.macports [windows-installer]: https://www.postgresql.org/download/windows/ + + + diff --git a/use-timescale/metrics-logging/service-metrics.md b/use-timescale/metrics-logging/service-metrics.md index 0be8320552..72be7c5ce2 100644 --- a/use-timescale/metrics-logging/service-metrics.md +++ b/use-timescale/metrics-logging/service-metrics.md @@ -136,4 +136,4 @@ performance bottlenecks with `pg_stat_statements`][blog-pg_stat_statements]. [metrics-dashboard]: /use-timescale/:currentVersion:/metrics-logging/service-metrics/ [pg-stat]: /use-timescale/:currentVersion:/metrics-logging/service-metrics/#query-level-statistics-with-pg_stat_statements [blog-pg_stat_statements]: -[psql]: /use-timescale/:currentVersion:/integrations/query-admin/about-psql/ +[psql]: /use-timescale/:currentVersion:/integrations/query-admin/psql/ diff --git a/use-timescale/page-index/page-index.js b/use-timescale/page-index/page-index.js index c0f18e46b0..f352e9b687 100644 --- a/use-timescale/page-index/page-index.js +++ b/use-timescale/page-index/page-index.js @@ -785,7 +785,7 @@ module.exports = [ excerpt: "Learn about using connecting to your Timescale database", }, { - title: "Install psql", + title: "Connect with psql", href: "psql", excerpt: "Install psql to connect to Timescale", }, From 798d8ac0ae9bb6f8cde1bcc846300854514c6f5e Mon Sep 17 00:00:00 2001 From: atovpeko Date: Thu, 2 Jan 2025 12:28:39 +0200 Subject: [PATCH 21/39] flatten structure --- use-timescale/ingest-data/ingest-telegraf.md | 2 +- .../{query-admin => }/about-connecting.md | 0 .../{query-admin => }/azure-data-studio.md | 0 .../integrations/config-deploy/index.md | 13 -- .../integrations/{query-admin => }/dbeaver.md | 0 .../{observability-alerting => }/grafana.md | 0 use-timescale/integrations/index.md | 48 +++---- .../observability-alerting/index.md | 17 --- .../integrations/{query-admin => }/pgadmin.md | 0 .../integrations/{query-admin => }/psql.md | 2 +- .../integrations/{query-admin => }/qstudio.md | 0 .../integrations/query-admin/index.md | 23 ---- .../{observability-alerting => }/tableau.md | 0 .../{config-deploy => }/terraform.md | 0 use-timescale/page-index/page-index.js | 121 +++++++----------- 15 files changed, 71 insertions(+), 155 deletions(-) rename use-timescale/integrations/{query-admin => }/about-connecting.md (100%) rename use-timescale/integrations/{query-admin => }/azure-data-studio.md (100%) delete mode 100644 use-timescale/integrations/config-deploy/index.md rename use-timescale/integrations/{query-admin => }/dbeaver.md (100%) rename use-timescale/integrations/{observability-alerting => }/grafana.md (100%) delete mode 100644 use-timescale/integrations/observability-alerting/index.md rename use-timescale/integrations/{query-admin => }/pgadmin.md (100%) rename use-timescale/integrations/{query-admin => }/psql.md (99%) rename use-timescale/integrations/{query-admin => }/qstudio.md (100%) delete mode 100644 use-timescale/integrations/query-admin/index.md rename use-timescale/integrations/{observability-alerting => }/tableau.md (100%) rename use-timescale/integrations/{config-deploy => }/terraform.md (100%) diff --git a/use-timescale/ingest-data/ingest-telegraf.md b/use-timescale/ingest-data/ingest-telegraf.md index 9874e9ff1f..16e91817fa 100644 --- a/use-timescale/ingest-data/ingest-telegraf.md +++ b/use-timescale/ingest-data/ingest-telegraf.md @@ -157,6 +157,6 @@ see the [PostgreQL output plugin][output-plugin]. [output-plugin]: https://github.com/influxdata/telegraf/blob/release-1.24/plugins/outputs/postgresql/README.md [install-telegraf]: https://docs.influxdata.com/telegraf/v1.21/introduction/installation/ [create-service]: /getting-started/latest/ -[connect-timescaledb]: /use-timescale/:currentVersion:/integrations/query-admin/about-connecting/ +[connect-timescaledb]: /use-timescale/:currentVersion:/integrations/about-connecting/ [grafana]: /use-timescale/:currentVersion:/integrations/observability-alerting/grafana/ [about-hypertables]: /use-timescale/:currentVersion:/hypertables/about-hypertables/ diff --git a/use-timescale/integrations/query-admin/about-connecting.md b/use-timescale/integrations/about-connecting.md similarity index 100% rename from use-timescale/integrations/query-admin/about-connecting.md rename to use-timescale/integrations/about-connecting.md diff --git a/use-timescale/integrations/query-admin/azure-data-studio.md b/use-timescale/integrations/azure-data-studio.md similarity index 100% rename from use-timescale/integrations/query-admin/azure-data-studio.md rename to use-timescale/integrations/azure-data-studio.md diff --git a/use-timescale/integrations/config-deploy/index.md b/use-timescale/integrations/config-deploy/index.md deleted file mode 100644 index c5ca96367c..0000000000 --- a/use-timescale/integrations/config-deploy/index.md +++ /dev/null @@ -1,13 +0,0 @@ ---- -title: Configuration and deployment integrations -excerpt: Integrate your Timescale database with third-party configuration and deployment solutions -products: [cloud] -keywords: [integrations, configuration, deployment] -tags: [integrations, terraform] ---- - -# Configuration and deployment integrations - -* [Terraform][terraform] - -[terraform]: /use-timescale/:currentVersion:/integrations/config-deploy/terraform diff --git a/use-timescale/integrations/query-admin/dbeaver.md b/use-timescale/integrations/dbeaver.md similarity index 100% rename from use-timescale/integrations/query-admin/dbeaver.md rename to use-timescale/integrations/dbeaver.md diff --git a/use-timescale/integrations/observability-alerting/grafana.md b/use-timescale/integrations/grafana.md similarity index 100% rename from use-timescale/integrations/observability-alerting/grafana.md rename to use-timescale/integrations/grafana.md diff --git a/use-timescale/integrations/index.md b/use-timescale/integrations/index.md index e0f3e0b59f..db4882aa26 100644 --- a/use-timescale/integrations/index.md +++ b/use-timescale/integrations/index.md @@ -6,35 +6,29 @@ keywords: [integrations] tags: [integrations] --- - # Integrate tooling with Timescale Cloud -You can integrate your Timescale database with third-party solutions to expand +Integrate your $SERVICE_LONG with third-party solutions to expand and extend what you can do with your data. -|[Query and administration][query-admin]|[Configuration and deployment][config-deploy]|[Observability and alerting][observability-alerting]| -|-|-|-| -|[PopSQL][popsql]| -|[psql][psql]|[Terraform][terraform]|[Grafana][grafana]| -|[DBeaver][dbeaver]||[Tableau][tableau]| -|[Azure Data Studio][ads]| -|[pgAdmin][pgadmin]| -|[qStudio][qstudio]| - - - -[query-admin]: /use-timescale/:currentVersion:/integrations/query-admin/ -[observability-alerting]: /use-timescale/:currentVersion:/integrations/observability-alerting/ -[data-ingest]: /use-timescale/:currentVersion:/integrations/data-ingest/ -[config-deploy]: /use-timescale/:currentVersion:/integrations/config-deploy/ -[psql]: /use-timescale/:currentVersion:/integrations/query-admin/psql/ -[dbeaver]: /use-timescale/:currentVersion:/integrations/query-admin/dbeaver/ -[ads]: /use-timescale/:currentVersion:/integrations/query-admin/azure-data-studio/ -[pgadmin]: /use-timescale/:currentVersion:/integrations/query-admin/pgadmin/ -[qstudio]: /use-timescale/:currentVersion:/integrations/query-admin/qstudio/ -[grafana]: /use-timescale/:currentVersion:/integrations/observability-alerting/grafana/ -[telegraf]: /use-timescale/:currentVersion:/integrations/data-ingest/telegraf/ -[tableau]: /use-timescale/:currentVersion:/integrations/observability-alerting/tableau/ -[terraform]: /use-timescale/:currentVersion:/integrations/config-deploy/terraform/ -[popsql]: /getting-started/:currentVersion:/run-queries-from-console/#data-mode +| Name | Category | Description | +|:------------------------:|------------------------------|-------------| +| [Azure Data Studio][ads] | Query and administration | | +| [DBeaver][dbeaver] | Query and administration | | +| [pgAdmin][pgadmin] | Query and administration | | +| [psql][psql] | Query and administration | | +| [qStudio][qstudio] | Query and administration | | +| [Grafana][grafana] | Observability and alerting | | +| [Tableau][tableau] | Observability and alerting | | +| [Terraform][terraform] | Configuration and deployment | | + + +[psql]: /use-timescale/:currentVersion:/query-admin/psql/ +[qstudio]: /use-timescale/:currentVersion:/integrations/qstudio/ +[dbeaver]: /use-timescale/:currentVersion:/integrations/dbeaver/ +[ads]: /use-timescale/:currentVersion:/integrations/azure-data-studio/ +[pgadmin]: /use-timescale/:currentVersion:/integrations/pgadmin/ +[grafana]: /use-timescale/:currentVersion:/integrations/grafana/ +[tableau]: /use-timescale/:currentVersion:/integrations/tableau/ +[terraform]: /use-timescale/:currentVersion:/integrations/terraform diff --git a/use-timescale/integrations/observability-alerting/index.md b/use-timescale/integrations/observability-alerting/index.md deleted file mode 100644 index 79e490396e..0000000000 --- a/use-timescale/integrations/observability-alerting/index.md +++ /dev/null @@ -1,17 +0,0 @@ ---- -title: Observability and alerting integrations -excerpt: Integrate your Timescale database with third-party observability and alerting solutions -products: [cloud] -keywords: [integrations, observability, alerting] -tags: [integrations, observability, alerting] ---- - - - -# Observability and alerting - -* [Grafana][grafana] -* [Tableau][tableau] - -[grafana]: /use-timescale/:currentVersion:/integrations/observability-alerting/grafana/ -[tableau]: /use-timescale/:currentVersion:/integrations/observability-alerting/tableau/ diff --git a/use-timescale/integrations/query-admin/pgadmin.md b/use-timescale/integrations/pgadmin.md similarity index 100% rename from use-timescale/integrations/query-admin/pgadmin.md rename to use-timescale/integrations/pgadmin.md diff --git a/use-timescale/integrations/query-admin/psql.md b/use-timescale/integrations/psql.md similarity index 99% rename from use-timescale/integrations/query-admin/psql.md rename to use-timescale/integrations/psql.md index 9e4afd580e..652b88b78c 100644 --- a/use-timescale/integrations/query-admin/psql.md +++ b/use-timescale/integrations/psql.md @@ -229,7 +229,7 @@ loaded into the editor. When you have made your changes, press `Esc`, then type `:`+`w`+`q` to save the changes, and return to the command prompt. Access the edited query by pressing `↑`, and press `Enter` to run it. -[about-connecting]: /use-timescale/:currentVersion:/integrations/query-admin/about-connecting/ +[about-connecting]: /use-timescale/:currentVersion:/integrations/about-connecting/ [psql-cheat-sheet]: https://www.timescale.com/learn/postgres-cheat-sheet [psql-docs]: https://www.postgresql.org/docs/13/app-psql.html [ssl-mode]: /use-timescale/:currentVersion:/security/strict-ssl/ diff --git a/use-timescale/integrations/query-admin/qstudio.md b/use-timescale/integrations/qstudio.md similarity index 100% rename from use-timescale/integrations/query-admin/qstudio.md rename to use-timescale/integrations/qstudio.md diff --git a/use-timescale/integrations/query-admin/index.md b/use-timescale/integrations/query-admin/index.md deleted file mode 100644 index 94eee66a68..0000000000 --- a/use-timescale/integrations/query-admin/index.md +++ /dev/null @@ -1,23 +0,0 @@ ---- -title: Query and administration integrations -excerpt: Integrate your Timescale database with third-party query and administration solutions -products: [cloud] -keywords: [integrations, queries, administration] -tags: [integrations, psql, dbeaver, azure data studio, pgadmin] ---- - - - -# Query and administration integrations - -* [Azure Data Studio][ads] -* [DBeaver][dbeaver] -* [PGAdmin][pgadmin] -* [psql][psql] -* [qStudio][qstudio] - -[psql]: /use-timescale/:currentVersion:/integrations/query-admin/psql/ -[qstudio]: /use-timescale/:currentVersion:/integrations/query-admin/qstudio/ -[dbeaver]: /use-timescale/:currentVersion:/integrations/query-admin/dbeaver/ -[ads]: /use-timescale/:currentVersion:/integrations/query-admin/azure-data-studio/ -[pgadmin]: /use-timescale/:currentVersion:/integrations/query-admin/pgadmin/ diff --git a/use-timescale/integrations/observability-alerting/tableau.md b/use-timescale/integrations/tableau.md similarity index 100% rename from use-timescale/integrations/observability-alerting/tableau.md rename to use-timescale/integrations/tableau.md diff --git a/use-timescale/integrations/config-deploy/terraform.md b/use-timescale/integrations/terraform.md similarity index 100% rename from use-timescale/integrations/config-deploy/terraform.md rename to use-timescale/integrations/terraform.md diff --git a/use-timescale/page-index/page-index.js b/use-timescale/page-index/page-index.js index dc41fe2694..8c5e0cd9c2 100644 --- a/use-timescale/page-index/page-index.js +++ b/use-timescale/page-index/page-index.js @@ -774,78 +774,54 @@ module.exports = [ excerpt: "Integrate third-party solutions with Timescale Cloud", children: [ { - title: "Query and administration", - href: "query-admin", - excerpt: "Integrate your Timescale database with third-party query and administration solutions", - children: - [ - { - title: "About connecting to Timescale", - href: "about-connecting", - excerpt: "Learn about using connecting to your Timescale database", - }, - { - title: "Connect with psql", - href: "psql", - excerpt: "Install psql to connect to Timescale", - }, - { - title: "Connect using Azure Data Studio", - href: "azure-data-studio", - excerpt: "Install Azure Data Studio to connect to Timescale", - }, - { - title: "Connect using DBeaver", - href: "dbeaver", - excerpt: "Install DBeaver to connect to Timescale", - }, - { - title: "Connect using pgAdmin", - href: "pgadmin", - excerpt: "Install pgAdmin to connect to Timescale", - }, - { - title: "Connect using qStudio", - href: "qstudio", - excerpt: "Install qstudio to connect to Timescale", - }, - { - title: "Troubleshooting Timescale connections", - href: "troubleshooting", - type: "placeholder", - }, - ] - }, - { - title: "Configuration and deployment", - href: "config-deploy", - excerpt: "Integrate your Timescale account with third-party configuration and deployment solutions", - children: - [ - { - title: "Terraform", - href: "terraform", - excerpt: "Manage your Timescale services via Terraform", - }, - ] - }, - { - title: "Observability and alerting", - href: "observability-alerting", - excerpt: "Integrate your Timescale database with third-party observability and alerting solutions", - children: - [ - { - title: "Grafana", - href: "grafana", - excerpt: "Use Grafana with Timescale", - }, - { - title: "Tableau", - href: "tableau", - excerpt: "Use Tableau with Timescale", - } - ] + title: "About connecting to Timescale", + href: "about-connecting", + excerpt: "Learn about using connecting to your Timescale database", + }, + { + title: "Azure Data Studio", + href: "azure-data-studio", + excerpt: "Install Azure Data Studio to connect to Timescale", + }, + { + title: "DBeaver", + href: "dbeaver", + excerpt: "Install DBeaver to connect to Timescale", + }, + { + title: "pgAdmin", + href: "pgadmin", + excerpt: "Install pgAdmin to connect to Timescale", + }, + { + title: "psql", + href: "psql", + excerpt: "Install psql to connect to Timescale", + }, + { + title: "qStudio", + href: "qstudio", + excerpt: "Install qstudio to connect to Timescale", + }, + { + title: "Grafana", + href: "grafana", + excerpt: "Use Grafana with Timescale", + }, + { + title: "Tableau", + href: "tableau", + excerpt: "Use Tableau with Timescale", + }, + { + title: "Terraform", + href: "terraform", + excerpt: "Manage your Timescale services via Terraform", + }, + { + title: "Troubleshooting Timescale integrations", + href: "troubleshooting", + type: "placeholder", }, ], }, @@ -908,7 +884,6 @@ module.exports = [ href: "troubleshoot-timescaledb", excerpt: "Troubleshooting Timescale", }, - ], }, ]; From b4b50bd7703b89e62bdf3e59cca4f945fbb3c083 Mon Sep 17 00:00:00 2001 From: atovpeko Date: Mon, 6 Jan 2025 13:19:18 +0200 Subject: [PATCH 22/39] descriptions --- use-timescale/integrations/index.md | 21 ++++++++++----------- 1 file changed, 10 insertions(+), 11 deletions(-) diff --git a/use-timescale/integrations/index.md b/use-timescale/integrations/index.md index db4882aa26..520c446346 100644 --- a/use-timescale/integrations/index.md +++ b/use-timescale/integrations/index.md @@ -11,17 +11,16 @@ tags: [integrations] Integrate your $SERVICE_LONG with third-party solutions to expand and extend what you can do with your data. - -| Name | Category | Description | -|:------------------------:|------------------------------|-------------| -| [Azure Data Studio][ads] | Query and administration | | -| [DBeaver][dbeaver] | Query and administration | | -| [pgAdmin][pgadmin] | Query and administration | | -| [psql][psql] | Query and administration | | -| [qStudio][qstudio] | Query and administration | | -| [Grafana][grafana] | Observability and alerting | | -| [Tableau][tableau] | Observability and alerting | | -| [Terraform][terraform] | Configuration and deployment | | +| Name | Category | Description | +|:------------------------:|------------------------------|------------------------------------------------| +| [Azure Data Studio][ads] | Query and administration | Connect to $CLOUD_LONG with Azure Data Studio. | +| [DBeaver][dbeaver] | Query and administration | Connect to $CLOUD_LONG with DBeaver. | +| [pgAdmin][pgadmin] | Query and administration | Connect to $CLOUD_LONG with pgAdmin. | +| [psql][psql] | Query and administration | Connect to $CLOUD_LONG with psql. | +| [qStudio][qstudio] | Query and administration | Connect to $CLOUD_LONG with qStudio. | +| [Grafana][grafana] | Observability and alerting | Visualize your data with Grafana. | +| [Tableau][tableau] | Observability and alerting | Visualize your data with Tableau. | +| [Terraform][terraform] | Configuration and deployment | Manage your $SERVICE_LONGs with Terraform. | [psql]: /use-timescale/:currentVersion:/query-admin/psql/ From 67cbaf7367ce05b4657548898c0269ceb7720d07 Mon Sep 17 00:00:00 2001 From: atovpeko Date: Mon, 6 Jan 2025 14:40:50 +0200 Subject: [PATCH 23/39] review comments --- .../integrations/query-admin/psql.md | 212 +++++++++--------- 1 file changed, 110 insertions(+), 102 deletions(-) diff --git a/use-timescale/integrations/query-admin/psql.md b/use-timescale/integrations/query-admin/psql.md index 9e4afd580e..51cf0d2333 100644 --- a/use-timescale/integrations/query-admin/psql.md +++ b/use-timescale/integrations/query-admin/psql.md @@ -9,176 +9,184 @@ keywords: [connect, psql] You use `psql` command line tool to interact with your $SERVICE_LONG. Most procedures in the $COMPANY documentation assume you are using `psql`. -To use `psql` to connect to your database, you need the connection details for your PostgreSQL server. Find those in the connection string generated during service creation. For more information, see [Connecting to Timescale][about-connecting]. +## Prerequisites -1. **Check for an existing installation** - `psql` is sometimes installed by default, depending on your operating system and other packages you have installed over time. - - - - + +## Check for an existing installation + +On many operating systems, `psql` is installed by default. To use the functionality described in this pag, best practice is to use the latest version of psql. To check the version running on your system: + + + - ```bash - psql --version - ``` + - + +```bash +psql --version +``` - + - ```powershell - wmic - /output:C:\list.txt product get name, version - ``` + + - +```powershell +wmic +/output:C:\list.txt product get name, version +``` + + - + -1. **Install psql** +## Install psql - If there is no existing installation, take the following steps to install `psql` depending on your platform. +If there is no existing installation, take the following steps to install `psql` depending on your platform. - + - + - Install using Homebrew or MacPorts. `libpqxx` is the official C++ client API for PostgreSQL. +Install using Homebrew. `libpqxx` is the official C++ client API for PostgreSQL. - - Homebrew + - +1. Install Homebrew, if you don't already have it: - 1. Install Homebrew, if you don't already have it: - - ```bash - /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)" - ``` + ```bash + /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)" + ``` - For more information about Homebrew, including installation instructions, see the [Homebrew documentation][homebrew]. + For more information about Homebrew, including installation instructions, see the [Homebrew documentation][homebrew]. - 1. Make sure your Homebrew repository is up to date: +1. Make sure your Homebrew repository is up to date: + + ```bash + brew doctor + brew update + ``` - ```bash - brew doctor - brew update - ``` +1. Install `psql`: - 1. Install `psql`: + ```bash + brew install libpq + ``` - ```bash - brew install libpq - ``` +1. Update your path to include the `psql` tool: + + ```bash + brew link --force libpq + ``` - 1. Update your path to include the `psql` tool: +On Intel chips, the symbolic link is added to `/usr/local/bin`. On Apple Silicon, the symbolic link is added to `/opt/homebrew/bin`. - ```bash - brew link --force libpq - ``` + - On Intel chips, the symbolic link is added to `/usr/local/bin`. On Apple Silicon, the symbolic link is added to `/opt/homebrew/bin`. + - + - - MacPorts +Install using MacPorts. `libpqxx` is the official C++ client API for PostgreSQL. - + - 1. Install MacPorts by downloading and running the package installer. +1. Install MacPorts by downloading and running the package installer. - For more information about MacPorts, including installation instructions, see the [MacPorts documentation][macports]. + For more information about MacPorts, including installation instructions, see the [MacPorts documentation][macports]. - 1. Install the latest version of `libpqxx`: +1. Install the latest version of `libpqxx`: - ```bash - sudo port install libpqxx - ``` + ```bash + sudo port install libpqxx + ``` - 1. View the files that were installed by `libpqxx`: +1. View the files that were installed by `libpqxx`: - ```bash - port contents libpqxx - ``` + ```bash + port contents libpqxx + ``` - + - + - + - Install `psql` on Debian and Ubuntu with the `apt` package manager. +Install `psql` on Debian and Ubuntu with the `apt` package manager. - + - 1. Make sure your `apt` repository is up to date: +1. Make sure your `apt` repository is up to date: - ```bash + ```bash sudo apt-get update - ``` + ``` - 1. Install the `postgresql-client` package: +1. Install the `postgresql-client` package: - ```bash - sudo apt-get install postgresql-client - ``` + ```bash + sudo apt-get install postgresql-client + ``` - + - + - + - `psql` is installed by default when you install PostgreSQL. This procedure uses the interactive installer provided by PostgreSQL and EnterpriseDB. +`psql` is installed by default when you install PostgreSQL. This procedure uses the interactive installer provided by PostgreSQL and EnterpriseDB. - + - 1. Download and run the PostgreSQL installer from [www.enterprisedb.com][windows-installer]. +1. Download and run the PostgreSQL installer from [www.enterprisedb.com][windows-installer]. - 1. In the `Select Components` dialog, check `Command Line Tools`, along with any other components you want to install, and click `Next`. +1. In the `Select Components` dialog, check `Command Line Tools`, along with any other components you want to install, and click `Next`. + +1. Complete the installation wizard to install the package. - 1. Complete the installation wizard to install the package. + - + - + - +## Connect to your database -1. **Connect to your database** +To use `psql` to connect to your database, you need the connection details for your $SERVICE_LONG. Find those in the connection string generated during service creation. For more information, see [Connecting to Timescale][about-connecting]. - There are two different ways you can use `psql` to connect to your database. +Connect to your database in one of the following ways: - - With parameter flags: +- With parameter flags: - ```bash - psql -h -p -U -W -d - ``` + ```bash + psql -h -p -U -W -d + ``` - - With a service URL: +- With a service URL: - - If you have configured the [SSL mode][ssl-mode] connection: + - If you have configured the [SSL mode][ssl-mode] connection: - ```bash - psql "postgres://tsdbadmin@/tsdb?sslmode=verify-full" - ``` + ```bash + psql "postgres://tsdbadmin@/tsdb?sslmode=verify-full" + ``` - - If you haven't configured the SSL mode connection: + - If you haven't configured the SSL mode connection: - ```bash - psql postgres://@:/?sslmode=require - ``` + ```bash + psql postgres://@:/?sslmode=require + ``` - - If you want to supply your password directly within the service URL instead of being prompted for it: + - If you want to supply your password directly within the service URL instead of being prompted for it: - ```bash - psql "postgres://:@:/?sslmode=require" - ``` + ```bash + psql "postgres://:@:/?sslmode=require" + ``` ## Useful psql commands -When you start using `psql`, these are the commands you are likely to use most -frequently: +When you start using `psql`, these are the commands you are likely to use most frequently: |Command|Description| |-|-| From af1ddc30014543d1e3e364da7de49d27b9f4a22d Mon Sep 17 00:00:00 2001 From: atovpeko Date: Mon, 6 Jan 2025 15:00:55 +0200 Subject: [PATCH 24/39] review comments --- .../integrations/query-admin/psql.md | 47 ++++++++++--------- 1 file changed, 24 insertions(+), 23 deletions(-) diff --git a/use-timescale/integrations/query-admin/psql.md b/use-timescale/integrations/query-admin/psql.md index 51cf0d2333..0bd960a0e0 100644 --- a/use-timescale/integrations/query-admin/psql.md +++ b/use-timescale/integrations/query-admin/psql.md @@ -7,16 +7,15 @@ keywords: [connect, psql] # Connect with psql -You use `psql` command line tool to interact with your $SERVICE_LONG. Most procedures in the $COMPANY documentation assume you are using `psql`. +You use the `psql` command line tool to interact with your $SERVICE_LONG. ## Prerequisites - +* [Create a target $SERVICE_LONG][create-service] ## Check for an existing installation -On many operating systems, `psql` is installed by default. To use the functionality described in this pag, best practice is to use the latest version of psql. To check the version running on your system: - +On many operating systems, `psql` is installed by default. To use the functionality described in this page, best practice is to use the latest version of `psql`. To check the version running on your system: @@ -41,6 +40,8 @@ wmic +If you already have the latest version of `psql` installed, proceed to the [Connect to your database][connect-database] section. + ## Install psql If there is no existing installation, take the following steps to install `psql` depending on your platform. @@ -156,33 +157,33 @@ Install `psql` on Debian and Ubuntu with the `apt` package manager. To use `psql` to connect to your database, you need the connection details for your $SERVICE_LONG. Find those in the connection string generated during service creation. For more information, see [Connecting to Timescale][about-connecting]. -Connect to your database in one of the following ways: +Connect to your database with either: -- With parameter flags: +- Parameter flags: ```bash psql -h -p -U -W -d ``` -- With a service URL: +- Service URL with the [SSL mode][ssl-mode] enabled: + + ```bash + psql "postgres://tsdbadmin@/tsdb?sslmode=verify-full" + ``` - - If you have configured the [SSL mode][ssl-mode] connection: +- Service URL with password and SSL mode enabled: - ```bash - psql "postgres://tsdbadmin@/tsdb?sslmode=verify-full" - ``` + ```bash + psql "postgres://:@:/?sslmode=require" + ``` - - If you haven't configured the SSL mode connection: +- Service URL without SSL: - ```bash - psql postgres://@:/?sslmode=require - ``` + ```bash + psql postgres://@:/?sslmode=require + ``` - - If you want to supply your password directly within the service URL instead of being prompted for it: - ```bash - psql "postgres://:@:/?sslmode=require" - ``` ## Useful psql commands @@ -213,7 +214,7 @@ When you start using `psql`, these are the commands you are likely to use most f For more on `psql` commands, see the [Timescale psql cheat sheet][psql-cheat-sheet] and [psql documentation][psql-docs]. -### Save query results to a file +## Save query results to a file When you run queries in `psql`, the results are shown in the console by default. If you are running queries that have a lot of results, you might like to save @@ -227,7 +228,7 @@ the `COPY` command. For example: This command sends the results of the query to a new file called `output.csv` in the `/tmp/` directory. You can open the file using any spreadsheet program. -### Edit queries in a text editor +## Edit queries in a text editor Sometimes, queries can get very long, and you might make a mistake when you try typing it the first time around. If you have made a mistake in a long query, @@ -244,6 +245,6 @@ edited query by pressing `↑`, and press `Enter` to run it. [homebrew]: https://docs.brew.sh/Installation [macports]: https://guide.macports.org/#installing.macports [windows-installer]: https://www.postgresql.org/download/windows/ - - +[create-service]: /getting-started/:currentVersion:/services/ +[connect-database]:/use-timescale/:currentVersion:/integrations/query-admin/psql/#connect-to-your-database From 4f4e83fad983d2b7ff67ac7e53adeb0cf176135f Mon Sep 17 00:00:00 2001 From: atovpeko Date: Mon, 6 Jan 2025 17:07:15 +0200 Subject: [PATCH 25/39] review comments --- _partials/_grafana-connect.md | 7 ++++-- _partials/_integration-prereqs.md | 5 ++++ .../integrations/query-admin/psql.md | 23 ++++++++++++++++--- 3 files changed, 30 insertions(+), 5 deletions(-) create mode 100644 _partials/_integration-prereqs.md diff --git a/_partials/_grafana-connect.md b/_partials/_grafana-connect.md index efd81e42c1..268a33c127 100644 --- a/_partials/_grafana-connect.md +++ b/_partials/_grafana-connect.md @@ -1,7 +1,10 @@ ## Prerequisites -* [Create a target $SERVICE_LONG][create-service] -* Install [self-managed Grafana][grafana-self-managed], or sign up for [Grafana Cloud][grafana-cloud] +import IntegrationPrereqs from "versionContent/_partials/_integration-prereqs.mdx"; + + + +* Install [self-managed Grafana][grafana-self-managed], or sign up for [Grafana Cloud][grafana-cloud]. ## Add your $SERVICE_LONG as a data source diff --git a/_partials/_integration-prereqs.md b/_partials/_integration-prereqs.md new file mode 100644 index 0000000000..5d6945c09e --- /dev/null +++ b/_partials/_integration-prereqs.md @@ -0,0 +1,5 @@ +Before integrating with $CLOUD_LONG: + +* [Create a target $SERVICE_LONG][create-service]. + +[create-service]: /getting-started/:currentVersion:/services/ \ No newline at end of file diff --git a/use-timescale/integrations/query-admin/psql.md b/use-timescale/integrations/query-admin/psql.md index 0bd960a0e0..2413892f3a 100644 --- a/use-timescale/integrations/query-admin/psql.md +++ b/use-timescale/integrations/query-admin/psql.md @@ -5,13 +5,15 @@ products: [cloud, mst, self_hosted] keywords: [connect, psql] --- +import IntegrationPrereqs from "versionContent/_partials/_integration-prereqs.mdx"; + # Connect with psql You use the `psql` command line tool to interact with your $SERVICE_LONG. ## Prerequisites -* [Create a target $SERVICE_LONG][create-service] + ## Check for an existing installation @@ -171,7 +173,7 @@ Connect to your database with either: psql "postgres://tsdbadmin@/tsdb?sslmode=verify-full" ``` -- Service URL with password and SSL mode enabled: +- Service URL with password and the SSL mode enabled: ```bash psql "postgres://:@:/?sslmode=require" @@ -228,6 +230,22 @@ the `COPY` command. For example: This command sends the results of the query to a new file called `output.csv` in the `/tmp/` directory. You can open the file using any spreadsheet program. +## Run long queries + +To multi-line queries in `psql`, use the `EOF` delimiter. For example: + +```sql +psql -d $TARGET -f -v hypertable= - <<'EOF' +SELECT public.alter_job(j.id, scheduled=>true) +FROM _timescaledb_config.bgw_job j +JOIN _timescaledb_catalog.hypertable h ON h.id = j.hypertable_id +WHERE j.proc_schema IN ('_timescaledb_internal', '_timescaledb_functions') +AND j.proc_name = 'policy_compression' +AND j.id >= 1000 +AND format('%I.%I', h.schema_name, h.table_name)::text::regclass = :'hypertable'::text::regclass; +EOF +``` + ## Edit queries in a text editor Sometimes, queries can get very long, and you might make a mistake when you try @@ -245,6 +263,5 @@ edited query by pressing `↑`, and press `Enter` to run it. [homebrew]: https://docs.brew.sh/Installation [macports]: https://guide.macports.org/#installing.macports [windows-installer]: https://www.postgresql.org/download/windows/ -[create-service]: /getting-started/:currentVersion:/services/ [connect-database]:/use-timescale/:currentVersion:/integrations/query-admin/psql/#connect-to-your-database From 6e0d478942f5db38c72294569358b6bbf10a5517 Mon Sep 17 00:00:00 2001 From: atovpeko Date: Mon, 6 Jan 2025 17:08:57 +0200 Subject: [PATCH 26/39] review comments --- use-timescale/integrations/query-admin/psql.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/use-timescale/integrations/query-admin/psql.md b/use-timescale/integrations/query-admin/psql.md index 2413892f3a..3c090e1336 100644 --- a/use-timescale/integrations/query-admin/psql.md +++ b/use-timescale/integrations/query-admin/psql.md @@ -232,7 +232,7 @@ the `/tmp/` directory. You can open the file using any spreadsheet program. ## Run long queries -To multi-line queries in `psql`, use the `EOF` delimiter. For example: +To run multi-line queries in `psql`, use the `EOF` delimiter. For example: ```sql psql -d $TARGET -f -v hypertable= - <<'EOF' From 04ddf671c0066ffa08ce09c72a42cf3e8ca69a3c Mon Sep 17 00:00:00 2001 From: atovpeko Date: Mon, 6 Jan 2025 19:01:30 +0200 Subject: [PATCH 27/39] review comments --- use-timescale/integrations/index.md | 34 ++++++++++++++++++++--------- 1 file changed, 24 insertions(+), 10 deletions(-) diff --git a/use-timescale/integrations/index.md b/use-timescale/integrations/index.md index 520c446346..d0566f63af 100644 --- a/use-timescale/integrations/index.md +++ b/use-timescale/integrations/index.md @@ -11,17 +11,31 @@ tags: [integrations] Integrate your $SERVICE_LONG with third-party solutions to expand and extend what you can do with your data. -| Name | Category | Description | -|:------------------------:|------------------------------|------------------------------------------------| -| [Azure Data Studio][ads] | Query and administration | Connect to $CLOUD_LONG with Azure Data Studio. | -| [DBeaver][dbeaver] | Query and administration | Connect to $CLOUD_LONG with DBeaver. | -| [pgAdmin][pgadmin] | Query and administration | Connect to $CLOUD_LONG with pgAdmin. | -| [psql][psql] | Query and administration | Connect to $CLOUD_LONG with psql. | -| [qStudio][qstudio] | Query and administration | Connect to $CLOUD_LONG with qStudio. | -| [Grafana][grafana] | Observability and alerting | Visualize your data with Grafana. | -| [Tableau][tableau] | Observability and alerting | Visualize your data with Tableau. | -| [Terraform][terraform] | Configuration and deployment | Manage your $SERVICE_LONGs with Terraform. | +## Query and administration + +| Name | Description | +|:------------------------:|----------------------------------------------------------------------------------------------------------------------------------------------| +| [Azure Data Studio][ads] | An open-source, cross-platform hybrid data analytics tool designed to simplify the data landscape. | +| [DBeaver][dbeaver] | A free cross-platform database tool for developers, database administrators, analysts, and everyone working with data. | +| [pgAdmin][pgadmin] | A feature-rich open-source administration and development platform for PostgreSQL. | +| [psql][psql] | A terminal-based front-end to Postgres that enables you to type in queries interactively, issue them to Postgres, and see the query results. | +| [qStudio][qstudio] | A modern free SQL editor that provides syntax highlighting, code-completion, excel export, charting, and much more. | + + +## Observability and alerting + +| Name | Description | +|:---------------------------:|---------------------------------------------------------------------------------| +| [Grafana][grafana] | An open-source analytics and monitoring solution for every database. | +| [Tableau][tableau] | A visual analytics platform transforming the way we use data to solve problems. | + + +## Configuration and deployment + +| Name | Description | +|:---------------------------:|-----------------------------------------------------------------------------------------------------------------------------| +| [Terraform][terraform] | An infrastructure-as-code tool that enables you to safely and predictably provision and manage infrastructure in any cloud. | [psql]: /use-timescale/:currentVersion:/query-admin/psql/ [qstudio]: /use-timescale/:currentVersion:/integrations/qstudio/ From 079261605f113e6798d419d9c70807280f1c50b1 Mon Sep 17 00:00:00 2001 From: atovpeko Date: Wed, 8 Jan 2025 11:42:04 +0200 Subject: [PATCH 28/39] review comments --- use-timescale/integrations/azure-data-studio.md | 3 +-- use-timescale/integrations/dbeaver.md | 4 +--- use-timescale/integrations/grafana.md | 2 +- use-timescale/integrations/index.md | 12 ++++++------ use-timescale/integrations/pgadmin.md | 3 +-- use-timescale/integrations/psql.md | 2 +- use-timescale/integrations/qstudio.md | 3 +-- use-timescale/integrations/tableau.md | 2 +- use-timescale/integrations/terraform.md | 4 +--- 9 files changed, 14 insertions(+), 21 deletions(-) diff --git a/use-timescale/integrations/azure-data-studio.md b/use-timescale/integrations/azure-data-studio.md index 3ade704e63..db300bca30 100644 --- a/use-timescale/integrations/azure-data-studio.md +++ b/use-timescale/integrations/azure-data-studio.md @@ -7,8 +7,7 @@ keywords: [connect] # Connect to Timescale using Azure Data Studio -Azure Data Studio is a cross-platform database tool for data professionals using -on-premises and cloud data platforms on Windows, macOS, and Linux. +Azure Data Studio is an open-source, cross-platform hybrid data analytics tool designed to simplify the data landscape. ## Before you begin diff --git a/use-timescale/integrations/dbeaver.md b/use-timescale/integrations/dbeaver.md index a2eafe939c..572e9afc17 100644 --- a/use-timescale/integrations/dbeaver.md +++ b/use-timescale/integrations/dbeaver.md @@ -7,9 +7,7 @@ keywords: [connect] # Connect to Timescale using DBeaver -[DBeaver][dbeaver] is a free and open source database tool that is available for -Microsoft Windows, Apple macOS, and many Linux versions. DBeaver provides a -powerful SQL editor, administration features, ability to migrate data and +[DBeaver][dbeaver] is a free cross-platform database tool for developers, database administrators, analysts, and everyone working with data. DBeaver provides a powerful SQL editor, administration features, ability to migrate data and schema, and the ability to monitor database connection sessions. You can connect to Timescale hosted on your local machine or on a remote server or a Timescale service. diff --git a/use-timescale/integrations/grafana.md b/use-timescale/integrations/grafana.md index 933d528fe0..b5fd6459fe 100644 --- a/use-timescale/integrations/grafana.md +++ b/use-timescale/integrations/grafana.md @@ -9,7 +9,7 @@ import GrafanaConnect from "versionContent/_partials/_grafana-connect.mdx"; # Integrate Grafana and Timescale Cloud -You can use [Grafana](https://grafana.com/docs/) to monitor, visualize and perform analytics on data stored in your $SERVICE_LONG. +[Grafana](https://grafana.com/docs/) is an open-source analytics and monitoring solution. You can use it to monitor, visualize, and perform analytics on data stored in your $SERVICE_LONG. This page shows you how to connect Grafana with a $SERVICE_LONG, create a dashboard and panel, then visualize geospatial data. diff --git a/use-timescale/integrations/index.md b/use-timescale/integrations/index.md index d0566f63af..8552128dbc 100644 --- a/use-timescale/integrations/index.md +++ b/use-timescale/integrations/index.md @@ -19,16 +19,16 @@ and extend what you can do with your data. | [Azure Data Studio][ads] | An open-source, cross-platform hybrid data analytics tool designed to simplify the data landscape. | | [DBeaver][dbeaver] | A free cross-platform database tool for developers, database administrators, analysts, and everyone working with data. | | [pgAdmin][pgadmin] | A feature-rich open-source administration and development platform for PostgreSQL. | -| [psql][psql] | A terminal-based front-end to Postgres that enables you to type in queries interactively, issue them to Postgres, and see the query results. | +| [psql][psql] | A terminal-based front-end to PostgreSQL that enables you to type in queries interactively, issue them to Postgres, and see the query results. | | [qStudio][qstudio] | A modern free SQL editor that provides syntax highlighting, code-completion, excel export, charting, and much more. | ## Observability and alerting -| Name | Description | -|:---------------------------:|---------------------------------------------------------------------------------| -| [Grafana][grafana] | An open-source analytics and monitoring solution for every database. | -| [Tableau][tableau] | A visual analytics platform transforming the way we use data to solve problems. | +| Name | Description | +|:---------------------------:|--------------------------------------------------------------------------------------------| +| [Grafana][grafana] | An open-source analytics and monitoring solution. | +| [Tableau][tableau] | A popular analytics platform that helps you gain greater intelligence about your business. | ## Configuration and deployment @@ -37,7 +37,7 @@ and extend what you can do with your data. |:---------------------------:|-----------------------------------------------------------------------------------------------------------------------------| | [Terraform][terraform] | An infrastructure-as-code tool that enables you to safely and predictably provision and manage infrastructure in any cloud. | -[psql]: /use-timescale/:currentVersion:/query-admin/psql/ +[psql]: /use-timescale/:currentVersion:/psql/ [qstudio]: /use-timescale/:currentVersion:/integrations/qstudio/ [dbeaver]: /use-timescale/:currentVersion:/integrations/dbeaver/ [ads]: /use-timescale/:currentVersion:/integrations/azure-data-studio/ diff --git a/use-timescale/integrations/pgadmin.md b/use-timescale/integrations/pgadmin.md index db508e0f5e..501bb8a9e9 100644 --- a/use-timescale/integrations/pgadmin.md +++ b/use-timescale/integrations/pgadmin.md @@ -7,8 +7,7 @@ keywords: [connect] # Connect to Timescale using pgAdmin -The `pgAdmin` tool is a database administration tool that can be run on the -desktop, or in your browser. It is available for Chrome, Firefox, Edge, and +The `pgAdmin` tool is a feature-rich open-source administration and development platform for PostgreSQL. It is available for Chrome, Firefox, Edge, and Safari browsers, or can be installed on Microsoft Windows, Apple macOS, or various Linux flavors. diff --git a/use-timescale/integrations/psql.md b/use-timescale/integrations/psql.md index 0b3b50f33b..98fefadc9f 100644 --- a/use-timescale/integrations/psql.md +++ b/use-timescale/integrations/psql.md @@ -9,7 +9,7 @@ import IntegrationPrereqs from "versionContent/_partials/_integration-prereqs.md # Connect with psql -You use the `psql` command line tool to interact with your $SERVICE_LONG. +`psql` is a terminal-based front-end to Postgres that enables you to type in queries interactively, issue them to PostgreSQL, and see the query results. You use the `psql` command line tool to interact with your $SERVICE_LONG. ## Prerequisites diff --git a/use-timescale/integrations/qstudio.md b/use-timescale/integrations/qstudio.md index 88591eaa29..eb37f52dcf 100644 --- a/use-timescale/integrations/qstudio.md +++ b/use-timescale/integrations/qstudio.md @@ -7,8 +7,7 @@ keywords: [connect] # Connect to Timescale using qStudio -You can use [qStudio][qstudio] to run queries, browse tables, and create charts -for your Timescale database. +[qStudio][qstudio] is a modern free SQL editor that provides syntax highlighting, code-completion, excel export, charting, and much more. You can use it to run queries, browse tables, and create charts for your Timescale database. For more information about `qStudio`, including download and installation instructions, see [timestored.com][qstudio-downloads]. diff --git a/use-timescale/integrations/tableau.md b/use-timescale/integrations/tableau.md index b33414c556..767e8925c2 100644 --- a/use-timescale/integrations/tableau.md +++ b/use-timescale/integrations/tableau.md @@ -9,7 +9,7 @@ keywords: [visualizations, analytics, Tableau] [Tableau][get-tableau] is a popular analytics platform that helps you gain greater intelligence about your business. It is an ideal tool for visualizing -data stored in Timescale. +data stored in Timescale. ## Prerequisites diff --git a/use-timescale/integrations/terraform.md b/use-timescale/integrations/terraform.md index 51439b2008..11fb802077 100644 --- a/use-timescale/integrations/terraform.md +++ b/use-timescale/integrations/terraform.md @@ -8,9 +8,7 @@ tags: [terraform, manage] # Terraform -Terraform is an open source infrastructure as code (IaC) tool developed by -HashiCorp. The Timescale Terraform provider allows you to manage Timescale -services through a Terraform configuration. +Terraform is an infrastructure-as-code tool that enables you to safely and predictably provision and manage infrastructure in any cloud. The Timescale Terraform provider allows you to manage Timescale services through a Terraform configuration. For more information about the supported service configurations and operations, see the From 49be590c6dca7a9febc5ecd323143696e3f09d96 Mon Sep 17 00:00:00 2001 From: atovpeko Date: Mon, 13 Jan 2025 11:23:36 +0200 Subject: [PATCH 29/39] update --- use-timescale/integrations/index.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/use-timescale/integrations/index.md b/use-timescale/integrations/index.md index 8552128dbc..9b801dd25e 100644 --- a/use-timescale/integrations/index.md +++ b/use-timescale/integrations/index.md @@ -6,11 +6,11 @@ keywords: [integrations] tags: [integrations] --- -# Integrate tooling with Timescale Cloud +# Integrate tooling with $CLOUD_LONG -Integrate your $SERVICE_LONG with third-party solutions to expand -and extend what you can do with your data. +A $SERVICE_LONG is a PostgreSQL database instance extended with additional capabilities. This means that any third-party solution that you can integrate with PostgreSQL, you can also integrate with $CLOUD_LONG. See the full list of PostgreSQL integrations here. +Some of the most in-demand integrations for $CLOUD_LONG are listed below, with links to detailed integration steps. ## Query and administration From 73655c801f6064240195c215663ab67ea862cbb2 Mon Sep 17 00:00:00 2001 From: atovpeko Date: Mon, 13 Jan 2025 11:39:42 +0200 Subject: [PATCH 30/39] update --- use-timescale/integrations/index.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/use-timescale/integrations/index.md b/use-timescale/integrations/index.md index 9b801dd25e..0a253c916d 100644 --- a/use-timescale/integrations/index.md +++ b/use-timescale/integrations/index.md @@ -8,6 +8,10 @@ tags: [integrations] # Integrate tooling with $CLOUD_LONG +You can integrate your $SERVICE_LONG with third-party solutions to expand and extend what you can do with your data. + +## Integrates with PostgreSQL? Integrates with your $SERVICE_SHORT + A $SERVICE_LONG is a PostgreSQL database instance extended with additional capabilities. This means that any third-party solution that you can integrate with PostgreSQL, you can also integrate with $CLOUD_LONG. See the full list of PostgreSQL integrations here. Some of the most in-demand integrations for $CLOUD_LONG are listed below, with links to detailed integration steps. From 276063e3510caab04a40f7af9ba6fe804a90af3a Mon Sep 17 00:00:00 2001 From: atovpeko Date: Mon, 13 Jan 2025 12:04:24 +0200 Subject: [PATCH 31/39] update --- use-timescale/integrations/index.md | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/use-timescale/integrations/index.md b/use-timescale/integrations/index.md index 0a253c916d..a8d2fe08ff 100644 --- a/use-timescale/integrations/index.md +++ b/use-timescale/integrations/index.md @@ -6,13 +6,13 @@ keywords: [integrations] tags: [integrations] --- -# Integrate tooling with $CLOUD_LONG +# $CLOUD_LONG Integrations You can integrate your $SERVICE_LONG with third-party solutions to expand and extend what you can do with your data. -## Integrates with PostgreSQL? Integrates with your $SERVICE_SHORT +## Integrates with PostgreSQL? Integrates with your $SERVICE_SHORT! -A $SERVICE_LONG is a PostgreSQL database instance extended with additional capabilities. This means that any third-party solution that you can integrate with PostgreSQL, you can also integrate with $CLOUD_LONG. See the full list of PostgreSQL integrations here. +A $SERVICE_LONG is a PostgreSQL database instance extended with additional capabilities. This means that any third-party solution that you can integrate with PostgreSQL, you can also integrate with $CLOUD_LONG. See the full list of PostgreSQL integrations [here][postgresql-integrations]. Some of the most in-demand integrations for $CLOUD_LONG are listed below, with links to detailed integration steps. @@ -49,3 +49,4 @@ Some of the most in-demand integrations for $CLOUD_LONG are listed below, with l [grafana]: /use-timescale/:currentVersion:/integrations/grafana/ [tableau]: /use-timescale/:currentVersion:/integrations/tableau/ [terraform]: /use-timescale/:currentVersion:/integrations/terraform +[postgresql-integrations]: https://slashdot.org/software/p/PostgreSQL/integrations/ \ No newline at end of file From 17b48af3ad5ee4003327251efc162e7cb2a64d37 Mon Sep 17 00:00:00 2001 From: Anastasiia Tovpeko <114177030+atovpeko@users.noreply.github.com> Date: Mon, 13 Jan 2025 15:23:07 +0200 Subject: [PATCH 32/39] Update use-timescale/integrations/index.md Co-authored-by: Iain Cox Signed-off-by: Anastasiia Tovpeko <114177030+atovpeko@users.noreply.github.com> --- use-timescale/integrations/index.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/use-timescale/integrations/index.md b/use-timescale/integrations/index.md index a8d2fe08ff..da6bb67faf 100644 --- a/use-timescale/integrations/index.md +++ b/use-timescale/integrations/index.md @@ -12,7 +12,7 @@ You can integrate your $SERVICE_LONG with third-party solutions to expand and ex ## Integrates with PostgreSQL? Integrates with your $SERVICE_SHORT! -A $SERVICE_LONG is a PostgreSQL database instance extended with additional capabilities. This means that any third-party solution that you can integrate with PostgreSQL, you can also integrate with $CLOUD_LONG. See the full list of PostgreSQL integrations [here][postgresql-integrations]. +A $SERVICE_LONG is a PostgreSQL database instance extended by $COMPANY with custom capabilities. This means that any third-party solution that you can integrate with PostgreSQL, you can also integrate with $CLOUD_LONG. See the full list of PostgreSQL integrations [here][postgresql-integrations]. Some of the most in-demand integrations for $CLOUD_LONG are listed below, with links to detailed integration steps. From 4e07b3e4a61096f8ffe6a42054e1fff7194c566e Mon Sep 17 00:00:00 2001 From: atovpeko Date: Mon, 13 Jan 2025 17:08:45 +0200 Subject: [PATCH 33/39] update --- use-timescale/integrations/index.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/use-timescale/integrations/index.md b/use-timescale/integrations/index.md index da6bb67faf..d6b9fc2e34 100644 --- a/use-timescale/integrations/index.md +++ b/use-timescale/integrations/index.md @@ -41,7 +41,7 @@ Some of the most in-demand integrations for $CLOUD_LONG are listed below, with l |:---------------------------:|-----------------------------------------------------------------------------------------------------------------------------| | [Terraform][terraform] | An infrastructure-as-code tool that enables you to safely and predictably provision and manage infrastructure in any cloud. | -[psql]: /use-timescale/:currentVersion:/psql/ +[psql]: /use-timescale/:currentVersion:/integrations/psql/ [qstudio]: /use-timescale/:currentVersion:/integrations/qstudio/ [dbeaver]: /use-timescale/:currentVersion:/integrations/dbeaver/ [ads]: /use-timescale/:currentVersion:/integrations/azure-data-studio/ From 83e3fff193911df5a8580c9f736b94ce2f6bf6cd Mon Sep 17 00:00:00 2001 From: atovpeko Date: Mon, 13 Jan 2025 18:40:12 +0200 Subject: [PATCH 34/39] redirects --- lambda/redirects.js | 48 +++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 48 insertions(+) diff --git a/lambda/redirects.js b/lambda/redirects.js index 652e7a0eb7..e3a70cff1e 100644 --- a/lambda/redirects.js +++ b/lambda/redirects.js @@ -821,4 +821,52 @@ module.exports = [ from: "/use-timescale/latest/compression/backfill-historical-data/", to: "https://github.com/timescale/timescaledb-extras/blob/master/backfill.sql", }, + { + from: '/use-timescale/latest/integrations/observability-alerting/grafana/installation/', + to: 'https://docs.timescale.com/use-timescale/latest/integrations/observability-alerting/grafana/', + }, + { + from: '/use-timescale/latest/integrations/observability-alerting/grafana/geospatial-dashboards//', + to: 'https://docs.timescale.com/use-timescale/latest/integrations/grafana/', + }, + { + from: '/use-timescale/latest/integrations/observability-alerting/grafana/create-dashboard-and-panel/', + to: 'https://docs.timescale.com/use-timescale/latest/integrations/grafana/', + }, + { + from: '/use-timescale/latest/integrations/query-admin/about-psql/', + to: 'https://docs.timescale.com/use-timescale/latest/integrations/psql/', + }, + { + from: '/use-timescale/latest/integrations/query-admin/about-connecting/', + to: 'https://docs.timescale.com/use-timescale/latest/integrations/about-connecting/', + }, + { + from: '/use-timescale/latest/integrations/query-admin/azure-data-studio/', + to: 'https://docs.timescale.com/use-timescale/latest/integrations/azure-data-studio/', + }, + { + from: '/use-timescale/latest/integrations/query-admin/dbeaver/', + to: 'https://docs.timescale.com/use-timescale/latest/integrations/dbeaver/', + }, + { + from: '/use-timescale/latest/integrations/query-admin/pgadmin/', + to: 'https://docs.timescale.com/use-timescale/latest/integrations/pgadmin/', + }, + { + from: '/use-timescale/latest/integrations/query-admin/qstudio/', + to: 'https://docs.timescale.com/use-timescale/latest/integrations/qstudio/', + }, + { + from: '/use-timescale/latest/integrations/config-deploy/terraform/', + to: 'https://docs.timescale.com/use-timescale/latest/integrations/terraform/', + }, + { + from: '/use-timescale/latest/integrations/observability-alerting/tableau/', + to: 'https://docs.timescale.com/use-timescale/latest/integrations/tableau/', + }, + { + from: '/use-timescale/latest/integrations/query-admin/about-psql/', + to: 'https://docs.timescale.com/use-timescale/latest/integrations/psql/', + }, ]; From d753f9e0536eca729e9d26beaa805e5a238b76fc Mon Sep 17 00:00:00 2001 From: atovpeko Date: Mon, 13 Jan 2025 18:56:54 +0200 Subject: [PATCH 35/39] redirects --- lambda/redirects.js | 32 +++++++++----------- use-timescale/ingest-data/ingest-telegraf.md | 2 +- use-timescale/integrations/grafana.md | 2 +- use-timescale/integrations/psql.md | 4 +-- 4 files changed, 18 insertions(+), 22 deletions(-) diff --git a/lambda/redirects.js b/lambda/redirects.js index e3a70cff1e..8e93166f79 100644 --- a/lambda/redirects.js +++ b/lambda/redirects.js @@ -564,7 +564,7 @@ module.exports = [ }, { from: "/tutorials/latest/grafana/", - to: "https://docs.timescale.com/use-timescale/latest/integrations/observability-alerting/grafana/", + to: "https://docs.timescale.com/use-timescale/latest/integrations/grafana/", }, { from: "/tutorials/latest/howto-monitor-django-prometheus", @@ -605,27 +605,27 @@ module.exports = [ { from: "/tutorials", to: "https://docs.timescale.com/tutorials/latest/" }, { from: "/use-timescale/latest/connecting/", - to: "https://docs.timescale.com/use-timescale/latest/integrations/query-admin/", + to: "https://docs.timescale.com/use-timescale/latest/integrations/", }, { from: "/use-timescale/latest/connecting/about-connecting", - to: "https://docs.timescale.com/use-timescale/latest/integrations/query-admin/about-connecting/", + to: "https://docs.timescale.com/use-timescale/latest/integrations/find-connection-details/", }, { from: "/use-timescale/latest/connecting/about-psql/", - to: "https://docs.timescale.com/use-timescale/latest/integrations/query-admin/about-psql/", + to: "https://docs.timescale.com/use-timescale/latest/integrations/psql/", }, { from: "/use-timescale/latest/connecting/dbeaver/", - to: "https://docs.timescale.com/use-timescale/latest/integrations/query-admin/dbeaver/", + to: "https://docs.timescale.com/use-timescale/latest/integrations/dbeaver/", }, { from: "/use-timescale/latest/connecting/pgadmin/", - to: "https://docs.timescale.com/use-timescale/latest/integrations/query-admin/", + to: "https://docs.timescale.com/use-timescale/latest/integrations/pgadmin/", }, { from: "/use-timescale/latest/connecting/psql/", - to: "https://docs.timescale.com/use-timescale/latest/integrations/query-admin/about-psql/", + to: "https://docs.timescale.com/use-timescale/latest/integrations/psql/", }, { from: "/use-timescale/latest/data-tiering/move-data/", @@ -721,7 +721,7 @@ module.exports = [ }, { from: "/using-timescaledb/visualizing-data", - to: "https://docs.timescale.com/use-timescale/latest/integrations/observability-alerting/grafana/", + to: "https://docs.timescale.com/use-timescale/latest/integrations/grafana/", }, { from: "/use-timescale/latest/account-management/", @@ -759,7 +759,7 @@ module.exports = [ }, { from: "/timescaledb/latest/tutorials/grafana/visualizations/pie-chart/", - to: "https://docs.timescale.com/use-timescale/latest/integrations/observability-alerting/grafana/", + to: "https://docs.timescale.com/use-timescale/latest/integrations/grafana/", }, { from: "/promscale/latest/about-promscale/#promscale-schema-for-metric-data", @@ -767,7 +767,7 @@ module.exports = [ }, { from: "/promscale/latest/visualize-data/grafana", - to: "https://docs.timescale.com/use-timescale/latest/integrations/observability-alerting/grafana/", + to: "https://docs.timescale.com/use-timescale/latest/integrations/grafana/", }, { from: "/install/latest/self-hosted/installation-redhat/#where-to-next", @@ -783,7 +783,7 @@ module.exports = [ }, { from: "/timescaledb/latest/tutorials/grafana/grafana-variables/", - to: "https://docs.timescale.com/use-timescale/latest/integrations/observability-alerting/grafana/", + to: "https://docs.timescale.com/use-timescale/latest/integrations/grafana/", }, { from: "/clustering/using-timescaledb/update-db", @@ -823,10 +823,10 @@ module.exports = [ }, { from: '/use-timescale/latest/integrations/observability-alerting/grafana/installation/', - to: 'https://docs.timescale.com/use-timescale/latest/integrations/observability-alerting/grafana/', + to: 'https://docs.timescale.com/use-timescale/latest/integrations/grafana/', }, { - from: '/use-timescale/latest/integrations/observability-alerting/grafana/geospatial-dashboards//', + from: '/use-timescale/latest/integrations/observability-alerting/grafana/geospatial-dashboards/', to: 'https://docs.timescale.com/use-timescale/latest/integrations/grafana/', }, { @@ -839,7 +839,7 @@ module.exports = [ }, { from: '/use-timescale/latest/integrations/query-admin/about-connecting/', - to: 'https://docs.timescale.com/use-timescale/latest/integrations/about-connecting/', + to: 'https://docs.timescale.com/use-timescale/latest/integrations/find-connection-details/', }, { from: '/use-timescale/latest/integrations/query-admin/azure-data-studio/', @@ -865,8 +865,4 @@ module.exports = [ from: '/use-timescale/latest/integrations/observability-alerting/tableau/', to: 'https://docs.timescale.com/use-timescale/latest/integrations/tableau/', }, - { - from: '/use-timescale/latest/integrations/query-admin/about-psql/', - to: 'https://docs.timescale.com/use-timescale/latest/integrations/psql/', - }, ]; diff --git a/use-timescale/ingest-data/ingest-telegraf.md b/use-timescale/ingest-data/ingest-telegraf.md index 1492ffaf97..33392a99c9 100644 --- a/use-timescale/ingest-data/ingest-telegraf.md +++ b/use-timescale/ingest-data/ingest-telegraf.md @@ -157,6 +157,6 @@ see the [PostgreQL output plugin][output-plugin]. [output-plugin]: https://github.com/influxdata/telegraf/blob/release-1.24/plugins/outputs/postgresql/README.md [install-telegraf]: https://docs.influxdata.com/telegraf/v1.21/introduction/installation/ [create-service]: /getting-started/latest/ -[connect-timescaledb]: /use-timescale/:currentVersion:/integrations/about-connecting/ +[connect-timescaledb]: /use-timescale/:currentVersion:/integrations/find-connection-details/ [grafana]: /use-timescale/:currentVersion:/integrations/grafana/ [about-hypertables]: /use-timescale/:currentVersion:/hypertables/about-hypertables/ diff --git a/use-timescale/integrations/grafana.md b/use-timescale/integrations/grafana.md index 4d41851c54..142683f56a 100644 --- a/use-timescale/integrations/grafana.md +++ b/use-timescale/integrations/grafana.md @@ -7,7 +7,7 @@ keywords: [Grafana, visualizations, analytics, monitoring] import GrafanaConnect from "versionContent/_partials/_grafana-connect.mdx"; -# Grafana +# Integrate Grafana and Timescale Cloud [Grafana](https://grafana.com/docs/) enables you to query, visualize, alert on, and explore your metrics, logs, and traces wherever they’re stored. diff --git a/use-timescale/integrations/psql.md b/use-timescale/integrations/psql.md index 98fefadc9f..37ed35e430 100644 --- a/use-timescale/integrations/psql.md +++ b/use-timescale/integrations/psql.md @@ -256,12 +256,12 @@ loaded into the editor. When you have made your changes, press `Esc`, then type `:`+`w`+`q` to save the changes, and return to the command prompt. Access the edited query by pressing `↑`, and press `Enter` to run it. -[about-connecting]: /use-timescale/:currentVersion:/integrations/about-connecting/ +[about-connecting]: /use-timescale/:currentVersion:/integrations/find-connection-details/ [psql-cheat-sheet]: https://www.timescale.com/learn/postgres-cheat-sheet [psql-docs]: https://www.postgresql.org/docs/13/app-psql.html [ssl-mode]: /use-timescale/:currentVersion:/security/strict-ssl/ [homebrew]: https://docs.brew.sh/Installation [macports]: https://guide.macports.org/#installing.macports [windows-installer]: https://www.postgresql.org/download/windows/ -[connect-database]:/use-timescale/:currentVersion:/integrations/query-admin/psql/#connect-to-your-database +[connect-database]:/use-timescale/:currentVersion:/integrations/psql/#connect-to-your-service From 8022ad8ed8e15daeeddd5229afdfa8995568364f Mon Sep 17 00:00:00 2001 From: atovpeko Date: Mon, 13 Jan 2025 19:55:26 +0200 Subject: [PATCH 36/39] cleanup --- use-timescale/integrations/psql.md | 42 ++- .../integrations/query-admin/psql.md | 261 ------------------ 2 files changed, 18 insertions(+), 285 deletions(-) delete mode 100644 use-timescale/integrations/query-admin/psql.md diff --git a/use-timescale/integrations/psql.md b/use-timescale/integrations/psql.md index 37ed35e430..9a5680aab7 100644 --- a/use-timescale/integrations/psql.md +++ b/use-timescale/integrations/psql.md @@ -9,7 +9,9 @@ import IntegrationPrereqs from "versionContent/_partials/_integration-prereqs.md # Connect with psql -`psql` is a terminal-based front-end to Postgres that enables you to type in queries interactively, issue them to PostgreSQL, and see the query results. You use the `psql` command line tool to interact with your $SERVICE_LONG. +`psql` is a terminal-based front-end to PostgreSQL that enables you to type in queries interactively, issue them to Postgres, and see the query results. + +This page shows you how to use the `psql` command line tool to interact with your $SERVICE_LONG. ## Prerequisites @@ -42,11 +44,11 @@ wmic -If you already have the latest version of `psql` installed, proceed to the [Connect to your database][connect-database] section. +If you already have the latest version of `psql` installed, proceed to the [Connect to your $SERVICE_SHORT][connect-database] section. ## Install psql -If there is no existing installation, take the following steps to install `psql` depending on your platform. +If there is no existing installation, take the following steps to install `psql`: @@ -95,9 +97,7 @@ Install using MacPorts. `libpqxx` is the official C++ client API for PostgreSQL. -1. Install MacPorts by downloading and running the package installer. - - For more information about MacPorts, including installation instructions, see the [MacPorts documentation][macports]. +1. [Install MacPorts][macports] by downloading and running the package installer. 1. Install the latest version of `libpqxx`: @@ -155,38 +155,32 @@ Install `psql` on Debian and Ubuntu with the `apt` package manager. -## Connect to your database +## Connect to your $SERVICE_SHORT -To use `psql` to connect to your database, you need the connection details for your $SERVICE_LONG. Find those in the connection string generated during service creation. For more information, see [Connecting to Timescale][about-connecting]. +To use `psql` to connect to your $SERVICE_SHORT, you need the connection details. See [Find your connection details][connection-info]. -Connect to your database with either: +Connect to your $SERVICE_SHORT with either: -- Parameter flags: +- The parameter flags: ```bash psql -h -p -U -W -d ``` -- Service URL with the [SSL mode][ssl-mode] enabled: +- The $SERVICE_SHORT URL: ```bash - psql "postgres://tsdbadmin@/tsdb?sslmode=verify-full" + psql "postgres://@:/?sslmode=require" ``` + + You are prompted to provide the password. -- Service URL with password and the SSL mode enabled: +- The $SERVICE_SHORT URL with the password already included and [a stricter SSL mode][ssl-mode] enabled: ```bash - psql "postgres://:@:/?sslmode=require" + psql "postgres://:@:/?sslmode=verify-full" ``` -- Service URL without SSL: - - ```bash - psql postgres://@:/?sslmode=require - ``` - - - ## Useful psql commands When you start using `psql`, these are the commands you are likely to use most frequently: @@ -256,12 +250,12 @@ loaded into the editor. When you have made your changes, press `Esc`, then type `:`+`w`+`q` to save the changes, and return to the command prompt. Access the edited query by pressing `↑`, and press `Enter` to run it. -[about-connecting]: /use-timescale/:currentVersion:/integrations/find-connection-details/ [psql-cheat-sheet]: https://www.timescale.com/learn/postgres-cheat-sheet [psql-docs]: https://www.postgresql.org/docs/13/app-psql.html [ssl-mode]: /use-timescale/:currentVersion:/security/strict-ssl/ [homebrew]: https://docs.brew.sh/Installation [macports]: https://guide.macports.org/#installing.macports [windows-installer]: https://www.postgresql.org/download/windows/ -[connect-database]:/use-timescale/:currentVersion:/integrations/psql/#connect-to-your-service +[connect-database]:/use-timescale/:currentVersion:/integrations/query-admin/psql/#connect-to-your-service +[connection-info]: /use-timescale/:currentVersion:/integrations/query-admin/find-connection-details/ diff --git a/use-timescale/integrations/query-admin/psql.md b/use-timescale/integrations/query-admin/psql.md deleted file mode 100644 index 9a5680aab7..0000000000 --- a/use-timescale/integrations/query-admin/psql.md +++ /dev/null @@ -1,261 +0,0 @@ ---- -title: Connect to a Timescale Cloud service with psql -excerpt: Install the psql client for PostgreSQL and connect to your service -products: [cloud, mst, self_hosted] -keywords: [connect, psql] ---- - -import IntegrationPrereqs from "versionContent/_partials/_integration-prereqs.mdx"; - -# Connect with psql - -`psql` is a terminal-based front-end to PostgreSQL that enables you to type in queries interactively, issue them to Postgres, and see the query results. - -This page shows you how to use the `psql` command line tool to interact with your $SERVICE_LONG. - -## Prerequisites - - - -## Check for an existing installation - -On many operating systems, `psql` is installed by default. To use the functionality described in this page, best practice is to use the latest version of `psql`. To check the version running on your system: - - - - - - -```bash -psql --version -``` - - - - - - -```powershell -wmic -/output:C:\list.txt product get name, version -``` - - - - - -If you already have the latest version of `psql` installed, proceed to the [Connect to your $SERVICE_SHORT][connect-database] section. - -## Install psql - -If there is no existing installation, take the following steps to install `psql`: - - - - - -Install using Homebrew. `libpqxx` is the official C++ client API for PostgreSQL. - - - -1. Install Homebrew, if you don't already have it: - - ```bash - /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)" - ``` - - For more information about Homebrew, including installation instructions, see the [Homebrew documentation][homebrew]. - -1. Make sure your Homebrew repository is up to date: - - ```bash - brew doctor - brew update - ``` - -1. Install `psql`: - - ```bash - brew install libpq - ``` - -1. Update your path to include the `psql` tool: - - ```bash - brew link --force libpq - ``` - -On Intel chips, the symbolic link is added to `/usr/local/bin`. On Apple Silicon, the symbolic link is added to `/opt/homebrew/bin`. - - - - - - - -Install using MacPorts. `libpqxx` is the official C++ client API for PostgreSQL. - - - -1. [Install MacPorts][macports] by downloading and running the package installer. - -1. Install the latest version of `libpqxx`: - - ```bash - sudo port install libpqxx - ``` - -1. View the files that were installed by `libpqxx`: - - ```bash - port contents libpqxx - ``` - - - - - - - -Install `psql` on Debian and Ubuntu with the `apt` package manager. - - - -1. Make sure your `apt` repository is up to date: - - ```bash - sudo apt-get update - ``` - -1. Install the `postgresql-client` package: - - ```bash - sudo apt-get install postgresql-client - ``` - - - - - - - -`psql` is installed by default when you install PostgreSQL. This procedure uses the interactive installer provided by PostgreSQL and EnterpriseDB. - - - -1. Download and run the PostgreSQL installer from [www.enterprisedb.com][windows-installer]. - -1. In the `Select Components` dialog, check `Command Line Tools`, along with any other components you want to install, and click `Next`. - -1. Complete the installation wizard to install the package. - - - - - - - -## Connect to your $SERVICE_SHORT - -To use `psql` to connect to your $SERVICE_SHORT, you need the connection details. See [Find your connection details][connection-info]. - -Connect to your $SERVICE_SHORT with either: - -- The parameter flags: - - ```bash - psql -h -p -U -W -d - ``` - -- The $SERVICE_SHORT URL: - - ```bash - psql "postgres://@:/?sslmode=require" - ``` - - You are prompted to provide the password. - -- The $SERVICE_SHORT URL with the password already included and [a stricter SSL mode][ssl-mode] enabled: - - ```bash - psql "postgres://:@:/?sslmode=verify-full" - ``` - -## Useful psql commands - -When you start using `psql`, these are the commands you are likely to use most frequently: - -|Command|Description| -|-|-| -|`\c `|Connect to a new database| -|`\d `|Show the details of a table| -|`\df`|List functions in the current database| -|`\df+`|List all functions with more details| -|`\di`|List all indexes from all tables| -|`\dn`|List all schemas in the current database| -|`\dt`|List available tables| -|`\du`|List PostgreSQL database roles| -|`\dv`|List views in current schema| -|`\dv+`|List all views with more details| -|`\dx`|Show all installed extensions| -|`ef `|Edit a function| -|`\h`|Show help on syntax of SQL commands| -|`\l`|List available databases| -|`\password `|Change the password for the user| -|`\q`|Quit `psql`| -|`\set`|Show system variables list| -|`\timing`|Show how long a query took to execute| -|`\x`|Show expanded query results| -|`\?`|List all `psql` slash commands| - -For more on `psql` commands, see the [Timescale psql cheat sheet][psql-cheat-sheet] and [psql documentation][psql-docs]. - -## Save query results to a file - -When you run queries in `psql`, the results are shown in the console by default. -If you are running queries that have a lot of results, you might like to save -the results into a comma-separated `.csv` file instead. You can do this using -the `COPY` command. For example: - -```sql -\copy (SELECT * FROM ...) TO '/tmp/output.csv' (format CSV); -``` - -This command sends the results of the query to a new file called `output.csv` in -the `/tmp/` directory. You can open the file using any spreadsheet program. - -## Run long queries - -To run multi-line queries in `psql`, use the `EOF` delimiter. For example: - -```sql -psql -d $TARGET -f -v hypertable= - <<'EOF' -SELECT public.alter_job(j.id, scheduled=>true) -FROM _timescaledb_config.bgw_job j -JOIN _timescaledb_catalog.hypertable h ON h.id = j.hypertable_id -WHERE j.proc_schema IN ('_timescaledb_internal', '_timescaledb_functions') -AND j.proc_name = 'policy_compression' -AND j.id >= 1000 -AND format('%I.%I', h.schema_name, h.table_name)::text::regclass = :'hypertable'::text::regclass; -EOF -``` - -## Edit queries in a text editor - -Sometimes, queries can get very long, and you might make a mistake when you try -typing it the first time around. If you have made a mistake in a long query, -instead of retyping it, you can use a built-in text editor, which is based on -`Vim`. Launch the query editor with the `\e` command. Your previous query is -loaded into the editor. When you have made your changes, press `Esc`, then type -`:`+`w`+`q` to save the changes, and return to the command prompt. Access the -edited query by pressing `↑`, and press `Enter` to run it. - -[psql-cheat-sheet]: https://www.timescale.com/learn/postgres-cheat-sheet -[psql-docs]: https://www.postgresql.org/docs/13/app-psql.html -[ssl-mode]: /use-timescale/:currentVersion:/security/strict-ssl/ -[homebrew]: https://docs.brew.sh/Installation -[macports]: https://guide.macports.org/#installing.macports -[windows-installer]: https://www.postgresql.org/download/windows/ -[connect-database]:/use-timescale/:currentVersion:/integrations/query-admin/psql/#connect-to-your-service -[connection-info]: /use-timescale/:currentVersion:/integrations/query-admin/find-connection-details/ - From 8e53e61856781169e38a2f458e92088265c3390f Mon Sep 17 00:00:00 2001 From: atovpeko Date: Tue, 14 Jan 2025 11:34:39 +0200 Subject: [PATCH 37/39] cleanup --- use-timescale/integrations/index.md | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/use-timescale/integrations/index.md b/use-timescale/integrations/index.md index d6b9fc2e34..2a2a79b243 100644 --- a/use-timescale/integrations/index.md +++ b/use-timescale/integrations/index.md @@ -23,16 +23,16 @@ Some of the most in-demand integrations for $CLOUD_LONG are listed below, with l | [Azure Data Studio][ads] | An open-source, cross-platform hybrid data analytics tool designed to simplify the data landscape. | | [DBeaver][dbeaver] | A free cross-platform database tool for developers, database administrators, analysts, and everyone working with data. | | [pgAdmin][pgadmin] | A feature-rich open-source administration and development platform for PostgreSQL. | -| [psql][psql] | A terminal-based front-end to PostgreSQL that enables you to type in queries interactively, issue them to Postgres, and see the query results. | -| [qStudio][qstudio] | A modern free SQL editor that provides syntax highlighting, code-completion, excel export, charting, and much more. | +| [psql][psql] | A terminal-based frontend to PostgreSQL that enables you to type in queries interactively, issue them to Postgres, and see the query results. | +| [qStudio][qstudio] | A modern free SQL editor that provides syntax highlighting, code completion, excel export, charting, and more. | ## Observability and alerting -| Name | Description | -|:---------------------------:|--------------------------------------------------------------------------------------------| -| [Grafana][grafana] | An open-source analytics and monitoring solution. | -| [Tableau][tableau] | A popular analytics platform that helps you gain greater intelligence about your business. | +| Name | Description | +|:---------------------------:|----------------------------------------------------------------------------------------------------------------------------------------------------------------------| +| [Grafana][grafana] | An open-source analytics and monitoring solution that enables you to query, visualize, alert on, and explore your metrics, logs. | +| [Tableau][tableau] | A popular analytics platform that helps you gain greater intelligence about your business. | ## Configuration and deployment From c3f43a7aa607843f7291c976360b336eae5617f4 Mon Sep 17 00:00:00 2001 From: atovpeko Date: Tue, 14 Jan 2025 14:26:49 +0200 Subject: [PATCH 38/39] fixed some links --- _partials/_grafana-connect.md | 2 +- _partials/_integration-prereqs.md | 2 +- use-timescale/integrations/psql.md | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/_partials/_grafana-connect.md b/_partials/_grafana-connect.md index afca26fb25..17edbe2739 100644 --- a/_partials/_grafana-connect.md +++ b/_partials/_grafana-connect.md @@ -37,4 +37,4 @@ To connect the data in your $SERVICE_SHORT to Grafana: [grafana-cloud]: https://grafana.com/get/ [cloud-login]: https://console.cloud.timescale.com/ [create-service]: /getting-started/:currentVersion:/services/ -[connection-info]: /use-timescale/:currentVersion:/integrations/query-admin/find-connection-details/ \ No newline at end of file +[connection-info]: /use-timescale/:currentVersion:/integrations/find-connection-details/ \ No newline at end of file diff --git a/_partials/_integration-prereqs.md b/_partials/_integration-prereqs.md index 069f0044f4..dfe52ab64f 100644 --- a/_partials/_integration-prereqs.md +++ b/_partials/_integration-prereqs.md @@ -6,4 +6,4 @@ Before integrating: [create-service]: /getting-started/:currentVersion:/services/ [enable-timescaledb]: /self-hosted/:currentVersion:/install/ -[connection-info]: /use-timescale/:currentVersion:/integrations/query-admin/find-connection-details/ \ No newline at end of file +[connection-info]: /use-timescale/:currentVersion:/integrations/find-connection-details/ \ No newline at end of file diff --git a/use-timescale/integrations/psql.md b/use-timescale/integrations/psql.md index 9a5680aab7..f1f0c00354 100644 --- a/use-timescale/integrations/psql.md +++ b/use-timescale/integrations/psql.md @@ -256,6 +256,6 @@ edited query by pressing `↑`, and press `Enter` to run it. [homebrew]: https://docs.brew.sh/Installation [macports]: https://guide.macports.org/#installing.macports [windows-installer]: https://www.postgresql.org/download/windows/ -[connect-database]:/use-timescale/:currentVersion:/integrations/query-admin/psql/#connect-to-your-service -[connection-info]: /use-timescale/:currentVersion:/integrations/query-admin/find-connection-details/ +[connect-database]:/use-timescale/:currentVersion:/integrations/psql/#connect-to-your-service +[connection-info]: /use-timescale/:currentVersion:/integrations/find-connection-details/ From f669dced118ffe6ccbf7c55da9848cd5c0ebed0b Mon Sep 17 00:00:00 2001 From: atovpeko Date: Wed, 15 Jan 2025 10:41:31 +0200 Subject: [PATCH 39/39] cleanup --- _partials/_grafana-connect.md | 2 +- .../integrations/find-connection-details.md | 2 +- use-timescale/integrations/grafana.md | 8 +++++--- use-timescale/integrations/index.md | 14 +++++++------- use-timescale/integrations/psql.md | 6 +++--- 5 files changed, 17 insertions(+), 15 deletions(-) diff --git a/_partials/_grafana-connect.md b/_partials/_grafana-connect.md index 17edbe2739..8455d85f8f 100644 --- a/_partials/_grafana-connect.md +++ b/_partials/_grafana-connect.md @@ -6,7 +6,7 @@ import IntegrationPrereqs from "versionContent/_partials/_integration-prereqs.md * Install [self-managed Grafana][grafana-self-managed] or sign up for [Grafana Cloud][grafana-cloud]. -## Add your $SERVICE_SHORT or database as a data source +## Add your $SERVICE_SHORT as a data source To connect the data in your $SERVICE_SHORT to Grafana: diff --git a/use-timescale/integrations/find-connection-details.md b/use-timescale/integrations/find-connection-details.md index 3fbfac432b..8c7be9f407 100644 --- a/use-timescale/integrations/find-connection-details.md +++ b/use-timescale/integrations/find-connection-details.md @@ -15,7 +15,7 @@ To connect to your $SERVICE_SHORT or self-hosted database, you need at least the - Password - Database name -Find the connection details based on your installation type. +Find the connection details based on your deployment type: diff --git a/use-timescale/integrations/grafana.md b/use-timescale/integrations/grafana.md index 142683f56a..9b2a3e6a84 100644 --- a/use-timescale/integrations/grafana.md +++ b/use-timescale/integrations/grafana.md @@ -22,6 +22,8 @@ view into the performance of a system, and each dashboard consists of one or more panels, which represent information about a specific metric related to that system. +To create a new dashboard: + 1. **On the `Dashboards` page, click `New` and select `New dashboard`** @@ -48,7 +50,7 @@ that system. ## Use the time filter function -Grafana time-series panels include a time filter. +Grafana time-series panels include a time filter: @@ -165,9 +167,9 @@ tutorial as a starting point. Add thresholds for 7 and 10, to mark rides over 7 and 10 miles in different colors, respectively. - You now have a visualization that looks like this: + You now have a visualization that looks like this: - ![Timescale and Grafana integration](https://assets.timescale.com/docs/images/timescale-grafana-integration.png) + ![Timescale and Grafana integration](https://assets.timescale.com/docs/images/timescale-grafana-integration.png) diff --git a/use-timescale/integrations/index.md b/use-timescale/integrations/index.md index 2a2a79b243..da8f39652f 100644 --- a/use-timescale/integrations/index.md +++ b/use-timescale/integrations/index.md @@ -18,13 +18,13 @@ Some of the most in-demand integrations for $CLOUD_LONG are listed below, with l ## Query and administration -| Name | Description | -|:------------------------:|----------------------------------------------------------------------------------------------------------------------------------------------| -| [Azure Data Studio][ads] | An open-source, cross-platform hybrid data analytics tool designed to simplify the data landscape. | -| [DBeaver][dbeaver] | A free cross-platform database tool for developers, database administrators, analysts, and everyone working with data. | -| [pgAdmin][pgadmin] | A feature-rich open-source administration and development platform for PostgreSQL. | -| [psql][psql] | A terminal-based frontend to PostgreSQL that enables you to type in queries interactively, issue them to Postgres, and see the query results. | -| [qStudio][qstudio] | A modern free SQL editor that provides syntax highlighting, code completion, excel export, charting, and more. | +| Name | Description | +|:------------------------:|-------------------------------------------------------------------------------------------------------------------------------------------------| +| [Azure Data Studio][ads] | An open-source, cross-platform hybrid data analytics tool designed to simplify the data landscape. | +| [DBeaver][dbeaver] | A free cross-platform database tool for developers, database administrators, analysts, and everyone working with data. | +| [pgAdmin][pgadmin] | A feature-rich open-source administration and development platform for PostgreSQL. | +| [psql][psql] | A terminal-based frontend to PostgreSQL that enables you to type in queries interactively, issue them to PostgreSQL, and see the query results. | +| [qStudio][qstudio] | A modern free SQL editor that provides syntax highlighting, code completion, excel export, charting, and more. | ## Observability and alerting diff --git a/use-timescale/integrations/psql.md b/use-timescale/integrations/psql.md index f1f0c00354..d014efca11 100644 --- a/use-timescale/integrations/psql.md +++ b/use-timescale/integrations/psql.md @@ -9,7 +9,7 @@ import IntegrationPrereqs from "versionContent/_partials/_integration-prereqs.md # Connect with psql -`psql` is a terminal-based front-end to PostgreSQL that enables you to type in queries interactively, issue them to Postgres, and see the query results. +[`psql`][psql-docs] is a terminal-based frontend to PostgreSQL that enables you to type in queries interactively, issue them to Postgres, and see the query results. This page shows you how to use the `psql` command line tool to interact with your $SERVICE_LONG. @@ -208,7 +208,7 @@ When you start using `psql`, these are the commands you are likely to use most f |`\x`|Show expanded query results| |`\?`|List all `psql` slash commands| -For more on `psql` commands, see the [Timescale psql cheat sheet][psql-cheat-sheet] and [psql documentation][psql-docs]. +For more on `psql` commands, see the [$COMPANY psql cheat sheet][psql-cheat-sheet] and [psql documentation][psql-docs]. ## Save query results to a file @@ -251,7 +251,7 @@ loaded into the editor. When you have made your changes, press `Esc`, then type edited query by pressing `↑`, and press `Enter` to run it. [psql-cheat-sheet]: https://www.timescale.com/learn/postgres-cheat-sheet -[psql-docs]: https://www.postgresql.org/docs/13/app-psql.html +[psql-docs]: https://www.postgresql.org/docs/current/app-psql.html [ssl-mode]: /use-timescale/:currentVersion:/security/strict-ssl/ [homebrew]: https://docs.brew.sh/Installation [macports]: https://guide.macports.org/#installing.macports