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
贡献指南
从这里开始
- 先读完整个 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
-
难度 2/5 1-3 小时 新手友好度 78/100
-
难度 2/5 1-3 小时 新手友好度 76/100
-
bug needs triage
难度 2/5 1-3 小时 新手友好度 76/100
-
难度 1/5 1 小时以内 新手友好度 94/100
objectionary/hone-maven-plugin#1061 ·
-
难度 2/5 1-3 小时 新手友好度 76/100
spring-projects/spring-modulith#1895 ·