valueMax reporting wrong number
@trask is already working on this.
Since Jan 23, 2023.
Assessment
This issue has not been assessed yet.
Description
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.

- Dominant language
- Java
- Stars
- 327
- Forks
- 222
- Avg merge
- 22h 34m
- Merged PRs (30d)
- 14
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from microsoft/ApplicationInsights-Java
-
microsoft/ApplicationInsights-Java#4851 · 1 assignee ·
-
Difficulty 4/5 3-5 days Newbie friendliness 45/100
microsoft/ApplicationInsights-Java#4817 · 1 comment ·
-
Difficulty 4/5 3-5 days Newbie friendliness 42/100
microsoft/ApplicationInsights-Java#4770 · 2 comments ·
-
Difficulty 5/5 Over a week Newbie friendliness 30/100
microsoft/ApplicationInsights-Java#4769 · 2 comments ·
-
Difficulty 4/5 3-5 days Newbie friendliness 35/100
microsoft/ApplicationInsights-Java#4729 · 121 comments ·
All issues in microsoft/ApplicationInsights-Java
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
elastic/gradle-plugins#157 ·
-
enhancement Tools
Difficulty 1/5 Under an hour Newbie friendliness 75/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 70/100
apache/rocketmq-dashboard#5008 ·
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
-
DETECT_PARAMETER_NAMES=false silently disables @ConstructorProperties-based Creator detection too Open
Difficulty 2/5 1-3 hours Newbie friendliness 70/100
FasterXML/jackson-databind#6229 ·