-
Notifications
You must be signed in to change notification settings - Fork 162
feat: add platform-wide NUMAFLOW_LOG_LEVEL support
#3410
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Draft
adarsh0728
wants to merge
2
commits into
main
Choose a base branch
from
feat/numaflow-log-level-env
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Draft
Changes from all commits
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
10 changes: 9 additions & 1 deletion
10
docs/user-guide/reference/configuration/environment-variables.md
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,185 @@ | ||
| # Log Levels | ||
|
|
||
| Numaflow-owned pods use `NUMAFLOW_LOG_LEVEL` as the standard log-level control. Data-plane pods also support `RUST_LOG` for advanced filtering. | ||
|
|
||
| ## Quick reference | ||
|
|
||
| | Pod / container | Standard log-level env var | Default level | | ||
| |---|---|---| | ||
| | Pipeline daemon | `NUMAFLOW_LOG_LEVEL` | `info` | | ||
| | MonoVertex daemon | `NUMAFLOW_LOG_LEVEL` | `info` | | ||
| | ISB svc create / delete job | `NUMAFLOW_LOG_LEVEL` | `info` | | ||
| | ISB svc validate (init container) | `NUMAFLOW_LOG_LEVEL` | `info` | | ||
| | Controller (`numaflow-controller`) | `NUMAFLOW_LOG_LEVEL` | `info` | | ||
| | Webhook (`numaflow-webhook`) | `NUMAFLOW_LOG_LEVEL` | `info` | | ||
| | UX server (`numaflow-server`) | `NUMAFLOW_LOG_LEVEL` | `info` | | ||
| | Pipeline vertex `numa` container | `NUMAFLOW_LOG_LEVEL` | `info` | | ||
| | MonoVertex `numa` container | `NUMAFLOW_LOG_LEVEL` | `info` | | ||
| | Serving pod | `NUMAFLOW_LOG_LEVEL` | `info` | | ||
| | InterStepBufferService (JetStream / Redis) | n/a | n/a | | ||
|
|
||
| `NUMAFLOW_DEBUG=true` is also supported as a development shortcut (see [below](#numaflow_debug-interaction)). | ||
|
|
||
| --- | ||
|
|
||
| ## Standard log levels — `NUMAFLOW_LOG_LEVEL` | ||
|
|
||
| Numaflow-owned components read `NUMAFLOW_LOG_LEVEL` at startup. | ||
|
|
||
| **Accepted values:** `debug`, `info`, `warn`, `error`. | ||
|
|
||
| **Default:** `info` | ||
|
|
||
| **Precedence:** `NUMAFLOW_LOG_LEVEL` overrides the level implied by `NUMAFLOW_DEBUG`. Invalid values fall back to the level selected by `NUMAFLOW_DEBUG` or the default. For data-plane pods, `RUST_LOG` takes precedence over `NUMAFLOW_LOG_LEVEL` when set. | ||
|
|
||
| ### Pipeline daemon pod | ||
|
|
||
| ```yaml | ||
| apiVersion: numaflow.numaproj.io/v1alpha1 | ||
| kind: Pipeline | ||
| spec: | ||
| templates: | ||
| daemon: | ||
| containerTemplate: | ||
| env: | ||
| - name: NUMAFLOW_LOG_LEVEL | ||
| value: warn | ||
| ``` | ||
|
|
||
| ### MonoVertex daemon pod | ||
|
|
||
| ```yaml | ||
| apiVersion: numaflow.numaproj.io/v1alpha1 | ||
| kind: MonoVertex | ||
| spec: | ||
| daemonTemplate: | ||
| containerTemplate: | ||
| env: | ||
| - name: NUMAFLOW_LOG_LEVEL | ||
| value: warn | ||
| ``` | ||
|
|
||
| ### Controller, webhook, and UX server | ||
|
|
||
| These are cluster-level components deployed via the install manifests. Set `NUMAFLOW_LOG_LEVEL` directly on the relevant Deployment: | ||
|
|
||
| ```yaml | ||
| # numaflow-controller Deployment | ||
| env: | ||
| - name: NUMAFLOW_LOG_LEVEL | ||
| value: warn | ||
| ``` | ||
|
|
||
| ### ISB service jobs | ||
|
|
||
| Init and finalizer jobs for pipeline ISB creation/deletion/validation: | ||
|
|
||
| ```yaml | ||
| apiVersion: numaflow.numaproj.io/v1alpha1 | ||
| kind: Pipeline | ||
| spec: | ||
| templates: | ||
| job: | ||
| containerTemplate: | ||
| env: | ||
| - name: NUMAFLOW_LOG_LEVEL | ||
| value: warn | ||
| ``` | ||
|
|
||
| --- | ||
|
|
||
| ## Pipeline, MonoVertex, and Serving pods | ||
|
|
||
| Pipeline vertex pods, MonoVertex pods, and Serving pods use `NUMAFLOW_LOG_LEVEL` for common log-level cases: | ||
|
|
||
| **Accepted values:** `debug`, `info`, `warn`, `error`. | ||
|
|
||
| **Default:** `info` | ||
|
|
||
| ### Pipeline vertex pod | ||
|
|
||
| ```yaml | ||
| apiVersion: numaflow.numaproj.io/v1alpha1 | ||
| kind: Pipeline | ||
| spec: | ||
| vertices: | ||
| - name: my-vertex | ||
| containerTemplate: | ||
| env: | ||
| - name: NUMAFLOW_LOG_LEVEL | ||
| value: warn | ||
| ``` | ||
|
|
||
| ### MonoVertex pod | ||
|
|
||
| ```yaml | ||
| apiVersion: numaflow.numaproj.io/v1alpha1 | ||
| kind: MonoVertex | ||
| spec: | ||
| containerTemplate: | ||
| env: | ||
| - name: NUMAFLOW_LOG_LEVEL | ||
| value: warn | ||
| ``` | ||
|
|
||
| ### Serving pod | ||
|
|
||
| ```yaml | ||
| apiVersion: numaflow.numaproj.io/v1alpha1 | ||
| kind: ServingPipeline | ||
| spec: | ||
| serving: | ||
| containerTemplate: | ||
| env: | ||
| - name: NUMAFLOW_LOG_LEVEL | ||
| value: warn | ||
| ``` | ||
|
|
||
| ### Advanced data-plane filtering — `RUST_LOG` | ||
|
|
||
| Data-plane pods also support standard [`tracing-subscriber` EnvFilter syntax](https://docs.rs/tracing-subscriber/latest/tracing_subscriber/filter/struct.EnvFilter.html) via `RUST_LOG`. Use this only when you need fine-grained filtering. When `RUST_LOG` is set, it takes precedence over `NUMAFLOW_LOG_LEVEL`. | ||
|
|
||
| For example, to enable debug logs for a specific target only: | ||
|
|
||
| ```yaml | ||
| # Pipeline.spec.vertices[].containerTemplate.env | ||
| - name: RUST_LOG | ||
| value: "numaflow_core=debug,info" | ||
| ``` | ||
|
|
||
| --- | ||
|
|
||
| ## `NUMAFLOW_DEBUG` interaction | ||
|
|
||
| `NUMAFLOW_DEBUG=true` is a development shortcut. It lowers the default log level to `debug` and may switch log output from structured JSON to human-readable text. | ||
|
|
||
| **Important:** switching from JSON to text format may break log shippers or aggregators that expect structured JSON. Prefer `NUMAFLOW_LOG_LEVEL=debug` to lower the level without changing the output format. | ||
|
|
||
| `NUMAFLOW_LOG_LEVEL` overrides the level implied by `NUMAFLOW_DEBUG` without changing the format selected by `NUMAFLOW_DEBUG`. For data-plane pods, `RUST_LOG` takes precedence over `NUMAFLOW_LOG_LEVEL` when set. | ||
|
|
||
| --- | ||
|
|
||
| ## Common recipes | ||
|
|
||
| **Suppress idle-rater info noise on a MonoVertex daemon:** | ||
| ```yaml | ||
| # MonoVertex.spec.daemonTemplate.containerTemplate.env | ||
| - name: NUMAFLOW_LOG_LEVEL | ||
| value: warn | ||
| ``` | ||
|
|
||
| **Enable debug for a single data-plane target without flooding all logs:** | ||
| ```yaml | ||
| # Pipeline.spec.vertices[].containerTemplate.env | ||
| - name: RUST_LOG | ||
| value: "numaflow_core=debug,info" | ||
| ``` | ||
|
|
||
| **Enable full debug on a vertex pod:** | ||
| ```yaml | ||
| # Pipeline.spec.vertices[].containerTemplate.env | ||
| - name: NUMAFLOW_DEBUG | ||
| value: "true" | ||
| # Note: this also switches log output from JSON to text. | ||
| # To keep JSON format while lowering the level, use NUMAFLOW_LOG_LEVEL=debug instead. | ||
| ``` | ||
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
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
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
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
Oops, something went wrong.
Oops, something went wrong.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we should just use
DAEMON_LOG_LEVELand notNUMAFLOW_LOG_LEVELThere was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should we explicitly mention
CONTROLLER_LOG_LEVEL(daemon, controller etc) andDATAPLANE_LOG_LEVEL(should work likeRUST_LOG)There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think a single variable would be better, like NUMAFLOW_LOG_LEVEL.
We won't need to use DAEMON_LOG and NUMAFLOW_LOG at the same time for a single container anyway right?
Even if there is a situation like this, what do you think about treating them like components/modules and use Rust's log/tracing syntax:
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
makes sense, lets go with one single log level env.