-
Notifications
You must be signed in to change notification settings - Fork 894
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
Clarify MetricProducer "Produce() does not have any required parameters" #3601
Comments
It is the former: |
Another point here, we have this requirement opentelemetry-specification/specification/metrics/sdk.md Lines 1398 to 1400 in 8ae0f6f
I take that as the Produce function must accept the Resource in this case. I think at least that requirement should be moved into the |
The original intent was that Resource would be passed once when the MetricProducer is constructed, and then used to set the resource returned by all Produce() calls. We can make it more flexible if there is a design you think works better for JS. |
|
That is correct. It is technically a requirement for the bridges.
I think the spec is silent on the SDK's behavior if it gets a resource from the bridge. I think the latter is acceptable. We initially had more specific language saying that the MetricReader MUST override the resource from a producer with its own, but decided to drop it to leave that open to SDK authors. |
Ok, so if I implement the SDK to drop the resource from a bridge, then
seems unnecessary since I'll just throw it away. Maybe we can switch this to a SHOULD? Also sorry I think we have gotten off topic here. I can open a separate issue if you agree David |
I agree it should be SHOULD. Feel free to open a separate issue. |
What are you trying to achieve?
The MetricProducer spec indicates the following for the
Produce()
method:It is unclear whether this means that SDK authors may add required parameters, or if
Produce()
must not have any required parameters.If the former, it should be clarified that "authors MAY choose to add required or optional parameters" (or something similar).
If the latter, it should be clarified that "authors MAY choose to add optional parameters".
This question arose in the Go metrics sdk for MetricProducer: open-telemetry/opentelemetry-go#3668. The
Produce()
function in Go has a requiredcontext.Context
parameter.Ref #3599
The text was updated successfully, but these errors were encountered: