Skip to content

route.ID() returns conflicting IDs #3802

@grobinson-grafana

Description

@grobinson-grafana

What did you do?

It is possible to write an Alertmanager configuration file where route.ID() returns conflicting IDs. For example, the configuration file:

receiver: test
routes:
- matchers:
    - foo=bar
  continue: true
  routes:
  - matchers:
    - bar=baz
- matchers:
    - foo=bar
  continue: true
  routes:
  - matchers:
    - bar=baz

gives the following Route IDs:

{}
{}/{foo="bar"}/0
{}/{foo="bar"}/{bar="baz"}/0
{}/{foo="bar"}/1
{}/{foo="bar"}/{bar="baz"}/0

What did you expect to see?

It should give these IDs instead:

{}
{}/{foo="bar"}/0
{}/{foo="bar"}/0/{bar="baz"}/0
{}/{foo="bar"}/1
{}/{foo="bar"}/1/{bar="baz"}/0

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions