Skip to content

feat: Add APPMAP_DISPLAY_LABELED_PARAMS to capture params for labeled functions#384

Open
kgilpin wants to merge 2 commits intomasterfrom
feat/display-labeled-params
Open

feat: Add APPMAP_DISPLAY_LABELED_PARAMS to capture params for labeled functions#384
kgilpin wants to merge 2 commits intomasterfrom
feat/display-labeled-params

Conversation

@kgilpin
Copy link
Copy Markdown
Contributor

@kgilpin kgilpin commented Mar 31, 2026

Adds a new env var APPMAP_DISPLAY_LABELED_PARAMS (default: true) that enables str and 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.

… 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>
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

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 (default true) and threads it through initialization and Env.
  • 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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants