Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Normatively define synchronous instrument record/add parameters #3082

Merged
merged 11 commits into from
Jan 30, 2023
30 changes: 21 additions & 9 deletions specification/metrics/api.md
Original file line number Diff line number Diff line change
Expand Up @@ -467,10 +467,14 @@ Increment the Counter by a fixed amount.
This API SHOULD NOT return a value (it MAY return a dummy value if required by
certain programming languages or systems, for example `null`, `undefined`).

Required parameters:
This API MUST accept the following parameter:

* Optional [attributes](../common/README.md#attribute).
* The increment amount, which MUST be a non-negative numeric value.
* The numeric increment value. This value is expected to be non-negative. The
MrAlias marked this conversation as resolved.
Show resolved Hide resolved
API MUST NOT validate this value, that is left to the API implementation.
MrAlias marked this conversation as resolved.
Show resolved Hide resolved

Additionally, this API MAY accept the following parameters:
MrAlias marked this conversation as resolved.
Show resolved Hide resolved

* The [attributes](../common/README.md#attribute) to associate with the value.

The [OpenTelemetry API](../overview.md#api) authors MAY decide to allow flexible
[attributes](../common/README.md#attribute) to be passed in as arguments. If
Expand Down Expand Up @@ -688,10 +692,15 @@ Updates the statistics with the specified amount.
This API SHOULD NOT return a value (it MAY return a dummy value if required by
certain programming languages or systems, for example `null`, `undefined`).

Parameters:
This API MUST accept the following parameter:

* The `Measurement` value. This value is expected to be non-negative. The API
MUST NOT validate this value, that is left to the API implementation.
MrAlias marked this conversation as resolved.
Show resolved Hide resolved

* The amount of the `Measurement`, which MUST be a non-negative numeric value.
* Optional [attributes](../common/README.md#attribute).
Additionally, this API MAY accept the following parameters:
MrAlias marked this conversation as resolved.
Show resolved Hide resolved

* The [attributes](../common/README.md#attribute) to associate with the
`Measurement` value.

[OpenTelemetry API](../overview.md#api) authors MAY decide to allow flexible
[attributes](../common/README.md#attribute) to be passed in as individual
Expand Down Expand Up @@ -922,10 +931,13 @@ Increment or decrement the UpDownCounter by a fixed amount.
This API SHOULD NOT return a value (it MAY return a dummy value if required by
certain programming languages or systems, for example `null`, `undefined`).

Parameters:
This API MUST accept the following parameter:

* The numeric value to be added. This value can be positive, negative or zero.
MrAlias marked this conversation as resolved.
Show resolved Hide resolved

Additionally, this API MAY accept the following parameters:
MrAlias marked this conversation as resolved.
Show resolved Hide resolved

* The amount to be added, can be positive, negative or zero.
* Optional [attributes](../common/README.md#attribute).
* The [attributes](../common/README.md#attribute) to associate with the value.

[OpenTelemetry API](../overview.md#api) authors MAY decide to allow flexible
[attributes](../common/README.md#attribute) to be passed in as individual
Expand Down