Is your feature request related to a problem? Please describe.
The Analytcis interface is quite constrained in its functionality. For example, if I wanted to count multiple times, I'd have to either call Count(...) in a loop (without concern for spamming the span table) OR try and set my value within properties.Properties as a label/attribute, unnecessarily increasing cardinality.
Describe the solution you'd like
Extend the offering of the analytics package and associated Analytics interface to instead accept more types and options for recording of metrics/data/analytics.
i.e
// could make a private Property interface to ensure whatever props we pass in are valid i.e
type Property interface {
private()
}
type Properties map[string]interface{}
func (Properties) private() {}
type Increment int
func (Increment) private() {}
type Analytics interface {
// ...
Count(ctx context.Context, resource Resource, action Action, props ...Property)
// ...
}
Then we can increment this like:
oc.a.Count(ctx, analytics.OtelSpan, analytics.Create, analytics.Increment(len(spans)))
Describe alternatives you've considered
None that don't either require extending the interface or introducing some breaking changes.
Additional context
Follow-up from discussion in #3375 (comment)
Is your feature request related to a problem? Please describe.
The Analytcis interface is quite constrained in its functionality. For example, if I wanted to count multiple times, I'd have to either call
Count(...)in a loop (without concern for spamming the span table) OR try and set my value withinproperties.Propertiesas a label/attribute, unnecessarily increasing cardinality.Describe the solution you'd like
Extend the offering of the
analyticspackage and associatedAnalyticsinterface to instead accept more types and options for recording of metrics/data/analytics.i.e
Then we can increment this like:
Describe alternatives you've considered
None that don't either require extending the interface or introducing some breaking changes.
Additional context
Follow-up from discussion in #3375 (comment)