Skip to content

Conversation

@pwhelan
Copy link
Contributor

@pwhelan pwhelan commented Jan 24, 2023

Add new command line options to enable tracing from the start:

  • --trace: define a complete trace pipeline in a single line.
  • --trace-input: define the input to trace.
  • --trace-output: define the trace output.
  • --trace-output-property: define a trace output property.

The format for the --trace option is the following:

input=$INPUT_NAME output=$OUTPUT_PLUGIN output.$PROPERTY=$VALUE

Several properties can be defined for the output plugin. Support for spaces in property values is not supported yet...


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.

@pwhelan pwhelan temporarily deployed to pr January 24, 2023 15:51 — with GitHub Actions Inactive
@pwhelan pwhelan temporarily deployed to pr January 24, 2023 15:51 — with GitHub Actions Inactive
@pwhelan pwhelan temporarily deployed to pr January 24, 2023 16:09 — with GitHub Actions Inactive
@github-actions github-actions bot added the Stale label Apr 25, 2023
@pwhelan pwhelan force-pushed the feat-trace-cmdline branch 2 times, most recently from 9edcb7c to a8ff97f Compare April 25, 2023 15:10
@pwhelan pwhelan temporarily deployed to pr April 25, 2023 15:11 — with GitHub Actions Inactive
@pwhelan pwhelan temporarily deployed to pr April 25, 2023 15:11 — with GitHub Actions Inactive
@pwhelan pwhelan temporarily deployed to pr April 25, 2023 15:11 — with GitHub Actions Inactive
@pwhelan pwhelan temporarily deployed to pr April 25, 2023 15:33 — with GitHub Actions Inactive
@github-actions github-actions bot removed the Stale label Apr 26, 2023
@fluent fluent deleted a comment from github-actions bot May 18, 2023
Copy link
Contributor

@Syn3rman Syn3rman left a comment

Choose a reason for hiding this comment

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

I've added a few comments and requested a few changes. We are ignoring the return values from all the functions and while I have pointed out only one instance, we do need to check it everywhere.

@leonardo-albertovich
Copy link
Contributor

@pwhelan please let me know once you have addressed these requests widely in the code.

I've noticed many places where the results are not being checked but it makes no sense to point anything out before you have a chance to go over your changes and fix it.

@pwhelan
Copy link
Contributor Author

pwhelan commented May 23, 2023

Valgrind log:

==611685== Memcheck, a memory error detector
==611685== Copyright (C) 2002-2022, and GNU GPL'd, by Julian Seward et al.
==611685== Using Valgrind-3.21.0 and LibVEX; rerun with -h for copyright info
==611685== Command: ./bin/fluent-bit -Z -i dummy -o exit -p flush_count=5 -f 1 --trace=input=dummy.0\ output=null
==611685== Parent PID: 563866
==611685== 
==611685== 
==611685== HEAP SUMMARY:
==611685==     in use at exit: 0 bytes in 0 blocks
==611685==   total heap usage: 3,280 allocs, 3,280 frees, 4,246,283 bytes allocated
==611685== 
==611685== All heap blocks were freed -- no leaks are possible
==611685== 
==611685== For lists of detected and suppressed errors, rerun with: -s
==611685== ERROR SUMMARY: 0 errors from 0 contexts (suppressed: 0 from 0)

@pwhelan pwhelan force-pushed the feat-trace-cmdline branch from a8ff97f to 1074297 Compare July 12, 2023 19:26
@pwhelan pwhelan temporarily deployed to pr July 12, 2023 19:49 — with GitHub Actions Inactive
@pwhelan pwhelan temporarily deployed to pr July 12, 2023 19:49 — with GitHub Actions Inactive
@pwhelan pwhelan temporarily deployed to pr July 12, 2023 19:49 — with GitHub Actions Inactive
@pwhelan pwhelan temporarily deployed to pr July 12, 2023 20:25 — with GitHub Actions Inactive
@pwhelan pwhelan temporarily deployed to pr July 12, 2023 20:51 — with GitHub Actions Inactive
@pwhelan pwhelan temporarily deployed to pr July 12, 2023 20:51 — with GitHub Actions Inactive
@pwhelan pwhelan temporarily deployed to pr July 12, 2023 20:51 — with GitHub Actions Inactive
@pwhelan pwhelan temporarily deployed to pr July 12, 2023 21:19 — with GitHub Actions Inactive
@pwhelan pwhelan force-pushed the feat-trace-cmdline branch from 9f25d96 to b5fa1bb Compare July 12, 2023 22:00
@pwhelan pwhelan temporarily deployed to pr July 12, 2023 22:00 — with GitHub Actions Inactive
@pwhelan pwhelan temporarily deployed to pr July 12, 2023 22:00 — with GitHub Actions Inactive
@pwhelan pwhelan temporarily deployed to pr July 12, 2023 22:00 — with GitHub Actions Inactive
@pwhelan pwhelan temporarily deployed to pr July 12, 2023 22:25 — with GitHub Actions Inactive
@pwhelan pwhelan requested a review from niedbalski as a code owner July 17, 2023 16:08
pwhelan added 4 commits July 17, 2023 12:08
Signed-off-by: Phillip Whelan <[email protected]>
Add new command line options to enable tracing from the start:

  * --trace: define a complete trace pipeline in a single line.
  * --trace-input: define the input to trace.
  * --trace-output: define the trace output.
  * --trace-output-property: define a trace output property.

