Commit 75af98a
authored
Added ForceFlush Implementation (#272)
### Description:
Passed the force_flush function from MeteringProvider to the
AwsSpanMetricProcessor to forceFlush remaining metrics on shutdown to
the cwAgent/Collector. Compared to java/dotnet, looks like python
already flushes all the metrics and traces on shutdown even without the
force flush implementation. I'm adding it tho for consistency with other
languages.
### Tesing:
Increased the metricExporter interval and the BatchSpanProcessor delay
to 10 minutes using:
```
OTEL_METRIC_EXPORT_INTERVAL=600000 \
OTEL_BSP_SCHEDULE_DELAY=600000 \
```
With and without the force flush implementation, exiting the [sample
app](https://github.com/aws-observability/aws-otel-python-instrumentation/blob/main/sample-applications/simple-client-server/server_automatic_s3client.py)
flushed both the traces and the metrics to the collector.
By submitting this pull request, I confirm that my contribution is made
under the terms of the Apache 2.0 license.1 parent 4f36d47 commit 75af98a
File tree
2 files changed
+19
-4
lines changed- aws-opentelemetry-distro/src/amazon/opentelemetry/distro
2 files changed
+19
-4
lines changedLines changed: 13 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | | - | |
| 3 | + | |
4 | 4 | | |
5 | 5 | | |
6 | 6 | | |
| |||
45 | 45 | | |
46 | 46 | | |
47 | 47 | | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
48 | 56 | | |
49 | 57 | | |
50 | 58 | | |
51 | 59 | | |
52 | 60 | | |
53 | 61 | | |
54 | 62 | | |
| 63 | + | |
55 | 64 | | |
56 | 65 | | |
57 | 66 | | |
58 | 67 | | |
59 | 68 | | |
60 | 69 | | |
| 70 | + | |
61 | 71 | | |
62 | 72 | | |
63 | 73 | | |
| |||
78 | 88 | | |
79 | 89 | | |
80 | 90 | | |
81 | | - | |
82 | | - | |
| 91 | + | |
| 92 | + | |
83 | 93 | | |
84 | 94 | | |
85 | 95 | | |
| |||
Lines changed: 6 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
63 | 63 | | |
64 | 64 | | |
65 | 65 | | |
66 | | - | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
67 | 72 | | |
0 commit comments