Skip to content

Auto-closing OpsGenie alerts fails due to missing identifierType parameter #4551

@AE-RobertMcDonnell

Description

@AE-RobertMcDonnell

Spring Boot Admin Server information

  • Version:
    v3.5.1

  • Spring Boot version:
    v3.5.3

  • Configured Security:
    basic auth

  • Webflux or Servlet application:
    WebFlux

Client information

  • Spring Boot versions:
    v3.5.3

  • Used discovery mechanism:
    eureka

  • Webflux or Servlet application:
    WebFlux

Description

While I was successful in getting Spring Boot Admin to create OpsGenie alerts when my app instances state changes, these alerts are not automatically closing when I bring the instance back up.

I can see in the Spring Boot Admin logs that it is attempting to close the alert, and I can see that it is receiving a 202 ACCEPTED response from OpsGenie, however, the alert remains open.

After turning up the logging level for RestTemplate, I can see the close happen:
2025-08-07 11:18:32,981 DEBUG o.s.c.l.CompositeLog [reactor-http-nio-1] HTTP POST https://api.opsgenie.com/v2/alerts/myapp_870c2b816861/close 2025-08-07 11:18:32,983 DEBUG o.s.c.l.CompositeLog [reactor-http-nio-1] Accept=[application/json, application/*+json] 2025-08-07 11:18:32,984 DEBUG o.s.c.l.CompositeLog [reactor-http-nio-1] Writing [{source=my-source}] as "application/json" 2025-08-07 11:18:33,171 DEBUG o.s.c.l.CompositeLog [reactor-http-nio-1] Response 202 ACCEPTED

I tried manually POSTing to OpsGenie using the URL and details above, but the result was the same. Then after some googling, I discovered that the OpsGenie Rest API needs an identifierType parameter to be sent. If you don't send this parameter it will assume an identifierType of "id". However, SBA is passing in the alias to close, and not the id, so the close fails.

If I manually POST to the url https://api.opsgenie.com/v2/alerts/myapp_870c2b816861/close?identifierType=alias then the close happens.

Looking at the de.codecentric.boot.admin.server.notify.OpsGenieNotifier class code, I can see where it is building the close URL and that it is not setting identifierType:

protected String buildUrl(InstanceEvent event, Instance instance) { if ((event instanceof InstanceStatusChangedEvent statusChangedEvent) && (StatusInfo.STATUS_UP.equals(statusChangedEvent.getStatusInfo().getStatus()))) { return String.format("%s/%s/close", url, generateAlias(instance)); } return url.toString(); }

Is there any way to force it to set the identifierType to alias?

Thank you!

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions