-
Notifications
You must be signed in to change notification settings - Fork 101
Description
A note for the community
Add flamegraph profiling capabilities to the vector vrl command to help users identify performance bottlenecks in their VRL (Vector Remap Language) scripts. This feature would generate interactive flame graphs showing function call hierarchies and execution time distribution, making it easier to optimise VRL transformations.
Motivation
VRL scripts can become complex and performance-critical in production Vector deployments. Currently, users have limited visibility into VRL performance characteristics and must rely on:
- Manual timing with
printstatements - High-level metrics from Vector's observability
- Trial-and-error optimisation approaches
- Please vote on this issue by adding a 👍 reaction to the original issue to help the community and maintainers prioritise this request
- If you are interested in working on this issue or have submitted a pull request, please leave a comment.
Use Cases
This proposal addresses the need for detailed, function-level performance profiling to help users:
- Identify hot paths in complex VRL scripts
- Optimise expensive operations like regex matching, parsing, or nested object manipulation
- Debug unexpected performance degradation when modifying existing scripts
- Validate performance improvements after optimisation attempts
Attempted Solutions
While flamegraphs are one solution, we could opt for a standardised output format and allow teams to use tools that they prefer, one such example could be pprof, although I am open to suggestion.
Proposal
New CLI Options
Add profiling flags to the existing vector vrl command:
# Generate flamegraph for a VRL script
vector vrl --flamegraph <output> -p script.vrl -i input.jsonThis could also be
# Generate profiling output for a VRL script
vector vrl --profiler <output> -p script.vrl -i input.jsonReferences
No response