The Concurrency requirements for Metric API currently state
All methods of any Instrument are safe to be called concurrently.
My expectations after reading this sentence was that if I obtain an instrument in a particular language implementation, it should be safe to calls its methods concurrently. The particular use case I had was calling Int64Counter.Add() method in Go.
The docs for Int64Counter.Add() do not specify whether it is safe to call concurrently, so I asked @MrAlias for clarification.
His opinion on the spec requirement is different from what I expected. He believes the API requirement I linked to is non normative and doesn't apply to SDK anyway since it is about the API. (@MrAlias please correct me if I misinterpreted your opinion).
I would like to have a discussion and make clarification in the spec about what we expect from this requirement section.
My opinion is the following:
- The listed requirement is part of the spec. We may want to reword to make it normative to avoid confusion.
- My reading of that sentence is that you can call the Instrument APIs concurrently regardless of what implementation (what SDK) the API is plugged into.
- The SDK inherits all requirements of the API that it implements. If the API defines concurrency guarantees the SDK is expected to implement it in a compliant way. This API requirement by proxy sets concurrency requirements on Instrument implementations in SDKs.
I am looking for an input from spec maintainers/approvers.
The Concurrency requirements for Metric API currently state
My expectations after reading this sentence was that if I obtain an instrument in a particular language implementation, it should be safe to calls its methods concurrently. The particular use case I had was calling Int64Counter.Add() method in Go.
The docs for Int64Counter.Add() do not specify whether it is safe to call concurrently, so I asked @MrAlias for clarification.
His opinion on the spec requirement is different from what I expected. He believes the API requirement I linked to is non normative and doesn't apply to SDK anyway since it is about the API. (@MrAlias please correct me if I misinterpreted your opinion).
I would like to have a discussion and make clarification in the spec about what we expect from this requirement section.
My opinion is the following:
I am looking for an input from spec maintainers/approvers.