Skip to content

Flush metrics on shutdown#1658

Merged
felixbarny merged 5 commits intoelastic:masterfrom
felixbarny:flush-metrics-on-shutdown
Feb 15, 2021
Merged

Flush metrics on shutdown#1658
felixbarny merged 5 commits intoelastic:masterfrom
felixbarny:flush-metrics-on-shutdown

Conversation

@felixbarny
Copy link
Member

@felixbarny felixbarny commented Feb 11, 2021

This is especially important for counters as the counts that were accumulated between the last report and the shutdown would otherwise get lost.

What does this PR do?

Checklist

  • This is an enhancement of existing features, or a new feature in existing plugins
    • I have updated CHANGELOG.asciidoc
    • I have added tests that prove my fix is effective or that my feature works
    • Added an API method or config option? Document in which version this will be introduced
    • I have made corresponding changes to the documentation
  • This is a bugfix
  • This is a new plugin
    • I have updated CHANGELOG.asciidoc
    • My code follows the style guidelines of this project
    • I have made corresponding changes to the documentation
    • I have added tests that prove my fix is effective or that my feature works
    • New and existing unit tests pass locally with my changes
    • I have updated supported-technologies.asciidoc
    • Added an API method or config option? Document in which version this will be introduced
    • Added an instrumentation plugin? Describe how you made sure that old, non-supported versions are not instrumented by accident.
  • This is something else
this is especially important for counters as the counts that were accumulated between the last report and the shutdown would otherwise get lost
@ghost
Copy link

ghost commented Feb 11, 2021

💚 Build Succeeded

the below badges are clickable and redirect to their specific view in the CI or DOCS
Pipeline View Test View Changes Artifacts preview

Expand to view the summary

Build stats

  • Build Cause: Started by user Felix Barnsteiner

  • Start Time: 2021-02-15T12:36:30.438+0000

  • Duration: 41 min 55 sec

  • Commit: f1b3b61

Test stats 🧪

Test Results
Failed 0
Passed 1817
Skipped 14
Total 1831

Trends 🧪

Image of Build Times

Image of Tests

💚 Flaky test report

Tests succeeded.

Expand to view the summary

Test stats 🧪

Test Results
Failed 0
Passed 1817
Skipped 14
Total 1831

@codecov-io
Copy link

codecov-io commented Feb 11, 2021

Codecov Report

Merging #1658 (f1b3b61) into master (7205a17) will decrease coverage by 0.00%.
The diff coverage is 69.56%.

Impacted file tree graph

@@             Coverage Diff              @@
##             master    #1658      +/-   ##
============================================
- Coverage     58.93%   58.92%   -0.01%     
- Complexity       92     2802    +2710     
============================================
  Files           404      403       -1     
  Lines         18441    18447       +6     
  Branches       2562     2564       +2     
============================================
+ Hits          10868    10870       +2     
- Misses         6801     6806       +5     
+ Partials        772      771       -1     
Impacted Files Coverage Δ Complexity Δ
.../java/co/elastic/apm/agent/util/ExecutorUtils.java 72.15% <0.00%> (+1.09%) 9.00 <0.00> (+9.00)
...va/co/elastic/apm/agent/impl/ElasticApmTracer.java 66.66% <83.33%> (+0.41%) 83.00 <4.00> (+83.00)
...agent/report/serialize/MetricRegistryReporter.java 94.11% <100.00%> (+7.45%) 6.00 <1.00> (+6.00)
...pm/agent/micrometer/MicrometerMetricsReporter.java 88.63% <100.00%> (+0.83%) 0.00 <0.00> (ø)
...o/elastic/apm/agent/profiler/SamplingProfiler.java 72.81% <100.00%> (-0.48%) 0.00 <0.00> (ø)
...ic/apm/agent/profiler/collections/LongHashSet.java 17.06% <0.00%> (-2.39%) 0.00% <0.00%> (ø%)
...ent/report/serialize/MetricRegistrySerializer.java 90.08% <0.00%> (+2.47%) 32.00% <0.00%> (+32.00%)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 7205a17...f1b3b61. Read the comment docs.

@felixbarny felixbarny added this to the 7.12 milestone Feb 11, 2021
Thread.currentThread().interrupt();
}
}
}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

😍 Let's do that by the book, or rather by-the-javadoc !

@felixbarny felixbarny merged commit a7e1c25 into elastic:master Feb 15, 2021
@felixbarny felixbarny deleted the flush-metrics-on-shutdown branch February 15, 2021 13:28
beniwohli added a commit to beniwohli/apm that referenced this pull request May 26, 2021
Due to the somewhat lengthy default metrics collection interval of 30s,
it is quite possible to lose significant amounts of metrics data if
no effort is made to flush them before shutdown.

See elastic/apm-agent-java#1658 for the implementation
in the Java agent.
felixbarny pushed a commit to elastic/apm that referenced this pull request Jun 16, 2021
Due to the somewhat lengthy default metrics collection interval of 30s,
it is quite possible to lose significant amounts of metrics data if
no effort is made to flush them before shutdown.

See elastic/apm-agent-java#1658 for the implementation
in the Java agent.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

3 participants