Skip to content

Commit

Permalink
Fix APM server not being available in cloud. (#1781)
Browse files Browse the repository at this point in the history
  • Loading branch information
cmacknz authored Nov 24, 2022
1 parent e3e953b commit b4002e9
Showing 1 changed file with 14 additions and 3 deletions.
17 changes: 14 additions & 3 deletions internal/pkg/agent/application/monitoring/processes.go
Original file line number Diff line number Diff line change
Expand Up @@ -50,9 +50,20 @@ func processesHandler(coord *coordinator.Coordinator) func(http.ResponseWriter,

for _, c := range state.Components {
if c.Component.InputSpec != nil {
procs = append(procs, process{c.Component.ID, c.Component.InputSpec.BinaryName,
c.LegacyPID,
sourceFromComponentID(c.Component.ID)})
displayID := c.Component.ID
if strings.Contains(c.Component.InputSpec.BinaryName, "apm-server") {
// Cloud explicitly looks for an ID of "apm-server" to determine if APM is in managed mode.
// Ensure that this is the ID we use, at the time of writing it is "apm-default".
// Otherwise apm-server won't be routable/accessible in cloud.
// https://github.com/elastic/elastic-agent/issues/1731#issuecomment-1325862913
displayID = "apm-server"
}
procs = append(procs, process{
ID: displayID,
PID: c.LegacyPID,
Binary: c.Component.InputSpec.BinaryName,
Source: sourceFromComponentID(c.Component.ID),
})
}
}
data := struct {
Expand Down

0 comments on commit b4002e9

Please sign in to comment.