From 92747e9dfc096396e7121298f780eac5e9ec1da9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Robert=20Paj=C4=85k?= Date: Tue, 15 Oct 2024 21:01:53 +0200 Subject: [PATCH] Add Context parameter to Enabled for synchronous metrics instruments Fixes https://github.com/open-telemetry/opentelemetry-specification/issues/4256 --- specification/metrics/api.md | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/specification/metrics/api.md b/specification/metrics/api.md index d258e6168d5..cc99583193e 100644 --- a/specification/metrics/api.md +++ b/specification/metrics/api.md @@ -483,9 +483,12 @@ To help users avoid performing computationally expensive operations when recording measurements, [synchronous Instruments](#synchronous-instrument-api) SHOULD provide this `Enabled` API. -There are currently no required parameters for this API. Parameters can be -added in the future, therefore, the API MUST be structured in a way for -parameters to be added. +The API SHOULD accept the following parameters: + +- The [Context](../context/README.md) to be associated with the measurement. + When implicit Context is supported, then this parameter SHOULD be optional and + if unspecified then MUST use current Context. + When only explicit Context is supported, accepting this parameter is REQUIRED. This API MUST return a language idiomatic boolean type. A returned value of `true` means the instrument is enabled for the provided arguments, and a returned