Skip to content

Commit

Permalink
Fix monitoring to adjust - to _ in monitoring. (elastic#22554)
Browse files Browse the repository at this point in the history
  • Loading branch information
blakerouse authored Nov 12, 2020
1 parent 32ca14a commit af709fe
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions x-pack/elastic-agent/pkg/agent/operation/monitoring.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ package operation
import (
"fmt"
"path/filepath"
"strings"

"github.com/hashicorp/go-multierror"

Expand Down Expand Up @@ -346,7 +347,7 @@ func (o *Operator) getLogFilePaths() map[string][]string {
for _, a := range o.apps {
logPath := a.Monitor().LogPath(a.Spec(), o.pipelineID)
if logPath != "" {
paths[a.Name()] = append(paths[a.Name()], logPath)
paths[strings.ReplaceAll(a.Name(), "-", "_")] = append(paths[a.Name()], logPath)
}
}

Expand All @@ -362,7 +363,7 @@ func (o *Operator) getMetricbeatEndpoints() map[string][]string {
for _, a := range o.apps {
metricEndpoint := a.Monitor().MetricsPathPrefixed(a.Spec(), o.pipelineID)
if metricEndpoint != "" {
endpoints[a.Name()] = append(endpoints[a.Name()], metricEndpoint)
endpoints[strings.ReplaceAll(a.Name(), "-", "_")] = append(endpoints[a.Name()], metricEndpoint)
}
}

Expand Down

0 comments on commit af709fe

Please sign in to comment.