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

Cherry-pick #18261 to 7.x: [Elastic Agent] Add stream.* to metrics and logs collected #18264

Merged
merged 1 commit into from
May 5, 2020
Merged
Show file tree
Hide file tree
Changes from all 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 @@ -29,6 +29,7 @@
- Use default output by default {pull}18091[18091]
- Fix panic and flaky tests for the Agent. {pull}18135[18135]
- Fix default configuration after enroll {pull}18232[18232]
- Fix make sure the collected logs or metrics include streams information. {pull}18261[18261]

==== New features

Expand Down
24 changes: 24 additions & 0 deletions x-pack/elastic-agent/pkg/agent/operation/monitoring.go
Original file line number Diff line number Diff line change
Expand Up @@ -171,6 +171,18 @@ func (o *Operator) getMonitoringFilebeatConfig(output interface{}) (map[string]i
"type": "log",
"paths": paths,
"index": "logs-agent-default",
"processors": []map[string]interface{}{
map[string]interface{}{
"add_fields": map[string]interface{}{
"target": "stream",
"fields": map[string]interface{}{
"type": "logs",
"dataset": "agent",
"namespace": "default",
},
},
},
},
},
},
},
Expand Down Expand Up @@ -199,6 +211,18 @@ func (o *Operator) getMonitoringMetricbeatConfig(output interface{}) (map[string
"period": "10s",
"hosts": hosts,
"index": "metrics-agent-default",
"processors": []map[string]interface{}{
map[string]interface{}{
"add_fields": map[string]interface{}{
"target": "stream",
"fields": map[string]interface{}{
"type": "metrics",
"dataset": "agent",
"namespace": "default",
},
},
},
},
},
},
},
Expand Down