From aac22708f64a85fdaebb70c964eb6f20be89873e Mon Sep 17 00:00:00 2001 From: Iain Date: Mon, 6 Jan 2025 14:26:40 +0100 Subject: [PATCH 01/17] feat: create writing test for Anagha. --- ...ate-apache-airflow-with-timescale-cloud.md | 93 +++++++++++++++++++ 1 file changed, 93 insertions(+) create mode 100644 use-timescale/integrations/integrate-apache-airflow-with-timescale-cloud.md diff --git a/use-timescale/integrations/integrate-apache-airflow-with-timescale-cloud.md b/use-timescale/integrations/integrate-apache-airflow-with-timescale-cloud.md new file mode 100644 index 0000000000..1bc2777bac --- /dev/null +++ b/use-timescale/integrations/integrate-apache-airflow-with-timescale-cloud.md @@ -0,0 +1,93 @@ +--- +title: Integrate Apache Airflow with Timescale Cloud +excerpt: How to install the psql client for PostgreSQL +products: [cloud, mst, self_hosted] +keywords: [connect, inetgrate, apache, airflow] +--- + +# Integrate Apache Airflow with $CLOUD_LONG + +Apache Airflow® is a platform created by the community to programmatically author, +schedule and monitor workflows. + +To integrate Apache Airflow with $CLOUD_LONG, follow these steps: + +## Prerequisites + +To integrate Apache Airflow with $CLOUD_LONG, you must first: + +- [Create a Timescale Cloud service][create-a-service-in-timescale] + Note the connection details, you need them for this integration. +- [Install Apache Airflow][install-apache-airflow] +- ANAGHA: Anything else we need? + +## Install Required Libraries + +1. Install the `psycopg2` library to enable PostgreSQL connections. + +```bash +pip install psycopg2-binary +``` + +## Create an Airflow Connection + +1. In the Airflow web UI, navigate to **Admin** > **Connections**. +2. Click the **+** button to add a new connection. +3. Set the following fields: + - **Conn Id**: `timescale_db` + - **Conn Type**: `Postgres` + - **Host**: Your TimescaleDB hostname + - **Schema**: Your database name + - **Login**: Your username + - **Password**: Your password + - **Port**: `5432` + +## Create a DAG to Insert Data into TimescaleDB + +1. Create a new DAG file in your Airflow `dags` directory, for example, `timescale_dag.py`. + +```python +from airflow import DAG +from airflow.operators.python_operator import PythonOperator +from airflow.hooks.postgres_hook import PostgresHook +from datetime import datetime + +def insert_data_to_timescale(): + hook = PostgresHook(postgres_conn_id='timescale_db') + conn = hook.get_conn() + cursor = conn.cursor() + cursor.execute("INSERT INTO your_table (your_column) VALUES (%s)", ('your_value',)) + conn.commit() + cursor.close() + conn.close() + +default_args = { + 'owner': 'airflow', + 'start_date': datetime(2023, 1, 1), + 'retries': 1, +} + +dag = DAG('timescale_dag', default_args=default_args, schedule_interval='@daily') + +insert_task = PythonOperator( + task_id='insert_data', + python_callable=insert_data_to_timescale, + dag=dag, +) +``` + +## Test the Integration + +1. Trigger the DAG manually from the Airflow web UI. +2. Verify that the data appears in TimescaleDB. + +### Notes + +- Ensure that your Airflow instance has network access to connect to TimescaleDB. +- Consider using VPCs, security groups, and IAM roles to secure your setup. + +By following these steps, you can successfully integrate Timescale Cloud with Apache Airflow and create a data pipeline. + + +[create-a-service-in-timescale]: /getting-started/:currentVersion:/services/ +[install-apache-airflow]: https://airflow.apache.org/docs/apache-airflow/stable/start.html From 4b63bb829c8d8bc8a4ddc3e0c630124455c11c37 Mon Sep 17 00:00:00 2001 From: Iain Date: Mon, 6 Jan 2025 14:34:48 +0100 Subject: [PATCH 02/17] feat: create writing test for Anagha. --- .../integrate-apache-airflow-with-timescale-cloud.md | 2 +- use-timescale/page-index/page-index.js | 5 +++++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/use-timescale/integrations/integrate-apache-airflow-with-timescale-cloud.md b/use-timescale/integrations/integrate-apache-airflow-with-timescale-cloud.md index 1bc2777bac..838f08549b 100644 --- a/use-timescale/integrations/integrate-apache-airflow-with-timescale-cloud.md +++ b/use-timescale/integrations/integrate-apache-airflow-with-timescale-cloud.md @@ -10,7 +10,7 @@ keywords: [connect, inetgrate, apache, airflow] Apache Airflow® is a platform created by the community to programmatically author, schedule and monitor workflows. -To integrate Apache Airflow with $CLOUD_LONG, follow these steps: +This page shows you how to use a Python connector to integrate Apache Airflow with $CLOUD_LONG. ## Prerequisites diff --git a/use-timescale/page-index/page-index.js b/use-timescale/page-index/page-index.js index 8eb412c40c..67f4b80ea4 100644 --- a/use-timescale/page-index/page-index.js +++ b/use-timescale/page-index/page-index.js @@ -773,6 +773,11 @@ module.exports = [ href: "integrations", excerpt: "Integrate third-party solutions with Timescale Cloud", children: [ + { + title: "Integrate Apache Airflow with Timescale Cloud", + href: "integrate-apache-airflow-with-timescale-cloud", + excerpt: "Integrate Apache Airflow with Timescale Cloud", + }, { title: "Query and administration", href: "query-admin", From 4478234e839bd96430d4a2967b8bb820aae180df Mon Sep 17 00:00:00 2001 From: Iain Date: Mon, 6 Jan 2025 15:38:37 +0100 Subject: [PATCH 03/17] feat: create writing test for Anagha. --- .../integrate-apache-airflow-with-timescale-cloud.md | 1 + 1 file changed, 1 insertion(+) diff --git a/use-timescale/integrations/integrate-apache-airflow-with-timescale-cloud.md b/use-timescale/integrations/integrate-apache-airflow-with-timescale-cloud.md index 838f08549b..631ae08da8 100644 --- a/use-timescale/integrations/integrate-apache-airflow-with-timescale-cloud.md +++ b/use-timescale/integrations/integrate-apache-airflow-with-timescale-cloud.md @@ -17,6 +17,7 @@ This page shows you how to use a Python connector to integrate Apache Airflow wi To integrate Apache Airflow with $CLOUD_LONG, you must first: - [Create a Timescale Cloud service][create-a-service-in-timescale] + Note the connection details, you need them for this integration. - [Install Apache Airflow][install-apache-airflow] - ANAGHA: Anything else we need? From 2c73da512fdd086b25b8d56e9ed12953ca3a8db5 Mon Sep 17 00:00:00 2001 From: Iain Date: Fri, 10 Jan 2025 15:12:21 +0100 Subject: [PATCH 04/17] chore: updates on review. --- ...ate-apache-airflow-with-timescale-cloud.md | 210 +++++++++++------- 1 file changed, 130 insertions(+), 80 deletions(-) diff --git a/use-timescale/integrations/integrate-apache-airflow-with-timescale-cloud.md b/use-timescale/integrations/integrate-apache-airflow-with-timescale-cloud.md index 631ae08da8..805ccc61a8 100644 --- a/use-timescale/integrations/integrate-apache-airflow-with-timescale-cloud.md +++ b/use-timescale/integrations/integrate-apache-airflow-with-timescale-cloud.md @@ -2,93 +2,143 @@ title: Integrate Apache Airflow with Timescale Cloud excerpt: How to install the psql client for PostgreSQL products: [cloud, mst, self_hosted] -keywords: [connect, inetgrate, apache, airflow] +keywords: [connect, integrate, apache, airflow] --- # Integrate Apache Airflow with $CLOUD_LONG -Apache Airflow® is a platform created by the community to programmatically author, +Apache Airflow® is a platform created by the community to programmatically author, schedule and monitor workflows. -This page shows you how to use a Python connector to integrate Apache Airflow with $CLOUD_LONG. +A [DAG (Directed Acyclic Graph)][Airflow-DAG] is the core concept of Airflow, collecting [Tasks][Airflow-Task] together, +organized with dependencies and relationships to say how they should run. You declare a DAG in a Python file +in the `$AIRFLOW_HOME/dags` folder of your Airflow instance. -## Prerequisites - -To integrate Apache Airflow with $CLOUD_LONG, you must first: - -- [Create a Timescale Cloud service][create-a-service-in-timescale] - - Note the connection details, you need them for this integration. -- [Install Apache Airflow][install-apache-airflow] -- ANAGHA: Anything else we need? - -## Install Required Libraries - -1. Install the `psycopg2` library to enable PostgreSQL connections. - -```bash -pip install psycopg2-binary -``` - -## Create an Airflow Connection - -1. In the Airflow web UI, navigate to **Admin** > **Connections**. -2. Click the **+** button to add a new connection. -3. Set the following fields: - - **Conn Id**: `timescale_db` - - **Conn Type**: `Postgres` - - **Host**: Your TimescaleDB hostname - - **Schema**: Your database name - - **Login**: Your username - - **Password**: Your password - - **Port**: `5432` - -## Create a DAG to Insert Data into TimescaleDB - -1. Create a new DAG file in your Airflow `dags` directory, for example, `timescale_dag.py`. - -```python -from airflow import DAG -from airflow.operators.python_operator import PythonOperator -from airflow.hooks.postgres_hook import PostgresHook -from datetime import datetime - -def insert_data_to_timescale(): - hook = PostgresHook(postgres_conn_id='timescale_db') - conn = hook.get_conn() - cursor = conn.cursor() - cursor.execute("INSERT INTO your_table (your_column) VALUES (%s)", ('your_value',)) - conn.commit() - cursor.close() - conn.close() - -default_args = { - 'owner': 'airflow', - 'start_date': datetime(2023, 1, 1), - 'retries': 1, -} - -dag = DAG('timescale_dag', default_args=default_args, schedule_interval='@daily') - -insert_task = PythonOperator( - task_id='insert_data', - python_callable=insert_data_to_timescale, - dag=dag, -) -``` - -## Test the Integration - -1. Trigger the DAG manually from the Airflow web UI. -2. Verify that the data appears in TimescaleDB. - -### Notes - -- Ensure that your Airflow instance has network access to connect to TimescaleDB. -- Consider using VPCs, security groups, and IAM roles to secure your setup. - -By following these steps, you can successfully integrate Timescale Cloud with Apache Airflow and create a data pipeline. +This page shows you how to use a Python connector in a DAG to integrate Apache Airflow with a $SERVICE_LONG. +## Prerequisites -[create-a-service-in-timescale]: /getting-started/:currentVersion:/services/ +Before integrating: + +* Create a [target $SERVICE_LONG][create-service] or [enable $TIMESCALE_DB ][enable-timescaledb] on your target database. + + [Find and save your connection information][connection-info] to follow this procedure. + +* [Install Python3 and pip3](https://docs.python.org/3/using/index.html) +* [Install Apache Airflow][install-apache-airflow] + + Ensure that your Airflow instance has network access to $CLOUD_LONG. + +This example DAG uses the `company` table you create in [Create regular PostgreSQL tables for relational data][create-a-table-in-timescale] + +## Install python connectivity libraries + +1. **Enable PostgreSQL connections between Airflow and $CLOUD_LONG** + + ```bash + pip install psycopg2-binary + ``` + +1. **Enable PostgreSQL connection types in the Airflow UI** + + ```bash + pip install apache-airflow-providers-postgres + ``` + +## Create a connection between Airflow and your $SERVICE_LONG + +In your Airflow instance, securely connect to your $SERVICE_LONG: + +1. **Run Airflow** + + On your development machine, run the following command: + ```bash + airflow standalone + ``` + The username and password for Airflow UI are displayed in the `standalone | Login with username` + line in the output. + +1. **Add a connection from Airflow to your $SERVICE_LONG** + + 1. In your browser, navigate to `localhost:8080`, then select **Admin** > **Connections**. + 1. Click **+** (Add a new record), then use your [connection info][connection-info] to fill in the following fields: + + * **Connection Id**: `timescale_connection`. + * **Connection Type**: `Postgres` + * **Host**: your $SERVICE_LONG `host` + * **Database**: your $SERVICE_LONG `dbname` + * **Login**: your $SERVICE_LONG `user` + * **Password**: your $SERVICE_LONG `password` + * **Port**: your $SERVICE_LONG `port` + + +## Exchange data between Airflow and your $SERVICE_LONG + +To exchange data between Airflow and your $SERVICE_LONG: + +1. **Create and execute a DAG** + + To insert data in your $SERVICE_LONG from Airflow: + 1. In `$AIRFLOW_HOME/dags/timescale_dag.py`, add the following code: + + ```python + from airflow import DAG + from airflow.operators.python_operator import PythonOperator + from airflow.hooks.postgres_hook import PostgresHook + from datetime import datetime + + def insert_data_to_timescale(): + hook = PostgresHook(postgres_conn_id='timescale_connection') + conn = hook.get_conn() + cursor = conn.cursor() + """ + This could be any query. This example inserts data into the table + you create in: + + https://docs.timescale.com/getting-started/latest/tables-hypertables/#create-regular-postgresql-tables-for-relational-data + """ + cursor.execute("INSERT INTO company (symbol, name) VALUES (%s, %s)", + ('new_company_symbol', 'New Company Name')) + conn.commit() + cursor.close() + conn.close() + + default_args = { + 'owner': 'airflow', + 'start_date': datetime(2023, 1, 1), + 'retries': 1, + } + + dag = DAG('timescale_dag', default_args=default_args, schedule_interval='@daily') + + insert_task = PythonOperator( + task_id='insert_data', + python_callable=insert_data_to_timescale, + dag=dag, + ) + ``` + This DAG uses the `company` table created in [Create a Table in Timescale Cloud service][create-a-table-in-timescale]. + + 1. In your browser, refresh the [Airflow UI][Airflow_UI]. + 1. In `Search DAGS`, type `timescale_dag` and press ENTER. + 1. Press the play icon and trigger the DAG: + ![daily eth volume of assets](https://assets.timescale.com/docs/images/integrations-apache-airflow.png) +1. **Verify that the data appears in $CLOUD_LONG** + + 1. In [Timescale Console][console], navigate to your service and click **SQL editor**. + 1. Run a query to view your data. For example: `SELECT symbol, name FROM company;`. + + You see the new rows inserted in the table. + +You have successfully integrated Apache Airflow with $CLOUD_LONG and created a data pipeline. + + +[create-a-table-in-timescale]: /getting-started/:currentVersion:/tables-hypertables/#create-regular-postgresql-tables-for-relational-data [install-apache-airflow]: https://airflow.apache.org/docs/apache-airflow/stable/start.html +[console]: https://console.cloud.timescale.com/ +[create-service]: /getting-started/:currentVersion:/services/ +[enable-timescaledb]: /self-hosted/:currentVersion:/install/ +[connection-info]: /use-timescale/:currentVersion:/integrations/query-admin/about-connecting/ +[Airflow-DAG]: https://airflow.apache.org/docs/apache-airflow/stable/core-concepts/dags.html#dags +[Airflow-Task]:https://airflow.apache.org/docs/apache-airflow/stable/core-concepts/tasks.html +[Airflow_UI]: localhost:8080 From 8bd4237eea809a2803950930eba4422fc5233868 Mon Sep 17 00:00:00 2001 From: Iain Date: Mon, 13 Jan 2025 10:53:09 +0100 Subject: [PATCH 05/17] chore: updates on review. --- .../integrate-apache-airflow-with-timescale-cloud.md | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/use-timescale/integrations/integrate-apache-airflow-with-timescale-cloud.md b/use-timescale/integrations/integrate-apache-airflow-with-timescale-cloud.md index 805ccc61a8..dfc72750d3 100644 --- a/use-timescale/integrations/integrate-apache-airflow-with-timescale-cloud.md +++ b/use-timescale/integrations/integrate-apache-airflow-with-timescale-cloud.md @@ -20,10 +20,11 @@ This page shows you how to use a Python connector in a DAG to integrate Apache A Before integrating: -* Create a [target $SERVICE_LONG][create-service] or [enable $TIMESCALE_DB ][enable-timescaledb] on your target database. - [Find and save your connection information][connection-info] to follow this procedure. + +* Create a [$SERVICE_LONG][create-service], [your connection information][connection-info] to follow this procedure. + This procedure also works for [self-hosted $TIMESCALE_DB ][enable-timescaledb]. * [Install Python3 and pip3](https://docs.python.org/3/using/index.html) * [Install Apache Airflow][install-apache-airflow] From 21e3cb6e666e6d66236ade92621cb3b733d09fad Mon Sep 17 00:00:00 2001 From: Anastasiia Tovpeko <114177030+atovpeko@users.noreply.github.com> Date: Mon, 13 Jan 2025 15:55:08 +0200 Subject: [PATCH 06/17] =?UTF-8?q?Combine=D0=B2=20psql=20pages=20into=20one?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- _partials/_grafana-connect.md | 33 +- _partials/_integration-prereqs.md | 9 + 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 +- .../observability-alerting/grafana.md | 14 +- .../query-admin/about-connecting.md | 89 ------ .../integrations/query-admin/about-psql.md | 109 ------- .../query-admin/find-connection-details.md | 57 ++++ .../integrations/query-admin/psql.md | 285 ++++++++++-------- .../metrics-logging/service-metrics.md | 2 +- use-timescale/page-index/page-index.js | 11 +- 17 files changed, 259 insertions(+), 366 deletions(-) create mode 100644 _partials/_integration-prereqs.md delete mode 100644 use-timescale/integrations/query-admin/about-connecting.md delete mode 100644 use-timescale/integrations/query-admin/about-psql.md create mode 100644 use-timescale/integrations/query-admin/find-connection-details.md diff --git a/_partials/_grafana-connect.md b/_partials/_grafana-connect.md index efd81e42c1..afca26fb25 100644 --- a/_partials/_grafana-connect.md +++ b/_partials/_grafana-connect.md @@ -1,11 +1,14 @@ ## 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"; -## Add your $SERVICE_LONG as a data source + -To connect the data in your $SERVICE_LONG to Grafana: +* 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 + +To connect the data in your $SERVICE_SHORT to Grafana: @@ -14,27 +17,16 @@ To connect the data in your $SERVICE_LONG to Grafana: 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** +1. **Add your $SERVICE_SHORT as a data source** 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`. + 1. Configure the connection: + - `Host URL`, `Username`, `Password`, and `Database`: configure using your [connection details][connection-info]. + - `Database name`: provide the name for your dataset. - `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: - - ```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 URL in the required format. - 1. **Click `Save & test`** Grafana checks that your details are set correctly. @@ -44,4 +36,5 @@ To connect the data in your $SERVICE_LONG to Grafana: [grafana-self-managed]: https://grafana.com/get/?tab=self-managed [grafana-cloud]: https://grafana.com/get/ [cloud-login]: https://console.cloud.timescale.com/ -[create-service]: /getting-started/:currentVersion:/services/ \ No newline at end of file +[create-service]: /getting-started/:currentVersion:/services/ +[connection-info]: /use-timescale/:currentVersion:/integrations/query-admin/find-connection-details/ \ No newline at end of file diff --git a/_partials/_integration-prereqs.md b/_partials/_integration-prereqs.md new file mode 100644 index 0000000000..069f0044f4 --- /dev/null +++ b/_partials/_integration-prereqs.md @@ -0,0 +1,9 @@ +Before integrating: + +* Create a [target $SERVICE_LONG][create-service]. You need [your connection details][connection-info] to follow this procedure. + + This procedure also works for [self-hosted $TIMESCALE_DB][enable-timescaledb]. + +[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 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/observability-alerting/grafana.md b/use-timescale/integrations/observability-alerting/grafana.md index 933d528fe0..4d41851c54 100644 --- a/use-timescale/integrations/observability-alerting/grafana.md +++ b/use-timescale/integrations/observability-alerting/grafana.md @@ -7,11 +7,11 @@ keywords: [Grafana, visualizations, analytics, monitoring] import GrafanaConnect from "versionContent/_partials/_grafana-connect.mdx"; -# Integrate Grafana and Timescale Cloud +# Grafana -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/) enables you to query, visualize, alert on, and explore your metrics, logs, and traces wherever they’re stored. -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 integrate Grafana with a $SERVICE_LONG, create a dashboard and panel, then visualize geospatial data. @@ -30,7 +30,7 @@ that system. 1. **Select the data source** - Select your $SERVICE_LONG from the list of pre-configured data sources or configure a new one. + Select your $SERVICE_SHORT from the list of pre-configured data sources or configure a new one. 1. **Configure your panel** @@ -124,11 +124,11 @@ tutorial as a starting point. 1. In your Grafana dashboard, click `Add` > `Visualization`. - 1. Select `Geomap` in the visualization type drop-down. + 1. Select `Geomap` in the visualization type drop-down at the top right. 1. **Configure the data format** - 1. In the `Queries` tab, select your data source. + 1. In the `Queries` tab below, select your data source. 1. In the `Format` drop-down, select `Table`. @@ -155,7 +155,7 @@ tutorial as a starting point. With default settings, the visualization uses green circles of the fixed size. Configure at least the following for a more representative view: - -`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. diff --git a/use-timescale/integrations/query-admin/about-connecting.md b/use-timescale/integrations/query-admin/about-connecting.md deleted file mode 100644 index 12ba4d6c0c..0000000000 --- a/use-timescale/integrations/query-admin/about-connecting.md +++ /dev/null @@ -1,89 +0,0 @@ ---- -title: Connecting to Timescale -excerpt: How to connect to a Timescale instance -products: [cloud, mst, self_hosted] -keywords: [connect, Managed Service for TimescaleDB, Timescale] ---- - - -# Connecting to Timescale - -Regardless of the tool you use to connect to your database, you need to make -sure you have these details: - -* Hostname -* Port -* Username -* Password -* Database name - -For more information about using these details to connect with `psql`, see the -[About psql][about-psql] section. - -## Find connection details - - - - - - - -### Finding connection details in Timescale - -1. Sign in to the [Timescale portal][tsc-portal]. -1. In the `Services` tab, find the service you want to connect to, and check - it is marked as `Running`. -1. Click the name of the service to see its connection information. Copy the - `Service URL`. -1. If you don't know the password for the service, navigate to the `Operations` - tab, and click `Reset password`. You can choose your own password or allow - Timescale to generate a secure password for you. Keep a copy of your - new password. - - - - - - - - - - - -### Finding connection details in Managed Service for TimescaleDB - -1. Sign in to your Managed Service for TimescaleDB portal. -1. In the `Services` tab, find the service you want to connect to, and check - it is marked as `Running`. -1. Click the name of the service to see its connection information. Copy the - `host`, `port`, and `password`. You need these to connect. - - - - - - - - - -If you have installed your database on your local system, you can use the -`localhost` hostname to log in as the PostgreSQL root user `postgres`. When you -have connected using these details, make sure that you set up an additional user -for accessing your database, and add additional authentication requirements. - - - - - -[about-psql]: /use-timescale/:currentVersion:/integrations/query-admin/about-psql/ -[tsc-portal]: https://console.cloud.timescale.com/ 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/find-connection-details.md b/use-timescale/integrations/query-admin/find-connection-details.md new file mode 100644 index 0000000000..3fbfac432b --- /dev/null +++ b/use-timescale/integrations/query-admin/find-connection-details.md @@ -0,0 +1,57 @@ +--- +title: Find your connection details +excerpt: How to connect to a Timescale instance +products: [cloud, mst, self_hosted] +keywords: [connect, Managed Service for TimescaleDB, Timescale] +--- + +# Find your connection details + +To connect to your $SERVICE_SHORT or self-hosted database, you need at least the following: + +- Hostname +- Port +- Username +- Password +- Database name + +Find the connection details based on your installation type. + + + + + +Retrieve the connection details for your $SERVICE_LONG: + +- **In `-credentials.txt`**: + + All connection details are supplied in the configuration file you download when you create a new $SERVICE_SHORT. + +- **In $CONSOLE**: + + Open the [`Services`][console-services] page and select your $SERVICE_SHORT. The connection details, except the password, are available in the `Connect to your service` widget. If necessary, click `Forgot your password?` to get a new one. + + ![Timescale service connection details](https://assets.timescale.com/docs/images/timescale-service-connection-details.png) + + + + + +Find the connection details in the [PostgreSQL configuration file][postgres-config] or by asking your database administrator. + + + + + +In the `Services` page of the $MST_CONSOLE_LONG, click the service you want to connect to. You see the connection details: + +![MST connection details](https://assets.timescale.com/docs/images/mst-connection-info.png) + + + + + +[about-psql]: /use-timescale/:currentVersion:/integrations/query-admin/psql/ +[tsc-portal]: https://console.cloud.timescale.com/ +[console-services]: https://console.cloud.timescale.com/dashboard/services +[postgres-config]: https://www.postgresql.org/docs/current/runtime-config-file-locations.html diff --git a/use-timescale/integrations/query-admin/psql.md b/use-timescale/integrations/query-admin/psql.md index 1ca4a0190d..9a5680aab7 100644 --- a/use-timescale/integrations/query-admin/psql.md +++ b/use-timescale/integrations/query-admin/psql.md @@ -1,224 +1,261 @@ --- -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 +import IntegrationPrereqs from "versionContent/_partials/_integration-prereqs.mdx"; -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`. +# Connect with 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: +`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 ``` - + -## Install PostgreSQL package on macOS +If you already have the latest version of `psql` installed, proceed to the [Connect to your $SERVICE_SHORT][connect-database] section. -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 -or just the `psql` tool. +## 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. -### 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)" ``` - 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 ``` -1. Install PostgreSQL: +1. Install `psql`: ```bash - brew install postgresql + brew install libpq ``` - - - - - - - - -### 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]. -1. Install the latest version of Postgresql: +1. Update your path to include the `psql` tool: ```bash - sudo port install postgresql + brew link --force libpq ``` - For example, to install version *14* replace `postgresql` with `postgresql14`. -1. View the files that were installed: - - ```bash - port contents postgresql - ``` +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 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. - - + - +Install using MacPorts. `libpqxx` is the official C++ client API for PostgreSQL. -### Installing psql using Homebrew +1. [Install MacPorts][macports] by downloading and running the package installer. -1. Install Homebrew, if you don't already have it: +1. Install the latest version of `libpqxx`: ```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 + sudo port install libpqxx ``` + +1. View the files that were installed by `libpqxx`: - 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 + port contents libpqxx + ``` + + + - +Install `psql` on Debian and Ubuntu with the `apt` package manager. -### 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]. -1. Install the latest version of libpqxx: +1. Make sure your `apt` repository is up to date: ```bash - sudo port install libpqxx + sudo apt-get update ``` -1. View the files that were installed by libpqxx: +1. Install the `postgresql-client` package: ```bash - port contents libpqxx + sudo apt-get install postgresql-client ``` - - -## Install psql on Debian and Ubuntu + -You can use the `apt` package manager on Debian and Ubuntu systems to install -the `psql` tool. +`psql` is installed by default when you install PostgreSQL. This procedure uses the interactive installer provided by PostgreSQL and EnterpriseDB. -### Installing psql using the apt package manager +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. Make sure your `apt` repository is up to date: +1. Complete the installation wizard to install the package. - ```bash - sudo apt-get update - ``` + -1. Install the `postgresql-client` package: + - ```bash - sudo apt-get install postgresql-client - ``` + - +## 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); +``` -## Install psql on Windows +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. -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. +## Run long queries - +To run multi-line queries in `psql`, use the `EOF` delimiter. For example: -### Installing psql on Windows +```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 +``` -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. +## 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/ + 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 67f4b80ea4..028499fb65 100644 --- a/use-timescale/page-index/page-index.js +++ b/use-timescale/page-index/page-index.js @@ -785,17 +785,12 @@ module.exports = [ children: [ { - title: "About connecting to Timescale", - href: "about-connecting", + title: "Find your connection details", + href: "find-connection-details", 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", + title: "Connect with psql", href: "psql", excerpt: "Install psql to connect to Timescale", }, From 92eb1e1b8ca926e3b1c35d5a955cc4bef94e7f44 Mon Sep 17 00:00:00 2001 From: Lucas Coelho Date: Mon, 13 Jan 2025 13:34:46 -0300 Subject: [PATCH 07/17] chore: redirects (#3704) * chore: move lambda files to repo * chore: add workflow to trigger lambda build * chore: trigger action * chore: trigger workflow * chore: trigger workflow * chore: trigger workflow * chore: trigger workflow * chore: trigger workflow * chore: trigger workflow * chore: update token secret * chore: trigger workflow * chore: trigger workflow * chore: trigger workflow * chore: trigger workflow * chore: trigger workflow * chore: trigger workflow * chore: trigger workflow * chore: trigger workflow * chore: trigger workflow * chore: trigger workflow * chore: trigger workflow * chore: trigger workflow * chore: trigger workflow * chore: trigger workflow * chore: trigger workflow * chore: trigger workflow * chore: trigger workflow * chore: remove CSP configuration --- .github/workflows/deploy-lambdas.yml | 1 - lambda/csp.js | 43 -------------------------- lambda/index.mjs | 45 ---------------------------- lambda/redirects.js | 4 --- 4 files changed, 93 deletions(-) delete mode 100644 lambda/csp.js delete mode 100644 lambda/index.mjs diff --git a/.github/workflows/deploy-lambdas.yml b/.github/workflows/deploy-lambdas.yml index a35146abb3..d178170ae3 100644 --- a/.github/workflows/deploy-lambdas.yml +++ b/.github/workflows/deploy-lambdas.yml @@ -1,5 +1,4 @@ name: Deploy redirects to lambda - on: push: paths: diff --git a/lambda/csp.js b/lambda/csp.js deleted file mode 100644 index 7b3cadb839..0000000000 --- a/lambda/csp.js +++ /dev/null @@ -1,43 +0,0 @@ -module.exports = { - setPolicies(headers) { - headers['content-security-policy'] = [ - { - key: 'Content-Security-Policy', - value: - "frame-ancestors 'none';style-src 'self' 'unsafe-inline' https://maxcdn.bootstrapcdn.com https://pro.fontawesome.com https://use.typekit.net https://p.typekit.net https://fonts.googleapis.com consent.api.osano.com tattle.api.osano.com cmp.osano.com disclosure.api.osano.com *.visualwebsiteoptimizer.com app.vwo.com;script-src 'self' 'unsafe-eval' 'unsafe-inline' blob: https://use.typekit.net https://www.googletagmanager.com https://js.hubspot.com https://s3-us-west-2.amazonaws.com/b2bjsstore/b/1VN080HQ276J/ https://www.google-analytics.com https://ajax.googleapis.com https://maxcdn.bootstrapcdn.com https://cdnjs.cloudflare.com https://js.hs-scripts.com https://js.hs-analytics.net https://js.hscollectedforms.net https://cdn.heapanalytics.com https://heapanalytics.com https://static.ads-twitter.com/ https://connect.facebook.net/ https://snap.licdn.com/ https://px.ads.linkedin.com https://googleads.g.doubleclick.net consent.api.osano.com tattle.api.osano.com cmp.osano.com disclosure.api.osano.com https://js.hsadspixel.net https://js.hs-banner.com https://*.clarity.ms https://tag.clearbitscripts.com https://www.clickcease.com https://reveal.clearbit.com https://x.clearbitjs.com *.visualwebsiteoptimizer.com app.vwo.com;img-src 'self' data: https://assets.iobeam.com https://*.hsforms.com https://assets.timescale.com https://docs.google.com https://www.google-analytics.com https://*.googleusercontent.com https://stats.g.doubleclick.net https://s3.amazonaws.com/ https://timescale.ghost.io https://www.timescale.com https://heapanalytics.com/ https://t.co https://analytics.twitter.com https://*.ads.linkedin.com https://www.facebook.com https://track.hubspot.com www.googletagmanager.com https://*.google.com https://*.clarity.ms https://c.bing.com chart.googleapis.com *.visualwebsiteoptimizer.com app.vwo.com;frame-src consent.api.osano.com tattle.api.osano.com cmp.osano.com disclosure.api.osano.com youtube.com www.youtube.com www.youtube-nocookie.com td.doubleclick.net app.vwo.com *.visualwebsiteoptimizer.com;worker-src blob: consent.api.osano.com tattle.api.osano.com cmp.osano.com disclosure.api.osano.com;upgrade-insecure-requests ;", - }, - ]; - - headers['strict-transport-security'] = [ - { key: 'Strict-Transport-Security', value: 'max-age=1000' }, - ]; - - headers['x-xss-protection'] = [ - { key: 'X-Xss-Protection', value: '1; mode=block' }, - ]; - - headers['x-frame-options'] = [{ key: 'X-Frame-Options', value: 'DENY' }]; - - headers['x-content-type-options'] = [ - { key: 'X-Content-Type-Options', value: 'nosniff' }, - ]; - - headers['referrer-policy'] = [ - { key: 'Referrer-Policy', value: 'strict-origin-when-cross-origin' }, - ]; - - headers['feature-policy'] = [ - { - key: 'Feature-Policy', - value: "camera 'none'; geolocation 'none'; microphone 'none'", - }, - ]; - - headers['permissions-policy'] = [ - { - key: 'Permissions-Policy', - value: 'camera=(), geolocation=(), microphone=()', - }, - ]; - }, -}; diff --git a/lambda/index.mjs b/lambda/index.mjs deleted file mode 100644 index 2275075216..0000000000 --- a/lambda/index.mjs +++ /dev/null @@ -1,45 +0,0 @@ -import csp from './csp.js'; -import redirects from './redirects.js'; -import regexRedirects from './regexRedirects.js'; - -export const handler = async (event, context, callback) => { - const request = event.Records[0].cf.request; - const response = event.Records[0].cf.response; - const headers = response.headers; - - csp.setPolicies(headers); - - let requestUri = request.uri?.split('#')[0]; - // - // Remove trailing slash if present - if (requestUri.endsWith('/')) { - requestUri = requestUri.slice(0, -1); - } - - for (const { from, to } of regexRedirects) { - if (from.test(requestUri)) { - return { - status: 301, - statusDescription: 'Moved Permanently', - headers: { - location: [{ key: 'Location', value: to }], - }, - }; - } - } - - for (const { from, to } of redirects) { - const source = from.endsWith('/') ? from.slice(0, -1) : from; - if (source == requestUri) { - return { - status: '301', - statusDescription: 'Moved Permanently', - headers: { - location: [{ value: to }], - }, - }; - } - } - - callback(null, response); -}; diff --git a/lambda/redirects.js b/lambda/redirects.js index 6b6b3c2e6d..652e7a0eb7 100644 --- a/lambda/redirects.js +++ b/lambda/redirects.js @@ -821,8 +821,4 @@ module.exports = [ from: "/use-timescale/latest/compression/backfill-historical-data/", to: "https://github.com/timescale/timescaledb-extras/blob/master/backfill.sql", }, - { - from: "/use-timescale/unexistent-path", - to: "https://github.com/timescale", - }, ]; From bff1a0a69ec74cb7d2ffcd95ac72a0432593da3a Mon Sep 17 00:00:00 2001 From: Anastasiia Tovpeko <114177030+atovpeko@users.noreply.github.com> Date: Wed, 15 Jan 2025 14:01:09 +0200 Subject: [PATCH 08/17] Flatten the structure of the integrations section (#3681) * Update use-timescale/integrations/observability-alerting/grafana.md --- _partials/_grafana-connect.md | 4 +- _partials/_integration-prereqs.md | 2 +- lambda/redirects.js | 66 +++++++-- use-timescale/ingest-data/ingest-telegraf.md | 4 +- .../{query-admin => }/azure-data-studio.md | 3 +- .../integrations/config-deploy/index.md | 13 -- .../integrations/{query-admin => }/dbeaver.md | 4 +- .../find-connection-details.md | 2 +- .../{observability-alerting => }/grafana.md | 10 +- use-timescale/integrations/index.md | 72 +++++----- .../observability-alerting/index.md | 17 --- .../integrations/{query-admin => }/pgadmin.md | 3 +- .../integrations/{query-admin => }/psql.md | 10 +- .../integrations/{query-admin => }/qstudio.md | 3 +- .../integrations/query-admin/index.md | 23 ---- .../{observability-alerting => }/tableau.md | 2 +- .../{config-deploy => }/terraform.md | 4 +- use-timescale/page-index/page-index.js | 126 +++++++----------- 18 files changed, 168 insertions(+), 200 deletions(-) rename use-timescale/integrations/{query-admin => }/azure-data-studio.md (96%) delete mode 100644 use-timescale/integrations/config-deploy/index.md rename use-timescale/integrations/{query-admin => }/dbeaver.md (94%) rename use-timescale/integrations/{query-admin => }/find-connection-details.md (96%) rename use-timescale/integrations/{observability-alerting => }/grafana.md (95%) delete mode 100644 use-timescale/integrations/observability-alerting/index.md rename use-timescale/integrations/{query-admin => }/pgadmin.md (96%) rename use-timescale/integrations/{query-admin => }/psql.md (94%) rename use-timescale/integrations/{query-admin => }/qstudio.md (94%) delete mode 100644 use-timescale/integrations/query-admin/index.md rename use-timescale/integrations/{observability-alerting => }/tableau.md (98%) rename use-timescale/integrations/{config-deploy => }/terraform.md (63%) diff --git a/_partials/_grafana-connect.md b/_partials/_grafana-connect.md index afca26fb25..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: @@ -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/lambda/redirects.js b/lambda/redirects.js index 652e7a0eb7..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", @@ -821,4 +821,48 @@ 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/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/find-connection-details/', + }, + { + 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/', + }, ]; diff --git a/use-timescale/ingest-data/ingest-telegraf.md b/use-timescale/ingest-data/ingest-telegraf.md index 9874e9ff1f..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/query-admin/about-connecting/ -[grafana]: /use-timescale/:currentVersion:/integrations/observability-alerting/grafana/ +[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/query-admin/azure-data-studio.md b/use-timescale/integrations/azure-data-studio.md similarity index 96% rename from use-timescale/integrations/query-admin/azure-data-studio.md rename to use-timescale/integrations/azure-data-studio.md index 3ade704e63..db300bca30 100644 --- a/use-timescale/integrations/query-admin/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/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 94% rename from use-timescale/integrations/query-admin/dbeaver.md rename to use-timescale/integrations/dbeaver.md index a2eafe939c..572e9afc17 100644 --- a/use-timescale/integrations/query-admin/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/query-admin/find-connection-details.md b/use-timescale/integrations/find-connection-details.md similarity index 96% rename from use-timescale/integrations/query-admin/find-connection-details.md rename to use-timescale/integrations/find-connection-details.md index 3fbfac432b..8c7be9f407 100644 --- a/use-timescale/integrations/query-admin/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/observability-alerting/grafana.md b/use-timescale/integrations/grafana.md similarity index 95% rename from use-timescale/integrations/observability-alerting/grafana.md rename to use-timescale/integrations/grafana.md index 4d41851c54..9b2a3e6a84 100644 --- a/use-timescale/integrations/observability-alerting/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. @@ -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 e0f3e0b59f..da8f39652f 100644 --- a/use-timescale/integrations/index.md +++ b/use-timescale/integrations/index.md @@ -6,35 +6,47 @@ keywords: [integrations] tags: [integrations] --- +# $CLOUD_LONG Integrations -# Integrate tooling with Timescale Cloud - -You can integrate your Timescale database 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 +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 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. + +## 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 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 + +| 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 + +| 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:/integrations/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 +[postgresql-integrations]: https://slashdot.org/software/p/PostgreSQL/integrations/ \ No newline at end of file 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 96% rename from use-timescale/integrations/query-admin/pgadmin.md rename to use-timescale/integrations/pgadmin.md index db508e0f5e..501bb8a9e9 100644 --- a/use-timescale/integrations/query-admin/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/query-admin/psql.md b/use-timescale/integrations/psql.md similarity index 94% rename from use-timescale/integrations/query-admin/psql.md rename to use-timescale/integrations/psql.md index 9a5680aab7..d014efca11 100644 --- a/use-timescale/integrations/query-admin/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,11 +251,11 @@ 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 [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/ diff --git a/use-timescale/integrations/query-admin/qstudio.md b/use-timescale/integrations/qstudio.md similarity index 94% rename from use-timescale/integrations/query-admin/qstudio.md rename to use-timescale/integrations/qstudio.md index 88591eaa29..eb37f52dcf 100644 --- a/use-timescale/integrations/query-admin/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/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 98% rename from use-timescale/integrations/observability-alerting/tableau.md rename to use-timescale/integrations/tableau.md index b33414c556..767e8925c2 100644 --- a/use-timescale/integrations/observability-alerting/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/config-deploy/terraform.md b/use-timescale/integrations/terraform.md similarity index 63% rename from use-timescale/integrations/config-deploy/terraform.md rename to use-timescale/integrations/terraform.md index 51439b2008..11fb802077 100644 --- a/use-timescale/integrations/config-deploy/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 diff --git a/use-timescale/page-index/page-index.js b/use-timescale/page-index/page-index.js index 028499fb65..85e290571f 100644 --- a/use-timescale/page-index/page-index.js +++ b/use-timescale/page-index/page-index.js @@ -774,83 +774,54 @@ module.exports = [ excerpt: "Integrate third-party solutions with Timescale Cloud", children: [ { - title: "Integrate Apache Airflow with Timescale Cloud", - href: "integrate-apache-airflow-with-timescale-cloud", - excerpt: "Integrate Apache Airflow with Timescale Cloud", - }, - { - title: "Query and administration", - href: "query-admin", - excerpt: "Integrate your Timescale database with third-party query and administration solutions", - children: - [ - { - title: "Find your connection details", - href: "find-connection-details", - 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: "Find your connection details", + href: "find-connection-details", + excerpt: "Learn about 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", }, ], }, @@ -913,7 +884,6 @@ module.exports = [ href: "troubleshoot-timescaledb", excerpt: "Troubleshooting Timescale", }, - ], }, ]; From 87a0299c80df03915fada2d3bb130d77c560431a Mon Sep 17 00:00:00 2001 From: Victor Perez Date: Thu, 16 Jan 2025 10:44:00 +0100 Subject: [PATCH 09/17] Remove deprecated flag (#3708) Co-authored-by: Iain Cox --- use-timescale/ingest-data/import-csv.md | 1 - 1 file changed, 1 deletion(-) diff --git a/use-timescale/ingest-data/import-csv.md b/use-timescale/ingest-data/import-csv.md index 901d1474d4..2893fdcbe5 100644 --- a/use-timescale/ingest-data/import-csv.md +++ b/use-timescale/ingest-data/import-csv.md @@ -79,7 +79,6 @@ To import data from a CSV file: ```bash timescaledb-parallel-copy \ --connection $TARGET \ - --db-name tsdb \ --table \ --file .csv \ --workers \ From 979643a712a92fcac41eb399b9e9fff5e5083b9d Mon Sep 17 00:00:00 2001 From: Iain Date: Mon, 6 Jan 2025 14:34:48 +0100 Subject: [PATCH 10/17] feat: create writing test for Anagha. --- use-timescale/page-index/page-index.js | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/use-timescale/page-index/page-index.js b/use-timescale/page-index/page-index.js index 85e290571f..4654cd6840 100644 --- a/use-timescale/page-index/page-index.js +++ b/use-timescale/page-index/page-index.js @@ -778,6 +778,11 @@ module.exports = [ href: "find-connection-details", excerpt: "Learn about connecting to your Timescale database", }, + { + title: "Apache Airflow", + href: "integrate-apache-airflow-with-timescale-cloud", + excerpt: "Integrate Apache Airflow with Timescale Cloud", + }, { title: "Azure Data Studio", href: "azure-data-studio", From bc75004ca3b00ede0ddf403f327cfcf2bdd947f6 Mon Sep 17 00:00:00 2001 From: Iain Date: Thu, 16 Jan 2025 13:19:43 +0100 Subject: [PATCH 11/17] chore: add the Apache Airflow doc to the new integrations structure. --- ...w-with-timescale-cloud.md => apache-airflow.md} | 3 +-- use-timescale/integrations/index.md | 14 +++++++++++++- use-timescale/page-index/page-index.js | 2 +- 3 files changed, 15 insertions(+), 4 deletions(-) rename use-timescale/integrations/{integrate-apache-airflow-with-timescale-cloud.md => apache-airflow.md} (99%) diff --git a/use-timescale/integrations/integrate-apache-airflow-with-timescale-cloud.md b/use-timescale/integrations/apache-airflow.md similarity index 99% rename from use-timescale/integrations/integrate-apache-airflow-with-timescale-cloud.md rename to use-timescale/integrations/apache-airflow.md index dfc72750d3..6c89fa9d76 100644 --- a/use-timescale/integrations/integrate-apache-airflow-with-timescale-cloud.md +++ b/use-timescale/integrations/apache-airflow.md @@ -7,8 +7,7 @@ keywords: [connect, integrate, apache, airflow] # Integrate Apache Airflow with $CLOUD_LONG -Apache Airflow® is a platform created by the community to programmatically author, -schedule and monitor workflows. +Apache Airflow® is a platform created by the community to programmatically author, schedule and monitor workflows. A [DAG (Directed Acyclic Graph)][Airflow-DAG] is the core concept of Airflow, collecting [Tasks][Airflow-Task] together, organized with dependencies and relationships to say how they should run. You declare a DAG in a Python file diff --git a/use-timescale/integrations/index.md b/use-timescale/integrations/index.md index da8f39652f..0bc508e679 100644 --- a/use-timescale/integrations/index.md +++ b/use-timescale/integrations/index.md @@ -41,6 +41,17 @@ 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. | + +## Data Engineering and Extract, transform, load + +| Name | Description | +|:--------------------------------:|----------------------------------------------------------| +| [Apache Airflow][apache-airflow] | Programmatically author, schedule and monitor workflows. | + + + + + [psql]: /use-timescale/:currentVersion:/integrations/psql/ [qstudio]: /use-timescale/:currentVersion:/integrations/qstudio/ [dbeaver]: /use-timescale/:currentVersion:/integrations/dbeaver/ @@ -49,4 +60,5 @@ 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 +[apache-airflow]: /use-timescale/:currentVersion:/integrations/apache-airflow +[postgresql-integrations]: https://slashdot.org/software/p/PostgreSQL/integrations/ diff --git a/use-timescale/page-index/page-index.js b/use-timescale/page-index/page-index.js index 4654cd6840..af995e7a77 100644 --- a/use-timescale/page-index/page-index.js +++ b/use-timescale/page-index/page-index.js @@ -780,7 +780,7 @@ module.exports = [ }, { title: "Apache Airflow", - href: "integrate-apache-airflow-with-timescale-cloud", + href: "apache-airflow", excerpt: "Integrate Apache Airflow with Timescale Cloud", }, { From fe413f0d8bc948cde824e04dc077315430856221 Mon Sep 17 00:00:00 2001 From: Iain Date: Thu, 16 Jan 2025 13:32:49 +0100 Subject: [PATCH 12/17] chore: update on review. --- use-timescale/integrations/apache-airflow.md | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/use-timescale/integrations/apache-airflow.md b/use-timescale/integrations/apache-airflow.md index 6c89fa9d76..68c2e7b6e3 100644 --- a/use-timescale/integrations/apache-airflow.md +++ b/use-timescale/integrations/apache-airflow.md @@ -5,6 +5,8 @@ products: [cloud, mst, self_hosted] keywords: [connect, integrate, apache, airflow] --- +import IntegrationPrereqs from "versionContent/_partials/_integration-prereqs.mdx"; + # Integrate Apache Airflow with $CLOUD_LONG Apache Airflow® is a platform created by the community to programmatically author, schedule and monitor workflows. @@ -17,14 +19,9 @@ This page shows you how to use a Python connector in a DAG to integrate Apache A ## Prerequisites -Before integrating: - - - + -* Create a [$SERVICE_LONG][create-service], [your connection information][connection-info] to follow this procedure. - This procedure also works for [self-hosted $TIMESCALE_DB ][enable-timescaledb]. -* [Install Python3 and pip3](https://docs.python.org/3/using/index.html) +* [Install Python3 and pip3][install-python-pip] * [Install Apache Airflow][install-apache-airflow] Ensure that your Airflow instance has network access to $CLOUD_LONG. @@ -135,6 +132,7 @@ You have successfully integrated Apache Airflow with $CLOUD_LONG and created a d [create-a-table-in-timescale]: /getting-started/:currentVersion:/tables-hypertables/#create-regular-postgresql-tables-for-relational-data [install-apache-airflow]: https://airflow.apache.org/docs/apache-airflow/stable/start.html +[install-python-pip]: https://docs.python.org/3/using/index.html [console]: https://console.cloud.timescale.com/ [create-service]: /getting-started/:currentVersion:/services/ [enable-timescaledb]: /self-hosted/:currentVersion:/install/ From 064d273773ba12a587c9679d21246d3dac5f56a6 Mon Sep 17 00:00:00 2001 From: Iain Date: Thu, 16 Jan 2025 14:38:15 +0100 Subject: [PATCH 13/17] chore: update on review. --- use-timescale/integrations/index.md | 1 + 1 file changed, 1 insertion(+) diff --git a/use-timescale/integrations/index.md b/use-timescale/integrations/index.md index 0bc508e679..fc7638c5ad 100644 --- a/use-timescale/integrations/index.md +++ b/use-timescale/integrations/index.md @@ -62,3 +62,4 @@ Some of the most in-demand integrations for $CLOUD_LONG are listed below, with l [terraform]: /use-timescale/:currentVersion:/integrations/terraform [apache-airflow]: /use-timescale/:currentVersion:/integrations/apache-airflow [postgresql-integrations]: https://slashdot.org/software/p/PostgreSQL/integrations/ + From 7506deb324e9b932121cee732153fd696412ce5e Mon Sep 17 00:00:00 2001 From: Iain Cox Date: Thu, 16 Jan 2025 16:39:16 +0100 Subject: [PATCH 14/17] Apply suggestions from code review Co-authored-by: Anastasiia Tovpeko <114177030+atovpeko@users.noreply.github.com> Signed-off-by: Iain Cox --- use-timescale/integrations/apache-airflow.md | 10 +++++----- use-timescale/integrations/index.md | 4 ++-- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/use-timescale/integrations/apache-airflow.md b/use-timescale/integrations/apache-airflow.md index 68c2e7b6e3..a9a0d6d448 100644 --- a/use-timescale/integrations/apache-airflow.md +++ b/use-timescale/integrations/apache-airflow.md @@ -9,7 +9,7 @@ import IntegrationPrereqs from "versionContent/_partials/_integration-prereqs.md # Integrate Apache Airflow with $CLOUD_LONG -Apache Airflow® is a platform created by the community to programmatically author, schedule and monitor workflows. +Apache Airflow® is a platform created by the community to programmatically author, schedule, and monitor workflows. A [DAG (Directed Acyclic Graph)][Airflow-DAG] is the core concept of Airflow, collecting [Tasks][Airflow-Task] together, organized with dependencies and relationships to say how they should run. You declare a DAG in a Python file @@ -57,8 +57,8 @@ In your Airflow instance, securely connect to your $SERVICE_LONG: 1. **Add a connection from Airflow to your $SERVICE_LONG** - 1. In your browser, navigate to `localhost:8080`, then select **Admin** > **Connections**. - 1. Click **+** (Add a new record), then use your [connection info][connection-info] to fill in the following fields: + 1. In your browser, navigate to `localhost:8080`, then select `Admin` > `Connections`. + 1. Click `+` (Add a new record), then use your [connection info][connection-info] to fill in the following fields: * **Connection Id**: `timescale_connection`. * **Connection Type**: `Postgres` @@ -122,7 +122,7 @@ To exchange data between Airflow and your $SERVICE_LONG: ![daily eth volume of assets](https://assets.timescale.com/docs/images/integrations-apache-airflow.png) 1. **Verify that the data appears in $CLOUD_LONG** - 1. In [Timescale Console][console], navigate to your service and click **SQL editor**. + 1. In [Timescale Console][console], navigate to your service and click `SQL editor`. 1. Run a query to view your data. For example: `SELECT symbol, name FROM company;`. You see the new rows inserted in the table. @@ -136,7 +136,7 @@ You have successfully integrated Apache Airflow with $CLOUD_LONG and created a d [console]: https://console.cloud.timescale.com/ [create-service]: /getting-started/:currentVersion:/services/ [enable-timescaledb]: /self-hosted/:currentVersion:/install/ -[connection-info]: /use-timescale/:currentVersion:/integrations/query-admin/about-connecting/ +[connection-info]: /use-timescale/:currentVersion:/integrations/find-connection-details/ [Airflow-DAG]: https://airflow.apache.org/docs/apache-airflow/stable/core-concepts/dags.html#dags [Airflow-Task]:https://airflow.apache.org/docs/apache-airflow/stable/core-concepts/tasks.html [Airflow_UI]: localhost:8080 diff --git a/use-timescale/integrations/index.md b/use-timescale/integrations/index.md index ce4204a4fd..69f00396c0 100644 --- a/use-timescale/integrations/index.md +++ b/use-timescale/integrations/index.md @@ -42,11 +42,11 @@ 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. | -## Data Engineering and Extract, transform, load +## Data engineering and extract, transform, load | Name | Description | |:--------------------------------:|----------------------------------------------------------| -| [Apache Airflow][apache-airflow] | Programmatically author, schedule and monitor workflows. | +| [Apache Airflow][apache-airflow] | Programmatically author, schedule, and monitor workflows. | From 1699c60093959eb900686d7f093c03b488e5ee92 Mon Sep 17 00:00:00 2001 From: Iain Date: Thu, 16 Jan 2025 16:55:32 +0100 Subject: [PATCH 15/17] chore: updates on review. --- use-timescale/integrations/apache-airflow.md | 28 ++++++++++++-------- 1 file changed, 17 insertions(+), 11 deletions(-) diff --git a/use-timescale/integrations/apache-airflow.md b/use-timescale/integrations/apache-airflow.md index a9a0d6d448..6f64332710 100644 --- a/use-timescale/integrations/apache-airflow.md +++ b/use-timescale/integrations/apache-airflow.md @@ -30,6 +30,9 @@ This example DAG uses the `company` table you create in [Create regular Postgre ## Install python connectivity libraries +To install the Python libraries required to connect to $CLOUD_LONG: + + 1. **Enable PostgreSQL connections between Airflow and $CLOUD_LONG** ```bash @@ -41,38 +44,39 @@ This example DAG uses the `company` table you create in [Create regular Postgre ```bash pip install apache-airflow-providers-postgres ``` + ## Create a connection between Airflow and your $SERVICE_LONG In your Airflow instance, securely connect to your $SERVICE_LONG: + + 1. **Run Airflow** On your development machine, run the following command: + ```bash airflow standalone ``` + The username and password for Airflow UI are displayed in the `standalone | Login with username` line in the output. 1. **Add a connection from Airflow to your $SERVICE_LONG** 1. In your browser, navigate to `localhost:8080`, then select `Admin` > `Connections`. - 1. Click `+` (Add a new record), then use your [connection info][connection-info] to fill in the following fields: - - * **Connection Id**: `timescale_connection`. - * **Connection Type**: `Postgres` - * **Host**: your $SERVICE_LONG `host` - * **Database**: your $SERVICE_LONG `dbname` - * **Login**: your $SERVICE_LONG `user` - * **Password**: your $SERVICE_LONG `password` - * **Port**: your $SERVICE_LONG `port` - + 1. Click `+` (Add a new record), then use your [connection info][connection-info] to fill in + the form. The `Connection Type` is `Postgres`. + + ## Exchange data between Airflow and your $SERVICE_LONG To exchange data between Airflow and your $SERVICE_LONG: + + 1. **Create and execute a DAG** To insert data in your $SERVICE_LONG from Airflow: @@ -114,7 +118,7 @@ To exchange data between Airflow and your $SERVICE_LONG: dag=dag, ) ``` - This DAG uses the `company` table created in [Create a Table in Timescale Cloud service][create-a-table-in-timescale]. + This DAG uses the `company` table created in [Create regular PostgreSQL tables for relational data][create-a-table-in-timescale]. 1. In your browser, refresh the [Airflow UI][Airflow_UI]. 1. In `Search DAGS`, type `timescale_dag` and press ENTER. @@ -127,6 +131,8 @@ To exchange data between Airflow and your $SERVICE_LONG: You see the new rows inserted in the table. + + You have successfully integrated Apache Airflow with $CLOUD_LONG and created a data pipeline. From fc5a6cddb844551210b945b318571e4ae0987c41 Mon Sep 17 00:00:00 2001 From: Iain Date: Thu, 16 Jan 2025 17:02:34 +0100 Subject: [PATCH 16/17] chore: updates on review. --- use-timescale/integrations/apache-airflow.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/use-timescale/integrations/apache-airflow.md b/use-timescale/integrations/apache-airflow.md index 6f64332710..2de9c364ec 100644 --- a/use-timescale/integrations/apache-airflow.md +++ b/use-timescale/integrations/apache-airflow.md @@ -31,6 +31,7 @@ This example DAG uses the `company` table you create in [Create regular Postgre ## Install python connectivity libraries To install the Python libraries required to connect to $CLOUD_LONG: + 1. **Enable PostgreSQL connections between Airflow and $CLOUD_LONG** @@ -44,6 +45,7 @@ To install the Python libraries required to connect to $CLOUD_LONG: ```bash pip install apache-airflow-providers-postgres ``` + ## Create a connection between Airflow and your $SERVICE_LONG From 3d7b8ec6a161934f2f6fe56051a92cf144299229 Mon Sep 17 00:00:00 2001 From: Iain Date: Thu, 16 Jan 2025 17:20:56 +0100 Subject: [PATCH 17/17] chore: updates on review. --- use-timescale/integrations/apache-airflow.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/use-timescale/integrations/apache-airflow.md b/use-timescale/integrations/apache-airflow.md index 2de9c364ec..19ebc9cc3a 100644 --- a/use-timescale/integrations/apache-airflow.md +++ b/use-timescale/integrations/apache-airflow.md @@ -91,7 +91,7 @@ To exchange data between Airflow and your $SERVICE_LONG: from datetime import datetime def insert_data_to_timescale(): - hook = PostgresHook(postgres_conn_id='timescale_connection') + hook = PostgresHook(postgres_conn_id='the ID of the connenction you created') conn = hook.get_conn() cursor = conn.cursor() """