An easier way to partial match metric attributes is needed for the metricdatatest assert functions #3435
Labels
area:metrics
Part of OpenTelemetry Metrics
enhancement
New feature or request
pkg:SDK
Related to an SDK package
pkg:testing
Related to testing or a testing package
Problem Statement
I'm always frustrated when I need to assert an incomplete set of attributes exist for a metric using the metricdatatest assert functions.
For example, I know all of my sums should contain the
attribute.String("statement", "INSERT")
attribute, but they will also contain an attribute describing the host. The host changes every test, therefore, I only want to assert the attribute set contains the known attribute and not fail because it also contains extra attributes.Proposed Solution
Add an option to support this
Alternatives
Define a new type in the
attribute
package that acts as a "minimal set" and when compared to aSet
it would do the desired comparison.The text was updated successfully, but these errors were encountered: