Skip to content
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

Allow file sink to accept metric events #21704

Open
rahulsmehta opened this issue Nov 5, 2024 · 2 comments · May be fixed by #21726
Open

Allow file sink to accept metric events #21704

rahulsmehta opened this issue Nov 5, 2024 · 2 comments · May be fixed by #21726
Labels
sink: file Anything `file` sink related type: feature A value-adding code addition that introduce new functionality.

Comments

@rahulsmehta
Copy link

rahulsmehta commented Nov 5, 2024

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

I am attempting to save metrics to disk using the native_json codec using http_server source & the file sink, but it appears to only support logs - see below

Input::new(self.encoding.config().1.input_type() & DataType::Log)

Attempted Solutions

Similar to the workaround mentioned in #20756, I was able to work around this by using the metric_to_log transform to save metrics to disk, and then applied the inverse log_to_metric transform downstream.

Proposal

Allow the file sink to accept metric events

References

Version

vector 0.42.0 (aarch64-unknown-linux-gnu 3d16e34 2024-10-21 14:10:14.375255220)

@rahulsmehta rahulsmehta added the type: feature A value-adding code addition that introduce new functionality. label Nov 5, 2024
@rahulsmehta
Copy link
Author

cc @nionata

@pront
Copy link
Contributor

pront commented Nov 5, 2024

Hi @rahulsmehta, thank you for the request.

It's been a while since I looked at the file sink implementation but I don't think it will require too much modification to support metrics. If you wanted to test how it works with metrics, you can remove the & DataType::Log and run a config. The native JSON codecs support all data types.

@pront pront added the sink: file Anything `file` sink related label Nov 5, 2024
@nionata nionata linked a pull request Nov 7, 2024 that will close this issue
10 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
sink: file Anything `file` 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.

2 participants