Labeled methods should always be recorded, even if they match trivial-method filters

Aperta
#323 0 commenti 1 reazione 2 assegnatari Vedi su GitHub

@kgilpin ci sta già lavorando.

Dal 1/4/2026.

  • #324 di @copilot-swe-agent — aperta

Valutazione

Questa issue non è ancora stata valutata.

Descrizione

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-agent 1.30.0
  • appmap-annotation 1.28.0
  • Java 23 (OpenJDK)
  • Spring Boot 2.4.5
Lingua principale
Java
Stelle
88
Fork
17
Merge medio
2g 2h
PR unite (30g)
1

Guida per i contributori

Apri la guida per i contributori

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di getappmap/appmap-java

Tutte le issue di getappmap/appmap-java

Issue simili

Altre issue su Java

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.