Labeled methods should always be recorded, even if they match trivial-method filters
Évaluation
Cette issue n'a pas encore été évaluée.
Description
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
- Langage dominant
- Java
- Étoiles
- 88
- Forks
- 17
- Merge moyen
- 2 j 2 h
- PR mergées (30 j)
- 1
Guide de contribution
Ouvrir le guide de contribution
Par où commencer
- Lisez l'issue en entier, puis le guide de contribution du projet.
- Signalez en commentaire que vous la prenez — cela évite que deux personnes fassent le même travail.
- Forkez le dépôt et travaillez sur une branche.
- Ouvrez une pull request qui référence le numéro de l'issue.
Autres issues de getappmap/appmap-java
-
Warning with Java 25 Ouverte
Difficulté 3/5 1-2 jours Accessibilité débutants 35/100
getappmap/appmap-java#322 ·
-
Difficulté 5/5 Plus d'une semaine Accessibilité débutants 35/100
getappmap/appmap-java#308 ·
-
Difficulté 5/5 Plus d'une semaine Accessibilité débutants 35/100
getappmap/appmap-java#305 ·
-
Difficulté 4/5 3-5 jours Accessibilité débutants 35/100
getappmap/appmap-java#304 ·
-
enhancement
Difficulté 3/5 1-2 jours Accessibilité débutants 35/100
getappmap/appmap-java#296 ·
Toutes les issues de getappmap/appmap-java
Issues similaires
-
Difficulté 2/5 1-3 heures Accessibilité débutants 78/100
-
Difficulté 2/5 1-3 heures Accessibilité débutants 76/100
-
bug needs triage
Difficulté 2/5 1-3 heures Accessibilité débutants 76/100
-
Difficulté 1/5 Moins d'une heure Accessibilité débutants 94/100
objectionary/hone-maven-plugin#1061 ·
-
Difficulté 2/5 1-3 heures Accessibilité débutants 76/100
spring-projects/spring-modulith#1895 ·