Skip to content

Commit

Permalink
I18N-1308: Add environment name to PagerDuty incident
Browse files Browse the repository at this point in the history
  • Loading branch information
byronantak committed Jan 24, 2025
1 parent 7c9db9d commit 9e32c5b
Showing 1 changed file with 4 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
import org.hibernate.Hibernate;
import org.slf4j.Logger;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.core.env.Environment;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import org.springframework.security.access.AccessDeniedException;
Expand Down Expand Up @@ -53,6 +54,8 @@ public class UserService {

@Autowired MeterRegistry meterRegistry;

@Autowired Environment environment;

@Autowired(required = false)
ServiceDisambiguator serviceDisambiguator;

Expand Down Expand Up @@ -499,7 +502,7 @@ private void sendPagerDutyNotification(
pagerDutyClient.triggerIncident(
dedupKey,
new PagerDutyPayload(
"Mojito unrecognized service attempting authentication: '" + serviceName + "'",
environment.getProperty("env.server.url", "Mojito") + " - unrecognized service attempting authentication: '" + serviceName + "'",
serviceName,
PagerDutyPayload.Severity.ERROR,
ImmutableMap.of("serviceName", serviceName)));
Expand Down

0 comments on commit 9e32c5b

Please sign in to comment.