Skip to main content
Version: Preview

TimescaleDB

Experimental
Creates:
AssetsLineage

Configure in the UI

This plugin can be configured directly in the Marmot UI with a step-by-step wizard.

View Guide

The TimescaleDB plugin discovers databases, tables, views, hypertables and continuous aggregates. Alongside the usual PostgreSQL metadata it records what makes a table a hypertable: the column it is partitioned by time on, the chunk interval, any space partitions, the chunk count, the compression settings and the background policies that compress, retain and refresh the data.

Relationship to the PostgreSQL plugin

TimescaleDB is a PostgreSQL extension, so a TimescaleDB server is a PostgreSQL server. Assets are filed under the PostgreSQL provider by their bare object name, which is exactly the identity the PostgreSQL plugin produces. Running both plugins against the same instance updates one set of assets rather than creating two. This plugin is the PostgreSQL plugin plus hypertable knowledge, so there is no reason to run both.

Objects in the _timescaledb_internal, _timescaledb_catalog, _timescaledb_config, _timescaledb_cache, timescaledb_information and timescaledb_experimental schemas are skipped. They hold chunk tables, materialization hypertables and catalog views, and one busy hypertable puts thousands of chunks there.

When a database does not have the extension installed, it is discovered as plain PostgreSQL.

Hypertables and continuous aggregates

A hypertable is discovered as a Table with hypertable: true and its partitioning, compression and policy metadata. Its row count and size come from approximate_row_count and hypertable_size rather than from PostgreSQL's own estimates, which report near zero because a hypertable's parent table holds no rows of its own.

A continuous aggregate is discovered as a View with continuous_aggregate: true, and gets a VIEW_OF edge from the hypertable it reads. PostgreSQL rewrites a continuous aggregate to read from a hidden materialization hypertable, so the query shown is the one recorded in the TimescaleDB catalog, which is the query as it was written.

Example Configuration


host: "timescale.company.com"
port: 5432
user: "marmot_reader"
password: "secure_password_123"
database: "metrics"
ssl_mode: "require"
include_chunks: true
tags:
- "timescale"
- "production"

Configuration

The following configuration options are available:

PropertyTypeRequiredDescription
databasestringfalseDatabase to discover. When empty, every database on the server is discovered
discover_foreign_keysboolfalseWhether to discover foreign key relationships
exclude_databases[]stringfalseDatabases to skip
exclude_system_schemasboolfalseWhether to exclude PostgreSQL and TimescaleDB internal schemas
external_links[]ExternalLinkfalseExternal links to show on all assets
filterFilterfalseFilter discovered assets by name (regex)
hoststringtrueTimescaleDB server hostname or IP address
include_chunksboolfalseWhether to read the oldest and newest chunk range. Off by default because a busy hypertable has thousands of chunks
include_columnsboolfalseWhether to include column information in table metadata
include_compressionboolfalseWhether to record compression segment and order columns
include_continuous_aggregatesboolfalseWhether to record continuous aggregates and their source hypertable lineage
include_hypertablesboolfalseWhether to record hypertable dimensions, chunk counts and policies
include_statisticsboolfalseWhether to collect row, column and size statistics
passwordstringfalsePassword for authentication
portintfalseTimescaleDB server port
ssl_modestringfalseSSL mode (disable, require, verify-ca, verify-full)
tagsTagsConfigfalseTags to apply to discovered assets
userstringtrueUsername for authentication

Available Metadata

The following metadata fields are available:

FieldTypeDescription
chunk_rangeobjectOldest and newest chunk boundary, when include_chunks is on
collatestringDatabase collation
column_namestringColumn name
commentstringObject comment
compression_enabledboolWhether compression is enabled
compression_order_by[]stringColumns rows are ordered by inside a compressed batch
compression_segment_by[]stringColumns compressed batches are grouped by
connection_limitintMaximum allowed connections to the database
continuous_aggregateboolWhether the view is a continuous aggregate
ctypestringDatabase character classification
data_typestringData type
databasestringDatabase name
default_expressionstringDefault value expression
descriptionstringColumn comment
encodingstringDatabase encoding
finalizedboolWhether the aggregate uses the finalized form, on TimescaleDB versions that report it
hoststringTimescaleDB server hostname
hypertableboolWhether the table is a hypertable
identitystringIdentity kind: a for always, d for by default
integer_intervalint64Chunk interval when the hypertable is partitioned on an integer column
integer_now_funcstringFunction that returns the current value of an integer time column
is_distributedboolWhether the hypertable is distributed, on TimescaleDB versions that support it
is_generatedboolWhether the column is generated from other columns
is_nullableboolWhether null values are allowed
is_primary_keyboolWhether the column is part of the primary key
materialization_hypertablestringInternal hypertable the results are stored in
materialized_onlyboolWhether the view reads only materialized data, without the most recent rows
num_chunksint64Number of chunks the hypertable is split into
num_dimensionsintNumber of partitioning dimensions
object_typestringObject type (table, view, materialized_view)
ownerstringObject owner
policies[]objectBackground policies attached to the object (compression, retention, refresh)
portintTimescaleDB server port
refresh_policyobjectPolicy that refreshes the aggregate
schemastringSchema name
sizeint64Database size in bytes
source_hypertablestringHypertable the aggregate reads from
space_partitions[]objectPartitioning columns beyond time, with their partition counts
table_namestringTable or view name
tablespaces[]stringTablespaces the hypertable's chunks are placed in
time_columnstringColumn the hypertable is partitioned by time on
time_column_typestringData type of the time column
time_intervalstringTime span covered by one chunk
time_interval_secondsint64Time span covered by one chunk, in seconds
timescaledb_versionstringVersion of the timescaledb extension