Add per-plugin workload counters#13278
Open
moonchen wants to merge 1 commit into
Open
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR adds per-plugin workload metrics to Apache Traffic Server so operators can attribute plugin activity to specific plugin DSOs (by basename), covering callback invocations as well as PluginVC intercept transport bytes/transfers. It also adds a gold test to validate that the new counters increment for both global and remap plugins.
Changes:
- Add
proxy.process.plugin.<name>.{invocations,bytes,transfers}counters and increment them from key dispatch / transport paths. - Introduce a
PluginThreadContextwrapper for global plugins so continuations they create carry plugin identity (similar to remap plugins). - Add a gold test that drives traffic through a global plugin, a remap plugin, and a PluginVC intercept plugin and asserts the counters are non-zero.
Reviewed changes
Copilot reviewed 9 out of 9 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| tests/gold_tests/pluginTest/per_plugin_metrics/rules/global.conf | Adds a header_rewrite rule to ensure global-plugin continuation dispatch occurs per transaction. |
| tests/gold_tests/pluginTest/per_plugin_metrics/per_plugin_metrics.test.py | New gold test validating per-plugin invocation/bytes/transfers metrics via traffic_ctl metric get. |
| src/proxy/PluginVC.cc | Increments per-plugin bytes/transfers counters for PluginVC intercept data movement and captures counters at core allocation time. |
| include/proxy/PluginVC.h | Stores per-plugin counter pointers in PluginVCCore for intercept accounting. |
| src/proxy/Plugin.cc | Wraps global plugin initialization in a PluginThreadContext so created continuations carry plugin identity. |
| src/proxy/http/remap/RemapPlugins.cc | Counts remap plugin invocations at the remap dispatch site. |
| include/proxy/http/remap/PluginDso.h | Adds metric registration/increment helpers and per-plugin counter pointers to PluginThreadContext. |
| src/proxy/http/remap/PluginDso.cc | Implements metric-name tokenization and registers per-plugin counters on successful plugin load. |
| src/api/InkContInternal.cc | Counts per-plugin invocations for TSCont (continuation) callback dispatches. |
Add per-plugin metrics that allow us to track how much work each plugin is doing
by counting their invocations, intercept bytes, and intercept transfers.
Add proxy.process.plugin.<name>.{invocations,bytes, transfers}, keyed by the
plugin DSO basename and bounded by the number of loaded plugins.
Global plugins load via raw dlopen and previously carried no identity, so they
are given a PluginThreadContext around TSPluginInit; the continuations they
create then carry plugin identity the same way remap plugins already do.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2d9c816 to
a36b73c
Compare
Contributor
Author
|
[approve ci] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Add per-plugin metrics that allow us to track how much work each plugin is doing by counting their invocations, intercept bytes, and intercept transfers.
Add proxy.process.plugin..{invocations,bytes, transfers}, keyed by the plugin DSO basename and bounded by the number of loaded plugins.
Global plugins load via raw dlopen and previously carried no identity, so they are given a PluginThreadContext around TSPluginInit; the continuations they create then carry plugin identity the same way remap plugins already do.