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 小時
- 30 天內合併 PR
- 1
環境準備
- 沒有 Dockerfile 或 Docker Compose 檔案
- 沒有 Pull Request 範本
- 閱讀貢獻指南
從這裡開始
- 先讀完整個 Issue,再讀專案的貢獻指南。
- 在 Issue 下留言說明你要接手 —— 這能避免兩個人做同樣的事。
- Fork 儲存庫,在一個分支上完成修改。
- 送出 Pull Request,並在描述裡引用這個 Issue 編號。
getappmap/appmap-java 的其他 Issue
-
難度 3/5 1-2 天 新手友好度 35/100
getappmap/appmap-java#322 ·
-
難度 5/5 一週以上 新手友好度 35/100
getappmap/appmap-java#308 ·
-
難度 5/5 一週以上 新手友好度 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
-
enhancement
難度 2/5 1-3 小時 新手友好度 85/100
維護者通常 1 天內回覆
-
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 個 reaction ·
維護者通常 1 天內回覆