Signed-off-by: Phillip Whelan <[email protected]>
Signed-off-by: Phillip Whelan <[email protected]>
  * free up memory used when parsing '--trace' option.
  * add flb_start_trace() which avoids setting the global
    fluent-bit context.

Signed-off-by: Phillip Whelan <[email protected]>
@pwhelan pwhelan force-pushed the feat-trace-cmdline branch from 79a7de0 to 5311fa8 Compare July 17, 2023 16:08
@pwhelan pwhelan temporarily deployed to pr July 17, 2023 16:08 — with GitHub Actions Inactive
@pwhelan pwhelan temporarily deployed to pr July 17, 2023 16:08 — with GitHub Actions Inactive
@pwhelan pwhelan temporarily deployed to pr July 17, 2023 16:08 — with GitHub Actions Inactive
@pwhelan
Copy link
Contributor Author

pwhelan commented Jul 17, 2023

Here is a valgrind log after the latest changes:

==31986== Memcheck, a memory error detector
==31986== Copyright (C) 2002-2022, and GNU GPL'd, by Julian Seward et al.
==31986== Using Valgrind-3.21.0 and LibVEX; rerun with -h for copyright info
==31986== Command: ./bin/fluent-bit -Z -i dummy -o stdout -m * -o exit -m * -p flush_count=5 -f 1 --trace=input=dummy.0\ output=null
==31986== Parent PID: 2603
==31986== 
==31986== 
==31986== HEAP SUMMARY:
==31986==     in use at exit: 0 bytes in 0 blocks
==31986==   total heap usage: 3,637 allocs, 3,637 frees, 4,916,409 bytes allocated
==31986== 
==31986== All heap blocks were freed -- no leaks are possible
==31986== 
==31986== For lists of detected and suppressed errors, rerun with: -s
==31986== ERROR SUMMARY: 0 errors from 0 contexts (suppressed: 0 from 0)

@pwhelan pwhelan temporarily deployed to pr July 17, 2023 16:31 — with GitHub Actions Inactive
@edsiper edsiper added this to the Fluent Bit v2.1.8 milestone Jul 19, 2023
@edsiper
Copy link
Member

edsiper commented Jul 20, 2023

@pwhelan do you have a PR for docs ?

@pwhelan
Copy link
Contributor Author

pwhelan commented Jul 20, 2023

do you have a PR for docs ?

@edsiper not yet, open one ASAP.

@edsiper edsiper merged commit 824ba3d into master Jul 21, 2023
@edsiper edsiper deleted the feat-trace-cmdline branch July 21, 2023 19:43
pwhelan added a commit to fluent/fluent-bit-docs that referenced this pull request Jul 21, 2023
Document the new trace command line options introduced by fluent/fluent-bit#6726.

Signed-off-by: Phillip Whelan <[email protected]>
ehienabs pushed a commit to fluent/fluent-bit-docs that referenced this pull request Jul 25, 2023
Document the new trace command line options introduced by fluent/fluent-bit#6726.

Signed-off-by: Phillip Whelan <[email protected]>
Wiston999 pushed a commit to Wiston999/fluent-bit that referenced this pull request Aug 7, 2023
…luent#6726)

Add new command line options to enable tracing from the start:

  * --trace: define a complete trace pipeline in a single line.
  * --trace-input: define the input to trace.
  * --trace-output: define the trace output.
  * --trace-output-property: define a trace output property.

Signed-off-by: Phillip Whelan <[email protected]>
leonardo-albertovich pushed a commit that referenced this pull request Oct 5, 2023
…6726)

Add new command line options to enable tracing from the start:

  * --trace: define a complete trace pipeline in a single line.
  * --trace-input: define the input to trace.
  * --trace-output: define the trace output.
  * --trace-output-property: define a trace output property.

Signed-off-by: Phillip Whelan <[email protected]>
TomlinfreeGit pushed a commit to TomlinfreeGit/fluent-bit-docs that referenced this pull request Oct 28, 2025
Document the new trace command line options introduced by fluent/fluent-bit#6726.

Signed-off-by: Phillip Whelan <[email protected]>
Signed-off-by: Tom <[email protected]>
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.

5 participants