You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
domain:metricsAnything related to Vector's metrics eventsdomain:sinksAnything related to Vector's sinksneeds:approvalNeeds review & approval before work can begin.needs:requirementsNeeds a list of requirements before work can be beginsink:newRequest or implementation of a new sink
I'd like to support Timescale as a sink, and after talking to them it appears we just need to support Postgres since Timescale is built on Postgres. I'm hesitant to call it a Postgres sink given that we'll probably want to make certain assumptions about how we're writing data. Before we begin work we should determine if this is the appropriate course of action.
Reacted by Alex Suslov, Ben Johnson, Avthar Sewrathan, Andrew Staller, Michael Salim, David White, Mario Montoya, Karl Böhlmark, 陈杨文, Cameron Nemo and 23 more
A general unified SQL sink might be challenging given the language variants between the different databases.
But @jamessewell is correct, there should be no difference in writing data between Timescale and Postgres (but there may be other reasons for creating a Timescale specific sink).
Reacted by Ben Johnson, Zach Sherman, Michael Salim, Cameron Nemo, Andreas Karlsson, Ondřej Molík and Ryan Hamel
@jamessewell Could you please elaborate on details of your implementation of this if possible?
Are you using http sink to drop events to PostgREST? And how do you create some tables in timescaledb before starting to push events?
Reacted by Cameron Nemo, Ondřej Molík and Patrick Dung
I think at some point folks were talking about the timescaledb sink setting up the hypertable and perhaps other options, but I think folks are probably okay with that not being included in vector and setting up the schema themselves via some other means.
Thanks @CameronNemo . That is something I was wondering about. I'm not familiar with Timescale so I'm not sure if there are additional things that would be beneficial to include in a timescale sink beyond simply sending the data (which the postgres sink is capable of, thanks @jorgehermo9 !). I think someone may need to dig into this more to validate there wouldn't be additional benefit to a timescale sink that wraps the postgres sink before closing it.
I think we could take this approach if custom behaviour for timescale is needed #21308 (comment). But it would be very useful to have a concrete feature request (for example, enable that hypertable parameter) instead of a generic one.
The current postgres sink require the user to manage the DDL, as it does not create tables. I think it would be the same with hypertables (docs) @CameronNemo
TimescaleDB has a few things which apply here:
*create hypertable (function and CREATE TABLE API available)*Creates a
hypertable (automagically partitioned just in time) from a table
*enable columnstore (CREATE TABLE / ALTER TABLE API)*
Activate a columnar store for a hypertable
*Add columnstore policy*For a hypertable with a columnstore define the
window after which rows are moved across
*Add retention policy*
Define a window after which rows are removed from the hypertable
If you're passing the burden of DDL to the user, and you're not querying
the hypertables (ingest only) then you don't need to implement any of these.
domain:metricsAnything related to Vector's metrics eventsdomain:sinksAnything related to Vector's sinksneeds:approvalNeeds review & approval before work can begin.needs:requirementsNeeds a list of requirements before work can be beginsink:newRequest or implementation of a new sink
Activity
jamessewell commentedon Oct 3, 2019
As far as writing data there is no difference between Timescale and Postgres.
It would be up to the user to configure the destination tables (and hypertables in the Timscaledb case) before the sink was used.
akulkarni commentedon Oct 8, 2019
A general unified SQL sink might be challenging given the language variants between the different databases.
But @jamessewell is correct, there should be no difference in writing data between Timescale and Postgres (but there may be other reasons for creating a Timescale specific sink).
jamessewell commentedon Feb 21, 2020
I forgot to note our progress here: this can be achieved using
PostgREST(a REST gateway for PostgreSQL) . Performance is very good.2 remaining items
123BLiN commentedon May 20, 2021
@jamessewell Could you please elaborate on details of your implementation of this if possible?
Are you using http sink to drop events to PostgREST? And how do you create some tables in timescaledb before starting to push events?
ypid-geberit commentedon Aug 17, 2021
Note that there is a more generic issue #6556 which should probably be implemented first. As discussed above, it might even already solve this issue.
[-]New `timescale` / `postgres` sink[/-][+]New `postgres` sink[/+][-]New `postgres` sink[/-][+]New `timescale` sink[/+]jszwedko commentedon Dec 28, 2022
Repurposing this to be for
timescalespecifically. #15765 is tracking a genericpostgressink.jorgehermo9 commentedon Mar 6, 2025
I wonder if what is done at #21248 would work out-of-the-box for timescale. Is anyone willing to try? I could try that if I found enough time 😃
jorgehermo9 commentedon Jun 15, 2025
I think we can close this issue as the
postgressource should work withtimescale. @isbm Afaik, you are usingtimescale, right? (as you said here)@jszwedko
CameronNemo commentedon Jun 16, 2025
I think at some point folks were talking about the timescaledb sink setting up the hypertable and perhaps other options, but I think folks are probably okay with that not being included in vector and setting up the schema themselves via some other means.
jszwedko commentedon Jun 16, 2025
Thanks @CameronNemo . That is something I was wondering about. I'm not familiar with Timescale so I'm not sure if there are additional things that would be beneficial to include in a
timescalesink beyond simply sending the data (which thepostgressink is capable of, thanks @jorgehermo9 !). I think someone may need to dig into this more to validate there wouldn't be additional benefit to atimescalesink that wraps thepostgressink before closing it.jorgehermo9 commentedon Jun 16, 2025
I think we could take this approach if custom behaviour for timescale is needed #21308 (comment). But it would be very useful to have a concrete feature request (for example, enable that hypertable parameter) instead of a generic one.
The current
postgressink require the user to manage the DDL, as it does not create tables. I think it would be the same with hypertables (docs) @CameronNemojamessewell commentedon Jun 16, 2025
isbm commentedon Jun 17, 2025
Yes. But we are losing data on Vector shutdown tho. 😉