Labeled methods should always be recorded, even if they match trivial-method filters
評価
この issue はまだ評価されていません。
説明
Summary
Methods annotated with @Labels(...) from appmap-annotation are not recorded when the agent considers them "trivial" (e.g. simple getter/setter patterns like getFirstName() that just return a field). The agent's trivial-method filter takes precedence over the explicit label annotation.
Expected behavior
If a developer explicitly labels a method with @Labels(...), that method should always be recorded in the AppMap trace, regardless of whether it would otherwise be filtered out as trivial. The label annotation is a deliberate opt-in signal that the method is meaningful for analysis.
Observed behavior
Given a class like:
@Labels("secret")
public String getFirstName() {
return this.firstName;
}
The method does not appear in the recorded AppMap events or classMap. In contrast, a method with identical logic but a non-getter name is recorded:
@Labels("secret")
public String firstName() {
return this.firstName;
}
This was confirmed by comparing the recorded events across multiple test runs. Methods like getPet (which has a loop and conditional logic) are recorded normally — the filter appears to target methods based on complexity/pattern, not just the get prefix.
Workaround
Wrap the getter in a non-getter-named method and label that instead:
@Labels("secret")
public String firstName() {
return this.firstName;
}
public String getFirstName() {
return firstName();
}
This works but is awkward — it forces users to create redundant wrapper methods just to satisfy the agent's filter.
Environment
appmap-agent1.30.0appmap-annotation1.28.0- Java 23 (OpenJDK)
- Spring Boot 2.4.5
- 主要言語
- Java
- スター
- 88
- フォーク
- 17
- 平均マージ
- 2日 2時間
- マージ済み PR(30日)
- 1
環境構築
- Dockerfile・Docker Compose ファイルなし
- プルリクエストのテンプレートなし
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
getappmap/appmap-java のほかの issue
-
Warning with Java 25オープン
難易度 3/5 1〜2日 初心者へのやさしさ 35/100
getappmap/appmap-java#322 ·
-
難易度 5/5 1週間以上 初心者へのやさしさ 35/100
getappmap/appmap-java#308 ·
-
難易度 5/5 1週間以上 初心者へのやさしさ 35/100
getappmap/appmap-java#305 ·
-
難易度 4/5 3〜5日 初心者へのやさしさ 35/100
getappmap/appmap-java#304 ·
-
enhancement
難易度 3/5 1〜2日 初心者へのやさしさ 35/100
getappmap/appmap-java#296 ·
getappmap/appmap-java の issue をすべて見る
似ている issue
-
waiting-for-triage
難易度 1/5 1時間未満 初心者へのやさしさ 72/100
spring-cloud/spring-cloud-openfeign#1443 ·
メンテナーはふだん 1 日以内に返信
-
難易度 1/5 1〜3時間 初心者へのやさしさ 84/100
ADORSYS-GIS/keycloak-oid4vp-plugin#221 ·
メンテナーはふだん 2 日以内に返信
-
status: team-only type: dependency-upgrade
難易度 2/5 1〜3時間 初心者へのやさしさ 65/100
spring-projects/spring-boot#52099 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 67/100
tchiotludo/akhq#3307 · リアクション 1 件 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 75/100
objectionary/jeo-maven-plugin#1885 ·
メンテナーはふだん 4 日以内に返信