Skip to content

out_influxdb: plug tag keys failure on out influxdb#11722

Merged
edsiper merged 2 commits intomasterfrom
cosmo0920-plug-tag_keys-failure-on-out_influxdb
Apr 16, 2026
Merged

out_influxdb: plug tag keys failure on out influxdb#11722
edsiper merged 2 commits intomasterfrom
cosmo0920-plug-tag_keys-failure-on-out_influxdb

Conversation

@cosmo0920
Copy link
Copy Markdown
Contributor

@cosmo0920 cosmo0920 commented Apr 16, 2026

tag_keys should be treated as STR type instead of BOOL type.

Closes #11716.


Enter [N/A] in the box, if an item is not applicable to your change.

Testing
Before we can approve your change; please submit the following in a comment:

  • Example configuration file for the change
  • Debug log output from testing the change
  • Attached Valgrind output that shows no leaks or memory corruption was found

If this is a change to packaging of containers or native binaries then please confirm it works for all targets.

  • Run local packaging test showing all targets (including any new ones) build.
  • Set ok-package-test label to test for all targets (requires maintainer to do).

Documentation

  • Documentation required for this feature

Backporting

  • Backport to latest stable release.

Fluent Bit is licensed under Apache 2.0, by submitting this pull request I understand that this code will be released under the terms of that license.

Summary by CodeRabbit

  • New Features
    • InfluxDB output: tag_keys now accepts space-separated values so multiple attributes can be specified as tags.
  • Tests
    • Added a runtime test that verifies selected attributes are emitted as tags (with proper escaping) and are not emitted as quoted fields.

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Apr 16, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: a8845058-a3e2-4f04-96b5-922591c5037a

📥 Commits

Reviewing files that changed from the base of the PR and between efc29a4 and 240f18c.

📒 Files selected for processing (2)
  • plugins/out_influxdb/influxdb.c
  • tests/runtime/out_influxdb.c
✅ Files skipped from review due to trivial changes (1)
  • plugins/out_influxdb/influxdb.c

📝 Walkthrough

Walkthrough

Changed the InfluxDB output plugin's tag_keys config map entry from boolean to string so space-separated key lists are parsed as strings; added a runtime test that verifies tag extraction, escaping, and separation from fields.

Changes

Cohort / File(s) Summary
InfluxDB Plugin Configuration
plugins/out_influxdb/influxdb.c
Altered the config_map entry for tag_keys from FLB_CONFIG_MAP_BOOL to FLB_CONFIG_MAP_STR, making tag_keys parsed/stored as a string (space-separated list) rather than a boolean.
Runtime Test Coverage
tests/runtime/out_influxdb.c
Added flb_test_tag_keys() and cb_check_tag_keys() to assert the produced InfluxDB line protocol includes expected tag segments (with proper escaping) and that JSON-derived attributes are not emitted as quoted field-style attributes; wired test into TEST_LIST.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~12 minutes

Suggested reviewers

  • edsiper

Poem

🐰 A small switch from bool to string I sing,
Tag keys hop into lists and take wing,
Tests sniff the lines for commas and escape,
Fields and tags now each keep their shape,
Hooray — the protocol hops back in spring! 🥕✨

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly identifies the main change: fixing the tag_keys parameter type in the out_influxdb plugin from BOOL to STR, directly addressing the regression described in the linked issue.
Linked Issues check ✅ Passed The PR successfully fixes both objectives from #11716: it changes tag_keys from BOOL to STR type [11716] and adds a comprehensive test demonstrating the fix handles space-separated key lists correctly [11716].
Out of Scope Changes check ✅ Passed All changes are directly scoped to addressing the tag_keys regression: the config type fix in influxdb.c and the new test in out_influxdb.c are both necessary and expected for resolving the linked issue.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch cosmo0920-plug-tag_keys-failure-on-out_influxdb

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Signed-off-by: Hiroshi Hatake <hiroshi@chronosphere.io>
tag_keys should be treated as STR type.

Signed-off-by: Hiroshi Hatake <hiroshi@chronosphere.io>
@cosmo0920 cosmo0920 force-pushed the cosmo0920-plug-tag_keys-failure-on-out_influxdb branch from efc29a4 to 240f18c Compare April 16, 2026 10:48
@edsiper edsiper merged commit 1f47d53 into master Apr 16, 2026
45 of 49 checks passed
@edsiper edsiper deleted the cosmo0920-plug-tag_keys-failure-on-out_influxdb branch April 16, 2026 13:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Upgrade from 5.0.2 to 5.0.3 breaks usage of tag_keys in influxdb output plugin

2 participants