Skip to content

Conversation

airhorns
Copy link

@airhorns airhorns commented Jul 25, 2025

Summary

Redis has support for a newish data structure called streams that model unbounded data streams better than lists or PUBSUB do. Consumers can use a cursor to move through a stream reliably with redis assigning ids to individual records in the stream. Streams also support automatic trimming to keep the stored length bounded, and clients can implement Kafka-style consumer groups to process a stream in parallel. This adds support for publishing to redis streams using the XADD command, and an optional config to tell Redis to keep the length of the stream within a max.

Read more about streams: https://redis.io/docs/latest/develop/data-types/streams/

Vector configuration

sources:
  sample_logs:
    type: "internal_logs"
    include_metrics: false

sinks:
  redis_stream:
    type: "redis"
    inputs: ["sample_logs"]
    endpoint: "redis://127.0.0.1:6379/0"
    key: "vector:logs"
    data_type: "stream"
    stream:
      max_length: 1000  # Automatically trim stream to ~1000 entries
    encoding:
      codec: "json"
    batch:
      max_events: 10
      timeout_secs: 1.0

How did you test this PR?

  • Added integration tests
  • tophatted locally with above config

Change Type

  • Bug fix
  • New feature
  • Non-functional (chore, refactoring, docs)
  • Performance

Is this a breaking change?

  • Yes
  • No

Does this PR include user facing changes?

  • Yes

@airhorns airhorns requested a review from a team as a code owner July 25, 2025 20:50
@bits-bot
Copy link

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.
You have signed the CLA already but the status is still pending? Let us recheck it.

@github-actions github-actions bot added the domain: sinks Anything related to the Vector's sinks label Jul 25, 2025
Redis has support for a newish data structure called streams that model unbounded data streams better than lists or PUBSUB do. Consumers can use a cursor to move through a stream reliably with redis assigning ids to individual records in the stream. Streams also support automatic trimming to keep the stored length bounded, and clients can implement Kafka-style consumer groups to process a stream in parallel. This adds support for publishing to redis streams using the XADD command, and an optional config to tell Redis to keep the length of the stream within a max.
@airhorns airhorns changed the title enhancement(redis): support stream data type enhancement(redis sink): support stream data type Jul 25, 2025
@pront
Copy link
Member

pront commented Jul 31, 2025

CLA assistant check Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.You have signed the CLA already but the status is still pending? Let us recheck it.

Hi @airhorns, please check the CLA and also please fix conflicts with origin/master. We will review after that.

@pront pront added the sink: redis Anything `redis` sink related label Jul 31, 2025
@thomasqueirozb thomasqueirozb added the meta: awaiting author Pull requests that are awaiting their author. label Aug 29, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
domain: sinks Anything related to the Vector's sinks meta: awaiting author Pull requests that are awaiting their author. sink: redis Anything `redis` sink related
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants