Skip to content

An easier way to ignore fields is needed for the metricdatatest assert functions #3434

@MrAlias

Description

@MrAlias

Problem Statement

The metricdatatest assert functions are great! However, I'm always frustrated when using them and I need to ignore a field. For example, I have real latency measured in a histogram and I cannot deterministically defined the expected buckets, sum, min, or max.

Similarly, I may only care about a sum value, but don't know the attributes they will have because that is done through other instrumentation.

Proposed Solution

Add an "Ignore" option i.e. https://pkg.go.dev/github.com/google/go-cmp/cmp#Ignore

Alternatives

  • Add an "IgnoreZeroValueFields" that allow you to skip any field that is zero value
  • Add an Ignore option that takes a generic type that will be ignored in its evaluation. It would work similar to the assert.IsType second param is evaluated and used.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    Status

    Done

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions