You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This seems to be a common approach in other Go code, and is a stated reason many types use int instead of uint.
Recognized issues with approach
The environment variable values are invalid if negative and would need to be translated. Given invalid values would be treated as unset values and use the default, this does not pose a real issue.
This will be a change in current behavior. This behavior, using default values if negative, is undocumented. Changing and documenting the new approach will not change the API.
This would not be the same as infinite as there would be no way to determine if "no limit" should be applied or the maximal limit. This would be a rare situation.
This would be a unique way to define infinite. I do not know any other code that does this.
The text was updated successfully, but these errors were encountered:
If we were to support accepting these values, using the WithSpanLimits option to pass partial SpanLimits would be problematic. The unset values would default to 0, now a valid value. It seems like adding a func DefaultSpanLimits() SpanLimits function that returns a SpanLimits struct with the defaults already applied to all fields would be useful.
The environment variable values are invalid if negative and would need to be translated. Given invalid values would be treated as unset values and use the default, this does not pose a real issue.
I'm not sure I follow here. Are values received from environment variables not strings that would need to be converted to integers with strconv.Atoi()? That should handle negative values just fine.
I'm not sure I follow here. Are values received from environment variables not strings that would need to be converted to integers with strconv.Atoi()? That should handle negative values just fine.
Right, but the specification considers negative values for environment variables as invalid.
Span limit value can be "unlimited". This concept is not currently supported in the
SpanLimit
sopentelemetry-go/sdk/trace/config.go
Lines 35 to 51 in 065ba75
Proposal
Accept negative values as being infinite.
This seems to be a common approach in other Go code, and is a stated reason many types use
int
instead ofuint
.Recognized issues with approach
Alternatives
Use
math.MaxInt
.The text was updated successfully, but these errors were encountered: