-
Notifications
You must be signed in to change notification settings - Fork 50
Open
Labels
enhancementNew feature or requestNew feature or request
Description
Requirements
I would like to improve the telemetry package:
- Omit the value from the returned attributes. The value is of type
anyand this results in the loss of type safety (use ofmap[string]any). Instead, by omitting the value, the attributes map can be of typemap[string]string, which is much easier to work with. The value is otherwise very easy to obtain viadetails.Valueanyways. - The "Name" of the evaluation event should not be returned. Instead, since that is already a const in the package, users can just use that const wherever it is needed. Ideally, this event name const
feature_flag.evaluationshould eventually make its way into the OTel semconv (as a const). Currently it is in the spec but not in the semconv package. - Refactor the
CreateEvaluationEventfunction to make it work for ALL stages of a hook, rather than justafterandfinally. To do that, we could modify thedetails openfeature.InterfaceEvaluationDetailsparameter to be a pointer so that a nil check can be performed before adding additional attributes derived from the details. This allows the package to be a bit more useful. This is not a huge deal though, given that there are only two attributes in the hookContext.
I think the goal should be for this package to be used in both the existing logging hook and the OTel hook in go-sdk-contrib.
Related issue: #393
aepfli
Metadata
Metadata
Assignees
Labels
enhancementNew feature or requestNew feature or request