You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+25-1Lines changed: 25 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -6,6 +6,7 @@
6
6
Generate CloudWatch metrics embedded within structured log events. The embedded metrics will be extracted so that you can visualize and alarm on them for real-time incident detection. This allows you to monitor aggregated values while preserving the detailed log event context that generates them.
7
7
-[Use Cases](#use-cases)
8
8
-[Usage](#usage)
9
+
-[Graceful Shutdown](#graceful-shutdown)
9
10
-[API](#api)
10
11
-[Examples](#examples)
11
12
-[Development](#development)
@@ -25,7 +26,6 @@ Generate CloudWatch metrics embedded within structured log events. The embedded
25
26
26
27
To use a metric logger, you need to manually create and flush the logger.
You can find the artifact location and examples of how to include it in your project at [Maven Central](https://search.maven.org/artifact/software.amazon.cloudwatchlogs/aws-embedded-metrics)
46
46
47
+
## Graceful Shutdown
48
+
49
+
**Since:** 2.0.0-beta-1
50
+
51
+
In any environment, other than AWS Lambda, we recommend running an out-of-process agent (the CloudWatch Agent or
52
+
FireLens / Fluent-Bit) to collect the EMF events. When using an out-of-process agent, this package will buffer the data
53
+
asynchronously in process to handle any transient communication issues with the agent. This means that when the `MetricsLogger`
54
+
gets flushed, data may not be safely persisted yet. To gracefully shutdown the environment, you can call shutdown on the
55
+
environment's sink. A full example can be found in the [`examples`](examples) directory.
56
+
57
+
```java
58
+
// create an environment singleton, this should be re-used across loggers
0 commit comments