feat: Add APPMAP_DISPLAY_LABELED_PARAMS to capture params for labeled functions#384
Open
feat: Add APPMAP_DISPLAY_LABELED_PARAMS to capture params for labeled functions#384
Conversation
… functions Adds a new env var APPMAP_DISPLAY_LABELED_PARAMS (default: true) that enables repr()-based parameter and return value capture for functions that have labels, even when APPMAP_DISPLAY_PARAMS is off. This provides useful parameter visibility for semantically important functions (HTTP, crypto, serialization, etc.) without the performance cost of capturing all parameters globally. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
There was a problem hiding this comment.
Pull request overview
Adds a new configuration knob to selectively capture parameter/return-value details (via repr() and schema) for labeled functions even when global parameter capture is disabled, improving visibility for semantically important calls without enabling full parameter capture everywhere.
Changes:
- Introduces
APPMAP_DISPLAY_LABELED_PARAMS(defaulttrue) and threads it through initialization andEnv. - Propagates “has labels” metadata through instrumentation so event value rendering can decide whether to display details.
- Adds tests and test fixtures validating labeled vs unlabeled behavior under different env settings.
Reviewed changes
Copilot reviewed 7 out of 7 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
appmap/__init__.py |
Initializes _APPMAP_DISPLAY_LABELED_PARAMS from APPMAP_DISPLAY_LABELED_PARAMS (default true) when AppMap is enabled. |
_appmap/env.py |
Adds display_labeled_params to Env for runtime checks. |
_appmap/event.py |
Adds _should_display(has_labels) gating and plumbs has_labels into parameter/return value description logic. |
_appmap/instrument.py |
Detects whether the function has labels and forwards has_labels into param/return event creation. |
_appmap/test/conftest.py |
Ensures tests initialize _APPMAP_DISPLAY_LABELED_PARAMS for deterministic behavior. |
_appmap/test/test_events.py |
Adds coverage for labeled/unlabeled param/return display behavior under env combinations. |
_appmap/test/data/example_class.py |
Adds a labeled method that takes a parameter for exercising the new behavior in tests. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
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.
Adds a new env var
APPMAP_DISPLAY_LABELED_PARAMS (default: true)that enablesstrandrepr()-based parameter and return value capture for functions that have labels, even whenAPPMAP_DISPLAY_PARAMSis off. This provides useful parameter visibility for semantically important functions (HTTP, crypto, serialization, etc.) without the performance cost of capturing all parameters globally.