Skip to content

Commit 7e39f65

Browse files
committed
Add a Shutdown() method to *Provider
1 parent 2ebefc1 commit 7e39f65

File tree

2 files changed

+11
-2
lines changed

2 files changed

+11
-2
lines changed

specification/metrics/api.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -358,6 +358,12 @@ other libraries. The name of the `Meter` is explicitly not intended
358358
to be used as part of the instrument name, as that would prevent
359359
instrumentation libraries from capturing metrics by the same name.
360360

361+
### Shutdown
362+
363+
Exporting pending metrics.
364+
365+
The `Shutdown` API MAY be implemented by invoking `Shutdown` within internal processors.
366+
361367
### Global Meter provider
362368

363369
Use of a global instance may be seen as an anti-pattern in many

specification/trace/api.md

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -91,11 +91,12 @@ number of `TracerProvider` instances.
9191

9292
### TracerProvider operations
9393

94-
The `TracerProvider` MUST provide functions to:
94+
The `TracerProvider` MUST provide the following functions:
9595

9696
- Get a `Tracer`
97+
- Shutdown the provider (exporting pending spans)
9798

98-
That API MUST accept the following parameters:
99+
That `Tracer()` API MUST accept the following parameters:
99100

100101
- `name` (required): This name must identify the [instrumentation library](../overview.md#instrumentation-libraries)
101102
(e.g. `io.opentelemetry.contrib.mongodb`) and *not* the instrumented library.
@@ -125,6 +126,8 @@ the tracer could, for example, do a look-up with its name+version in a map in
125126
the `TracerProvider`, or the `TracerProvider` could maintain a registry of all
126127
returned `Tracer`s and actively update their configuration if it changes.
127128

129+
The `Shutdown` API MAY be implemented by invoking `Shutdown` within internal processors.
130+
128131
## Tracing Context Utilities
129132

130133
`Tracing Context Utilities` contains all operations within tracing that

0 commit comments

Comments
 (0)