Skip to content
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

[Agent] Fixed injected log path to monitoring beat #17833

Merged
merged 5 commits into from
Apr 20, 2020
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions x-pack/elastic-agent/CHANGELOG.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
- Fix issues when running `mage package` for all the platforms. {pull}17767[17767]
- Remove the kbn-version on each request to the Kibana API. {pull}17764[17764]
- Fixed process spawning on Windows {pull}17751[17751]
- Fixed injected log path to monitoring beat {pull}17833[17833]

==== New features

Expand Down
2 changes: 1 addition & 1 deletion x-pack/elastic-agent/_meta/common.p2.yml
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ retry:
# Default is false
exponential: false

monitoring:
settings.monitoring:
# enabled turns on monitoring of running processes
enabled: false
# enables log monitoring
Expand Down
2 changes: 1 addition & 1 deletion x-pack/elastic-agent/_meta/common.reference.p2.yml
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ retry:
# Default is false
exponential: false

monitoring:
settings.monitoring:
# enabled turns on monitoring of running processes
enabled: false
# enables log monitoring
Expand Down
2 changes: 1 addition & 1 deletion x-pack/elastic-agent/_meta/elastic-agent.docker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ retry:
# Default is false
exponential: false

monitoring:
settings.monitoring:
# enabled turns on monitoring of running processes
enabled: false
# enables log monitoring
Expand Down
2 changes: 1 addition & 1 deletion x-pack/elastic-agent/_meta/elastic-agent.yml
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ retry:
# Default is false
exponential: false

monitoring:
settings.monitoring:
# enabled turns on monitoring of running processes
enabled: false
# enables log monitoring
Expand Down
2 changes: 1 addition & 1 deletion x-pack/elastic-agent/elastic-agent.docker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ retry:
# Default is false
exponential: false

monitoring:
settings.monitoring:
# enabled turns on monitoring of running processes
enabled: false
# enables log monitoring
Expand Down
2 changes: 1 addition & 1 deletion x-pack/elastic-agent/elastic-agent.reference.yml
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ retry:
# Default is false
exponential: false

monitoring:
settings.monitoring:
# enabled turns on monitoring of running processes
enabled: false
# enables log monitoring
Expand Down
2 changes: 1 addition & 1 deletion x-pack/elastic-agent/elastic-agent.yml
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ retry:
# Default is false
exponential: false

monitoring:
settings.monitoring:
# enabled turns on monitoring of running processes
enabled: false
# enables log monitoring
Expand Down
4 changes: 4 additions & 0 deletions x-pack/elastic-agent/pkg/agent/operation/monitoring.go
Original file line number Diff line number Diff line change
Expand Up @@ -225,6 +225,8 @@ func (o *Operator) getMonitoringFilebeatConfig(output interface{}) (map[string]i
},
}

o.logger.Debugf("monitoring configuration generated for filebeat: %v", result)

return result, true
}

Expand All @@ -250,6 +252,8 @@ func (o *Operator) getMonitoringMetricbeatConfig(output interface{}) (map[string
},
}

o.logger.Debugf("monitoring configuration generated for metricbeat: %v", result)

return result, true
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ func (b *Monitor) LogPath() string {
return ""
}

return b.loggingPath
return filepath.Join(b.loggingPath, b.process)
}

// MetricsPath describes a location where application exposes metrics
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,5 +38,5 @@ func getLoggingFile(program, operatingSystem, installPath, pipelineID string) st
}

func getLoggingFileDirectory(installPath, operatingSystem, pipelineID string) string {
return filepath.Base(getLoggingFile("program", operatingSystem, installPath, pipelineID))
return filepath.Dir(getLoggingFile("program", operatingSystem, installPath, pipelineID))
}