Skip to content

Alertmanager exporter should allow additional labels #38063

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
JettJones opened this issue Feb 20, 2025 · 2 comments · Fixed by #39056
Closed

Alertmanager exporter should allow additional labels #38063

JettJones opened this issue Feb 20, 2025 · 2 comments · Fixed by #39056
Labels

Comments

@JettJones
Copy link

Component(s)

No response

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

Alertmanager routing can select different routes based on labels on incoming alerts. But the altermanager exporter creates only two labels: severity and event_name.

My desired use case is to route alerts based on the service name, and severity, with overrides for some library events. I expect the mapping of teams handling alerts is fairly unique by company, so more flexibility is helpful here.

Describe the solution you'd like

Accept in configuration a list of event annotations to promote to labels.

When an annotation is present, add its value to the LabelSet of the created alert, here:
https://github.com/open-telemetry/opentelemetry-collector-contrib/blob/main/exporter/alertmanagerexporter/alertmanager_exporter.go#L116

Describe alternatives you've considered

To get similar behavior of passing routing information into alertmanager:

  • concatenate multiple labels into event_name and use regex matchers in alertmanager to separate them again.
  • fork this exporter, and add label support.

Additional context

No response

@JettJones JettJones added enhancement New feature or request needs triage New item requiring triage labels Feb 20, 2025
Copy link
Contributor

Pinging code owners for exporter/alertmanager: @sokoide @mcube8. See Adding Labels via Comments if you do not have permissions to add labels yourself. For example, comment '/label priority:p2 -needs-triaged' to set the priority and remove the needs-triaged label.

@mcube8
Copy link
Member

mcube8 commented Mar 30, 2025

/label priority:p3 -needs-triage

@github-actions github-actions bot removed the needs triage New item requiring triage label Mar 30, 2025
mcube8 added a commit to mcube8/opentelemetry-collector-contrib that referenced this issue Mar 31, 2025
mcube8 added a commit to mcube8/opentelemetry-collector-contrib that referenced this issue Mar 31, 2025
@atoulme atoulme closed this as completed in db7cc04 Apr 4, 2025
dmathieu pushed a commit to dmathieu/opentelemetry-collector-contrib that referenced this issue Apr 8, 2025
open-telemetry#39056)

…38063

<!--Ex. Fixing a bug - Describe the bug and how this fixes the issue.
Ex. Adding a feature - Explain what this achieves.-->
#### Description
Add Alert labels from configured list of Event attribute names

<!-- Issue number (e.g. open-telemetry#1234) or full URL to issue, if applicable. -->
#### Link to tracking issue
Fixes open-telemetry#38063

<!--Describe what testing was performed and which tests were added.-->
#### Testing
Unit tests for configuration change

<!--Describe the documentation added.-->
#### Documentation
Readme and Sample Configs to use Alert manager exporter

<!--Please delete paragraphs that you did not use before submitting.-->
LucianoGiannotti pushed a commit to LucianoGiannotti/opentelemetry-collector-contrib that referenced this issue Apr 9, 2025
open-telemetry#39056)

…38063

<!--Ex. Fixing a bug - Describe the bug and how this fixes the issue.
Ex. Adding a feature - Explain what this achieves.-->
#### Description
Add Alert labels from configured list of Event attribute names

<!-- Issue number (e.g. open-telemetry#1234) or full URL to issue, if applicable. -->
#### Link to tracking issue
Fixes open-telemetry#38063

<!--Describe what testing was performed and which tests were added.-->
#### Testing
Unit tests for configuration change

<!--Describe the documentation added.-->
#### Documentation
Readme and Sample Configs to use Alert manager exporter

<!--Please delete paragraphs that you did not use before submitting.-->
Fiery-Fenix pushed a commit to Fiery-Fenix/opentelemetry-collector-contrib that referenced this issue Apr 24, 2025
open-telemetry#39056)

…38063

<!--Ex. Fixing a bug - Describe the bug and how this fixes the issue.
Ex. Adding a feature - Explain what this achieves.-->
#### Description
Add Alert labels from configured list of Event attribute names

<!-- Issue number (e.g. open-telemetry#1234) or full URL to issue, if applicable. -->
#### Link to tracking issue
Fixes open-telemetry#38063

<!--Describe what testing was performed and which tests were added.-->
#### Testing
Unit tests for configuration change

<!--Describe the documentation added.-->
#### Documentation
Readme and Sample Configs to use Alert manager exporter

<!--Please delete paragraphs that you did not use before submitting.-->
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
3 participants