Skip to content

Commit 9914c6b

Browse files
Change elastic-agent pprof default to false
Change agent.monitoring.pprof to false, allow it to toggle beat behaviour as well as the agent's.
1 parent c43db8c commit 9914c6b

9 files changed

Lines changed: 13 additions & 9 deletions

File tree

x-pack/elastic-agent/CHANGELOG.next.asciidoc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -149,4 +149,4 @@
149149
- Add diagnostics command to gather beat metadata. {pull}28265[28265]
150150
- Add diagnostics collect command to gather beat metadata, config, policy, and logs and bundle it into an archive. {pull}28461[28461]
151151
- Add `KIBANA_FLEET_SERVICE_TOKEN` to Elastic Agent container. {pull}28096[28096]
152-
- Enable pprof endpoints for beats processes. Allow pprof endpoints for elastic-agent if enabled. {pull}28983[28983]
152+
- Allow pprof endpoints for elastic-agent or beats if enabled. {pull}28983[28983] {pull}29155[29155]

x-pack/elastic-agent/_meta/config/common.p2.yml.tmpl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ inputs:
3535
# metrics: true
3636
# # exposes /debug/pprof/ endpoints
3737
# # recommended that these endpoints are only enabled if the monitoring endpoint is set to localhost
38-
# pprof: true
38+
# pprof: false
3939
# # exposes agent metrics using http, by default sockets and named pipes are used
4040
# http:
4141
# # enables http endpoint

x-pack/elastic-agent/_meta/config/common.reference.p2.yml.tmpl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@ inputs:
109109
# metrics: false
110110
# # exposes /debug/pprof/ endpoints
111111
# # recommended that these endpoints are only enabled if the monitoring endpoint is set to localhost
112-
# pprof: true
112+
# pprof: false
113113
# # exposes agent metrics using http, by default sockets and named pipes are used
114114
# http:
115115
# # enables http endpoint

x-pack/elastic-agent/_meta/config/elastic-agent.docker.yml.tmpl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@ inputs:
109109
# metrics: false
110110
# # exposes /debug/pprof/ endpoints
111111
# # recommended that these endpoints are only enabled if the monitoring endpoint is set to localhost
112-
# pprof: true
112+
# pprof: false
113113
# # exposes agent metrics using http, by default sockets and named pipes are used
114114
# http:
115115
# # enables http endpoint

x-pack/elastic-agent/elastic-agent.docker.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@ inputs:
109109
# metrics: false
110110
# # exposes /debug/pprof/ endpoints
111111
# # recommended that these endpoints are only enabled if the monitoring endpoint is set to localhost
112-
# pprof: true
112+
# pprof: false
113113
# # exposes agent metrics using http, by default sockets and named pipes are used
114114
# http:
115115
# # enables http endpoint

x-pack/elastic-agent/elastic-agent.reference.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,7 @@ inputs:
115115
# metrics: false
116116
# # exposes /debug/pprof/ endpoints
117117
# # recommended that these endpoints are only enabled if the monitoring endpoint is set to localhost
118-
# pprof: true
118+
# pprof: false
119119
# # exposes agent metrics using http, by default sockets and named pipes are used
120120
# http:
121121
# # enables http endpoint

x-pack/elastic-agent/elastic-agent.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ inputs:
4141
# metrics: true
4242
# # exposes /debug/pprof/ endpoints
4343
# # recommended that these endpoints are only enabled if the monitoring endpoint is set to localhost
44-
# pprof: true
44+
# pprof: false
4545
# # exposes agent metrics using http, by default sockets and named pipes are used
4646
# http:
4747
# # enables http endpoint

x-pack/elastic-agent/pkg/core/monitoring/beats/beats_monitor.go

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -122,8 +122,12 @@ func (b *Monitor) EnrichArgs(spec program.Spec, pipelineID string, args []string
122122
appendix = append(appendix,
123123
"-E", "http.enabled=true",
124124
"-E", "http.host="+endpoint,
125-
"-E", "http.pprof.enabled=true",
126125
)
126+
if b.config.Pprof {
127+
appendix = append(appendix,
128+
"-E", "http.pprof.enabled=true",
129+
)
130+
}
127131
}
128132

129133
loggingPath := b.generateLoggingPath(spec, pipelineID)

x-pack/elastic-agent/pkg/core/monitoring/config/config.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,6 @@ func DefaultConfig() *MonitoringConfig {
3939
Port: defaultPort,
4040
},
4141
Namespace: defaultNamespace,
42-
Pprof: true,
42+
Pprof: false,
4343
}
4444
}

0 commit comments

Comments
 (0)