Hacktoberfest 2026: le issue che i maintainer hanno segnato per ottobre, aperte e adatte ai principianti. Sfoglia le issue Hacktoberfest

valueMax reporting wrong number

Aperta
#2,806 8 commenti 0 reazioni 1 assegnatario Vedi su GitHub

@trask ci sta già lavorando.

Dal 23/1/2023.

Valutazione

Questa issue non è ancora stata valutata.

Descrizione

Needs: Attention :wave: Status: In PR
Expected behavior

I would expect valueMax to have a value less than valueSum.

Actual behavior

valueMax is greater than valueSum.

To Reproduce

This is my method that is called to gather metrics using micrometer:

@RequiredArgsConstructor
@Slf4j
public class TimeRecorder {
    private final static String METHOD = "method";
    private final static String CLASS = "class";
    private final MeterRegistry registry;

    public <T> T recorded(Supplier<T> supplier) {
        StackTraceElement[] stackTrace = Thread.currentThread().getStackTrace();

        if (stackTrace.length >= 3) {
            StackTraceElement stackTraceElement = stackTrace[2];

            return registry.timer("method.timing",
                            List.of(
                                    Tag.of(CLASS, stackTraceElement.getClassName()),
                                    Tag.of(METHOD, stackTraceElement.getMethodName())
                            ))
                    .record(supplier);
        } else {
            log.error("unable to determine callee, skipping metrics");
            return supplier.get();
        }
    }
}
System information

Please provide the following information:

  • SDK Version: applicationinsights-agent-3.4.6.jar
  • OS type and version: eclipse-temurin:17-jdk-alpine
  • Application Server type and version (if applicable):
  • Using spring-boot? Yes (version 2.7.1)
  • Additional relevant libraries (with version, if applicable): Micrometer 1.9.1
Logs

Turn on SDK logs and attach/paste them to the issue. If using an application server, also attach any relevant server logs.

Be sure to remove any private information from the logs before posting!

Screenshots

If applicable, add screenshots to help explain your problem.

Metric

Lingua principale
Java
Stelle
327
Fork
222
Merge medio
22h 34m
PR unite (30g)
14

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 microsoft/ApplicationInsights-Java

Tutte le issue di microsoft/ApplicationInsights-Java

Issue simili

Altre issue su Java

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.