Skip to content

Possibility to add optional labels #317

@andrikaro

Description

@andrikaro

Is your feature request related to a problem? Please describe.

While writing and testing collectors I discovered that when query returns null for a field that is defined under key_labels the query fails and no value is pulled even if it exists.

Describe the solution you'd like

As all of the labels are not strictly required I wonder if it could default to just omitting the label.

Or perhaps there is a way to configure a label as optional.

Describe alternatives you've considered

Currently I found a workaround like this:

key_labels:
  - user
query: |
  SELECT COALESCE(user, '~unknown') FROM table;

Additional context

Of course this issue will be indirectly remedied by this.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions