Skip to content

Redis sink should support event variants based on the encoding type instead of only logs #22909

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
nionata opened this issue Apr 18, 2025 · 3 comments · Fixed by #22989
Closed
Assignees
Labels
meta: good first issue Anything that is good for new contributors. sink: redis Anything `redis` sink related type: feature A value-adding code addition that introduce new functionality.

Comments

@nionata
Copy link
Contributor

nionata commented Apr 18, 2025

A note for the community

  • Please vote on this issue by adding a 👍 reaction to the original issue to help the community and maintainers prioritize this request
  • If you are interested in working on this issue or have submitted a pull request, please leave a comment

Use Cases

The redis sink could be leveraged to create a lightweight cache of metric values. All the existing redis tooling and libraries would come with this cache scheme as long as the encoding is standard.

sources:
  statsd:
    type: "statsd"
    address: "127.0.0.1:1337"
    mode: "udp"

sinks:
  redis:
    type: "redis"
    inputs:
      - statsd
    encoding:
      codec: "native_json"
    endpoint: "127.0.0.1:1338"
    key: ".name"

Attempted Solutions

An error will be logged on vector boot if you have configured the redis sink to consume from a metrics source.

ERROR vector::cli: Configuration error. error=Data type mismatch between statsd (["Metric"]) and redis (["Log"])

The redis sink config only allows for log data types today.

Proposal

The sink should work for event variants based on the sink's encoding type. The encoding framework provides for this with the input_type method. That method is even being called in the redis config. It is being overridden to only support logs. This same issue existed for the file sink and was resolved with the aforementioned proposal.

References

No response

Version

No response

@nionata nionata added the type: feature A value-adding code addition that introduce new functionality. label Apr 18, 2025
@pront pront added the sink: redis Anything `redis` sink related label Apr 18, 2025
@pront
Copy link
Member

pront commented Apr 18, 2025

Hi @nionata, this sounds like a reasonable enhancement. Happy to review a PR.

@pront pront added the meta: good first issue Anything that is good for new contributors. label Apr 18, 2025
@ynachi
Copy link
Contributor

ynachi commented Apr 28, 2025

Hello @pront, I would like to take this issue. Please assign it to me to avoid work duplicate from others. I will unassign myself if time do not allow me to progress. Thanks.

@pront
Copy link
Member

pront commented Apr 28, 2025

Hello @pront, I would like to take this issue. Please assign it to me to avoid work duplicate from others. I will unassign myself if time do not allow me to progress. Thanks.

You got it @ynachi, thank you for your interest in Vector!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
meta: good first issue Anything that is good for new contributors. sink: redis Anything `redis` sink related type: feature A value-adding code addition that introduce new functionality.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants