Skip to content

feat(outputs.arc): Add plugin - #17875

Merged
skartikey merged 39 commits into
influxdata:masterfrom
Basekick-Labs:master
Nov 17, 2025
Merged

feat(outputs.arc): Add plugin#17875
skartikey merged 39 commits into
influxdata:masterfrom
Basekick-Labs:master

Conversation

@xe-nvdk

@xe-nvdk xe-nvdk commented Oct 22, 2025

Copy link
Copy Markdown
Contributor

Summary

Adds Arc output plugin - a high-performance time-series database output using MessagePack binary protocol.

Features

  • 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

Testing

All tests passing (9/9):

  • Connection handling
  • Write operations (single/batch)
  • API key authentication
  • Error scenarios
  • MessagePack encoding
  • Configuration validation

Documentation

  • Comprehensive README with examples
  • Configuration guide for basic/high-performance/multi-database setups
  • Troubleshooting section
  • Performance tuning guide

Checklist

  • No AI generated code was used in this PR
xe-nvdk and others added 9 commits October 6, 2025 18:42
… 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
@telegraf-tiger

Copy link
Copy Markdown
Contributor

Thanks so much for the pull request!
🤝 ✒️ Just a reminder that the CLA has not yet been signed, and we'll need it before merging. Please sign the CLA when you get a chance, then post a comment here saying !signed-cla

@xe-nvdk

xe-nvdk commented Oct 22, 2025

Copy link
Copy Markdown
Contributor Author

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.
Ignacio

@xe-nvdk

xe-nvdk commented Oct 22, 2025

Copy link
Copy Markdown
Contributor Author

!signed-cla

@xe-nvdk xe-nvdk changed the title Adds Arc output plugin - a high-performance time-series database output using MessagePack binary protocol. Oct 22, 2025
@telegraf-tiger telegraf-tiger Bot added the feat Improvement on an existing feature such as adding a new setting/mode to an existing plugin label Oct 22, 2025
Ignacio Van Droogenbroeck added 5 commits October 22, 2025 14:54
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
@Hipska

Hipska commented Oct 24, 2025

Copy link
Copy Markdown
Contributor

Maybe I'm missing something, but can't you already use outputs.http with data_format = "msgpack"?

@xe-nvdk

xe-nvdk commented Oct 24, 2025

Copy link
Copy Markdown
Contributor Author

Maybe I'm missing something, but can't you already use outputs.http with data_format = "msgpack"?

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
Ignacio

@srebhan srebhan left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for your contribution @xe-nvdk! I do have some comments in the code...

Comment thread docs/LICENSE_OF_DEPENDENCIES.md Outdated
Comment thread plugins/outputs/arc/arc.go Outdated
Comment thread plugins/outputs/arc/arc.go Outdated
Comment thread plugins/outputs/arc/arc.go Outdated
Comment thread plugins/outputs/arc/arc.go
Comment thread plugins/outputs/arc/README.md Outdated
Comment thread plugins/outputs/arc/README.md Outdated
Comment thread plugins/outputs/arc/README.md Outdated
Comment thread plugins/outputs/arc/README.md Outdated
Comment thread plugins/outputs/arc/README.md Outdated
@srebhan srebhan changed the title feat(outputs): add arc output plugin for high-performance time-series writes Oct 27, 2025
@telegraf-tiger telegraf-tiger Bot added the plugin/output 1. Request for new output plugins 2. Issues/PRs that are related to out plugins label Oct 27, 2025
@srebhan srebhan self-assigned this Oct 27, 2025
@xe-nvdk

xe-nvdk commented Oct 27, 2025

Copy link
Copy Markdown
Contributor Author

Awesome stuff! thank you for taking the time, we are going to review all. Again, thank you!

Ignacio Van Droogenbroeck added 3 commits October 27, 2025 10:40
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
@srebhan

srebhan commented Nov 6, 2025

Copy link
Copy Markdown
Member

@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!

@srebhan srebhan left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the update @xe-nvdk! Two tiny last things...

Comment thread plugins/outputs/arc/arc.go Outdated
Comment on lines +150 to +155
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))

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How about

Suggested change
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.

Comment on lines +3 to +4
## Arc MessagePack API URL
url = "http://localhost:8000/api/v1/write/msgpack"

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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...

@xe-nvdk

xe-nvdk commented Nov 6, 2025

Copy link
Copy Markdown
Contributor Author

@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!

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.

@srebhan

srebhan commented Nov 12, 2025

Copy link
Copy Markdown
Member

@xe-nvdk any chance you address the last two comments from my side? I would love to integrate this into v1.37...

@srebhan srebhan added the waiting for response waiting for response from contributor label Nov 12, 2025
@xe-nvdk

xe-nvdk commented Nov 12, 2025

Copy link
Copy Markdown
Contributor Author

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.

@telegraf-tiger telegraf-tiger Bot removed the waiting for response waiting for response from contributor label Nov 12, 2025
xe-nvdk and others added 3 commits November 12, 2025 16:37
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).
@xe-nvdk

xe-nvdk commented Nov 12, 2025

Copy link
Copy Markdown
Contributor Author

@xe-nvdk any chance you address the last two comments from my side? I would love to integrate this into v1.37...

Ok, we should be good now. Let me know if you need something else. Thank you, this couldn't happened with you continuos support.

@srebhan srebhan left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@xe-nvdk only one last suggestion on directly using the buffer (buf) as payload instead of copying the content and creating a new reader...

Comment thread plugins/outputs/arc/arc.go Outdated
xe-nvdk and others added 2 commits November 13, 2025 11:26
Co-authored-by: Sven Rebhan <36194019+srebhan@users.noreply.github.com>

@srebhan srebhan left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@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...

Comment thread plugins/outputs/arc/arc.go
@xe-nvdk

xe-nvdk commented Nov 14, 2025

Copy link
Copy Markdown
Contributor Author

@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>
@telegraf-tiger

Copy link
Copy Markdown
Contributor

@srebhan srebhan left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks a lot @xe-nvdk!

@srebhan srebhan added the ready for final review This pull request has been reviewed and/or tested by multiple users and is ready for a final review. label Nov 17, 2025
@srebhan srebhan assigned skartikey and mstrandboge and unassigned srebhan Nov 17, 2025

@skartikey skartikey left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Excellent work @xe-nvdk!

@skartikey
skartikey merged commit aa3681d into influxdata:master Nov 17, 2025
27 checks passed
@github-actions github-actions Bot added this to the v1.37.0 milestone Nov 17, 2025
@xe-nvdk

xe-nvdk commented Nov 17, 2025

Copy link
Copy Markdown
Contributor Author

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

feat Improvement on an existing feature such as adding a new setting/mode to an existing plugin new plugin plugin/output 1. Request for new output plugins 2. Issues/PRs that are related to out plugins ready for final review This pull request has been reviewed and/or tested by multiple users and is ready for a final review.

5 participants