Skip to content

Commit

Permalink
Anchors are broken for reasons I don't understand (github#1547)
Browse files Browse the repository at this point in the history
  • Loading branch information
Loquacity authored Sep 7, 2022
1 parent 4b19fe1 commit 4dfa2a9
Show file tree
Hide file tree
Showing 15 changed files with 194 additions and 117 deletions.
13 changes: 13 additions & 0 deletions cloud/service-metrics.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ tags: [dashboard, cpu, memory, storage, disk space]
---

# Service metrics

You can view your service metrics from Timescale Cloud's
[metrics dashboard](#metrics-dashboard). This dashboard gives you service-level
information, such as CPU, memory, and storage usage.
Expand All @@ -16,12 +17,14 @@ You can also view your query-level statistics by using the pre-installed
extension from a PostgreSQL client.

## Metrics dashboard

Timescale Cloud provides a Metrics dashboard for managing your services. You can
see the Metrics dashboard in your Timescale Cloud account by navigating to the
`Services` section, clicking the service you want to explore, and selecting the
`Metrics` tab.

You can view metrics for your services for any of these time ranges:

* Last hour, with one minute granularity
* Last 24 hours, with one minute granularity
* Last seven days, with one hour granularity
Expand All @@ -42,6 +45,7 @@ This indicates that metrics have not been collected for the period shown. It
does not mean that your Timescale Cloud service was down.

## Continuous storage monitoring

Timescale Cloud continuously monitors the health and resource consumption of all
database services. You can check your health data by navigating to the `metrics`
tab in your service dashboard. These metrics are also monitored by the Timescale
Expand All @@ -54,8 +58,10 @@ automated actions are triggered, including notifications and preventative
actions.

### Automated user alerting

When your disk usage exceeds certain thresholds, you receive an email
notification. These notifications occur at:

* 75%
* 85%
* 95%
Expand All @@ -65,6 +71,7 @@ low and high watermarks, and we limit the frequency of messages we send you
about a particular service.

### Automated overload protection

If your database continues to increase in size past these thresholds, automated
overload protection is activated when your disk becomes 99% full. When this
happens, your database is put into read-only mode, you receive an
Expand All @@ -81,6 +88,7 @@ have done that, you can also add a retention policy, or turn on compression, to
avoid the problem occurring again in the future.

## Query-level statistics with pg_stat_statements

The `pg_stat_statements` extension gives you query-level statistics for your SQL
statements. It comes pre-installed with Timescale Cloud.

Expand All @@ -96,6 +104,7 @@ not collected.
</highlight>

### Query the pg_stat_statements view

You can view statistics for your queries through the `pg_stat_statements`
extension, which provides a `pg_stat_statements` view. The recorded statistics
include the time spent planning and executing each query; the number of blocks
Expand All @@ -108,17 +117,20 @@ queries, filter by the current user.

Connect to your database using a PostgreSQL client, such as [`psql`][psql], and
run:

```sql
SELECT * FROM pg_stat_statements WHERE pg_get_userbyid(userid) = current_user;
```

### Example usage

With `pg_stat_statements`, you can view performance statistics that help you
monitor and optimize your queries.

Here are some sample scenarios to try.

Identify the 5 longest-running queries by their mean execution time:

```sql
SELECT calls,
mean_exec_time,
Expand All @@ -134,6 +146,7 @@ Identifying queries with highly variable execution time:
The relative standard deviation, or the standard deviation expressed as a
percentage of the mean, measures how variable the execution time is. The higher
the relative standard deviation, the more variable the query execution time.

```sql
SELECT calls,
stddev_exec_time/mean_exec_time*100 AS rel_std_dev,
Expand Down
2 changes: 1 addition & 1 deletion mst/aiven-client/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,4 @@ You can use the Aiven Client tool to:
* Create a fork
* Add authentication plugins to your attached Grafana service

[aiven-client]: /mst/:currentVersion:/aiven-client/aiven-client-install/
[aiven-client]: /mst/:currentVersion:/aiven-client-install/
4 changes: 1 addition & 3 deletions mst/extensions.md
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ These extensions are available on Managed Service for TimescaleDB:
* postgis_sfcgal
* postgis_tiger_geocoder
* postgis_topology
* postgis_legacy ([See more information](#post-gis-legacy-support))
* postgis_legacy (see notes in this section)
* postgres_fdw
* rum
* sslinfo
Expand All @@ -91,8 +91,6 @@ These extensions are available on Managed Service for TimescaleDB:

<!-- vale Vale.Spelling = YES -->

<span id="post-gis-legacy-support"></span>

<highlight type="note">
The `postgis_legacy` extension is not packaged or supported as an extension by
the PostGIS project. Timescale provides the extension package for Managed
Expand Down
24 changes: 21 additions & 3 deletions mst/ingest-data.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,16 +7,18 @@ tags: [JDB, ODBC, client driver, Kafka, csv]
---

# Ingest data

There are several different ways of ingesting your data into Managed Service for
TimescaleDB. This section contains instructions to:

* Bulk upload [from a `.csv` file](#bulk-upload-from-csv-files)
* Migrate data [from an existing database][migrate-data]
* Migrate data [from InfluxDB][migrate-influxdb]
* Insert data
[directly using a client driver](#insert-data-directly-using-client-driver),
[directly using a client driver](#insert-data-directly-using-a-client-driver),
such as JDBC, ODBC, or Node.js
* Insert data
[directly using a message queue](#insert-data-directly-using-message-queue),
[directly using a message queue](#insert-data-directly-using-a-message-queue),
such as Kafka

<highlight type="note">
Expand All @@ -28,34 +30,44 @@ can connect to it using `psql`.
<procedure>

## Preparing your new database

1. Use `psql` to connect to your service. You can retrieve the service URL,
port, and login credentials from the service overview in the Timescale Cloud dashboard:

```sql
psql -h <HOSTNAME> -p <PORT> -U <USERNAME> -W -d <DATABASE_NAME>
```

1. Create a new database for your data. In this example, the new database is
called `new_db`:

```sql
CREATE DATABASE new_db;
\c new_db;
```

1. Create a new SQL table in your database. The columns you create for the
table must match the columns in your source data. In this example, the table
is storing weather condition data, and has columns for the timestamp,
location, and temperature:

```sql
CREATE TABLE conditions (
time TIMESTAMPTZ NOT NULL,
location text NOT NULL,
temperature DOUBLE PRECISION NULL
);
```

1. Load the `timescaledb` PostgreSQL extension:

```sql
CREATE EXTENSION timescaledb;
\dx
```

1. Convert the SQL table into a hypertable:

```sql
SELECT create_hypertable('conditions', 'time');
```
Expand All @@ -66,6 +78,7 @@ When you have successfully set up your new database, you can ingest data using
one of these methods.

## Bulk upload from CSV files

If you have a dataset stored in a `.csv` file, you can import it into an empty
TimescaleDB hypertable. You need to begin by creating the new table, before you
import the data.
Expand All @@ -78,10 +91,12 @@ Before you begin, make sure you have
<procedure>

### Bulk uploading from a CSV file

1. Insert data into the new hypertable using the `timescaledb-parallel-copy`
tool. You should already have the tool installed, but you can install it
manually from [our GitHub repository][github-parallel-copy] if you need to.
In this example, we are inserting the data using four workers:

```sql
timescaledb-parallel-copy \
--connection '<service_url>' \
Expand All @@ -91,19 +106,22 @@ Before you begin, make sure you have
--copy-options "CSV" \
--skip-header
```

We recommend that you set the number of workers lower than the number of
available CPU cores on your client machine or server, to prevent the workers
having to compete for resources. This helps your ingest go faster.
1. *OPTIONAL:* If you don't want to use the `timescaledb-parallel-copy` tool,
or if you have a very small dataset, you can use the PostgreSQL `COPY`
command instead:
```sql
psql '<service_url>/new_db?sslmode=require' -c "\copy conditions FROM <example.csv> WITH (FORMAT CSV, HEADER)"
```
</procedure>
## Insert data directly using a client driver
You can use a client driver such as JDBC, Python, or Node.js, to insert data
directly into your new database.
Expand All @@ -112,6 +130,7 @@ See the [PostgreSQL instructions][postgres-odbc] for using the ODBC driver.
See the [Code Quick Starts][code-qs] for using various languages, including Python and node.js.
## Insert data directly using a message queue
If you have data stored in a message queue, you can import it into your
TimescaleDB database. This section provides instructions on using the Kafka
Connect PostgreSQL connector.
Expand All @@ -133,7 +152,6 @@ recommend that you use the connector with Kafka and Kafka Connect.
See [these instructions][gh-kafkaconnector] for using the Kafka connector.
[code-qs]: /timescaledb/:currentVersion:/quick-start/
[gh-kafkaconnector]: https://github.com/debezium/debezium/tree/master/debezium-connector-postgres
[github-parallel-copy]: https://github.com/timescale/timescaledb-parallel-copy
Expand Down
2 changes: 1 addition & 1 deletion mst/logging.md
Original file line number Diff line number Diff line change
Expand Up @@ -84,4 +84,4 @@ Service for TimescaleDB.

[loggly-site]: https://www.loggly.com/
[mst-portal]: https://portal.managed.timescale.com
[aiven-cli]: /mst/:currentVersion:/aiven-client/
[aiven-cli]: /mst/:currentVersion:/aiven-client-install/
8 changes: 3 additions & 5 deletions promscale/installation/docker.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,8 @@ and TimescaleDB. For example, the tag `pg14.2-ts2.6.1-latest` includes
PostgreSQL `14.2`and TimescaleDB `2.6.1`. `pg14-latest` is the latest image
available for PostgreSQL version 14. Reference the appropriate images when
deploying Promscale and follow the instructions provided by your container
platform. If you are using Kubernetes follow [these instructions][promscale-install-kubernetes] instead.
platform. If you are using Kubernetes follow
[these instructions][promscale-install-kubernetes] instead.

<highlight type="important">
Running Promscale directly using `docker run` is not recommended for production
Expand Down Expand Up @@ -75,10 +76,7 @@ packages and instructions, see the [Docker installation documentation][docker-in

For upgrading the Promscale, see the [upgrade] section.

[alpine-image]: https://hub.docker.com/r/timescaledev/promscale-extension
[docker-install]: https://docs.docker.com/get-docker/
[promscale-docker-image]: https://hub.docker.com/r/timescale/promscale/tags
[send-data]: /promscale/:currentVersion:/send-data/
[timescaledb-docker-image]: https://hub.docker.com/r/timescale/timescaledb-ha/tags
[promscale-install-kubernetes]: promscale/:currentVersion:/installation/kubernetes/
[alpine-image]: https://hub.docker.com/r/timescaledev/promscale-extension
[promscale-install-kubernetes]: /promscale/:currentVersion:/installation/kubernetes/
Loading

0 comments on commit 4dfa2a9

Please sign in to comment.