feat(outputs.arc): Add plugin - #17875
Conversation
sync with main
… writes Adds Arc output plugin - a high-performance time-series database output using MessagePack binary protocol. - MessagePack binary protocol (3-5x faster than line protocol) - Columnar data format for direct Arrow/Parquet writes - Multi-database support for environment/tenant isolation - Gzip compression (reduces bandwidth by ~10x) - Batch processing with configurable sizes - Comprehensive error handling and logging - Columnar format: 2.66x faster than row format - Throughput: 2.42M records/sec - Optimized for high-volume IoT and observability workloads All tests passing (9/9): - Connection handling - Write operations (single/batch) - API key authentication - Error scenarios - MessagePack encoding - Configuration validation - Comprehensive README with examples - Configuration guide for basic/high-performance/multi-database setups - Troubleshooting section - Performance tuning guide
|
Thanks so much for the pull request! |
|
Hey team. I hope that everybody is doing good over there. Happy to contribute with an output plugin. Open to make modifications in the case that I missed something. By the way: !signed-cla Have a great days, folks. |
|
!signed-cla |
Added github.com/vmihailenco/tagparser with BSD 2-Clause License Entries added in alphabetical order between vjeantet/grok and vmware/govmomi Verification ✅ make check-deps now passes successfully across all 18 target platforms (darwin, freebsd, linux, windows on various architectures) All Telegraf CI checks should now pass: ✅ Markdown linting (README.md) ✅ Go code linting (arc.go, arc_test.go) ✅ Dependency license documentation (LICENSE_OF_DEPENDENCIES.md) Modified files ready for commit: plugins/outputs/arc/README.md - All markdown linting issues fixed docs/LICENSE_OF_DEPENDENCIES.md - Added msgpack and tagparser licenses
…oid shadowing the imported config package
|
Maybe I'm missing something, but can't you already use |
Yes, it can be used, but the best performance comes from our columnar format. The implementation you're referring to sends row-based data, which introduces conversion overhead when we transform rows to columns. The output send directly the data in columnar format. Let me know if you have additional questions. Thank you |
|
Awesome stuff! thank you for taking the time, we are going to review all. Again, thank you! |
Apply code review comments from @srebhan to improve code quality and fix bugs: - Make arcColumnarData struct private (only used internally) - Preallocate columns map based on first metric's field/tag count for performance - Remove redundant inline comments throughout codebase - Add default timeout of 5s in Init() to fix context deadline exceeded errors - Correct API endpoint to /api/v1/write/msgpack (verified against OpenAPI spec) Bug fix: Previously, when timeout was not configured, a.Timeout was 0, causing context.WithTimeout() to create an immediately-expired context. Now defaults to 5s. Tests: All 10 tests passing Verified: Successfully writing metrics to production Arc instance
Remove vmihailenco/msgpack and vmihailenco/tagparser from LICENSE_OF_DEPENDENCIES.md as they are no longer used after migrating Arc output plugin to tinylib/msgp. The Arc plugin now uses tinylib/msgp (already in Telegraf dependencies) instead of vmihailenco/msgpack, so these license entries are no longer needed. Fixes: make check-deps
|
@xe-nvdk maybe it was an oversight but I missed the "AI" checkbox but I can see it now. Maybe I need better glasses. ;-) SORRY for the confusion! |
| payload := buf.Bytes() | ||
|
|
||
| ctx, cancel := context.WithTimeout(context.Background(), time.Duration(a.Timeout)) | ||
| defer cancel() | ||
|
|
||
| req, err := http.NewRequestWithContext(ctx, "POST", a.URL, bytes.NewReader(payload)) |
There was a problem hiding this comment.
How about
| payload := buf.Bytes() | |
| ctx, cancel := context.WithTimeout(context.Background(), time.Duration(a.Timeout)) | |
| defer cancel() | |
| req, err := http.NewRequestWithContext(ctx, "POST", a.URL, bytes.NewReader(payload)) | |
| ctx, cancel := context.WithTimeout(context.Background(), time.Duration(a.Timeout)) | |
| defer cancel() | |
| req, err := http.NewRequestWithContext(ctx, "POST", a.URL, &buf) |
as the buffer can server as a reader... This avoids constructing another instance... Maybe you want to rename buf to payload but not a must.
| ## Arc MessagePack API URL | ||
| url = "http://localhost:8000/api/v1/write/msgpack" |
There was a problem hiding this comment.
As you are setting this as a default in Init you should comment the url here to denote this setting as optional. Otherwise, keep it uncommented here and error-out on Init if the URL is empty...
About the checkbox, I rembered having that the first time, but I dont remember taking that out at some point, so I modified that yesterday to include it! Anyways. Thank you. Let me address the last comments. |
|
@xe-nvdk any chance you address the last two comments from my side? I would love to integrate this into v1.37... |
|
Yes. I was expecting to do this today. Let me accept your suggestion and regarding the init, in the config should be uncommented and in the init declare the error. |
Address PR feedback: keep URL uncommented in sample.conf and validate as required in Init(). Users will now get clear error "url is required" if URL is not configured. Updated TestInit to verify both success case (with URL) and failure case (without URL).
Ok, we should be good now. Let me know if you need something else. Thank you, this couldn't happened with you continuos support. |
Co-authored-by: Sven Rebhan <36194019+srebhan@users.noreply.github.com>
srebhan
left a comment
There was a problem hiding this comment.
@xe-nvdk I proposed a fix for the linter issue. Please check if that fixes the issue by running make lint!
One thing for the future: If there is a docker-based image of the database I would appreciate an integration-test at some point to make sure the plugin works with the actual thing...
Gotcha! I can work on that today if that makes sense, I have been tested on my side and works pretty well, in fact, Im using it these builds right now and works like a charm! |
Co-authored-by: Sven Rebhan <36194019+srebhan@users.noreply.github.com>
|
Download PR build artifacts for linux_amd64.tar.gz, darwin_arm64.tar.gz, and windows_amd64.zip. 📦 Click here to get additional PR build artifactsArtifact URLs |
|
Thank you folks. As you saw, I'm not the strongest on Go, and for that reason I appreciate the support across this PR. Thank you |
Summary
Adds Arc output plugin - a high-performance time-series database output using MessagePack binary protocol.
Features
Testing
All tests passing (9/9):
Documentation
Checklist