I've created a docker-compose file with some configurations that deploy Elasticsearch, Kibana, Elastic Agent all version 8.7.0.
where in the Kibana configuration files I define the police I needed under xpack.fleet.agentPolicies, with single command all my environment goes up and all component connect successfully, the only issue is there is one manual step, which is I had to go to Kibana -> Observability -> APM -> Add Elastic APM and then fill the Server configuration.
I want to automate this and manage this from the configuration files, I don't want to do it from the UI.
What is the way to do this? in which component? what is the path the configuration should be at?
You should be able to set up APM by default in kibana.yml alongside the agent policy you have set up.
First you'll need to add the APM integration:
xpack.fleet.packages:
- name: apm
version: latest
Next, add APM to your agent policy:
xpack.fleet.agentPolicies:
- name: {your policy name}
{any additional policy configuration you have set up}
package_policies:
- name: Your APM policy name
package:
name: apm
inputs:
- type: apm
vars:
- name: host
value: "localhost:8200"
- name: url
value: "http://localhost:8200"
This assume you just need to change the Host and URL fields. Everything else will be filled in with default values (they'll be what you see pre-populated in the UI).
Thanks for replying @jen-huang , but unfortunately that doesn't work, I still can't see the integration added, I still have to add it from the UI (Kibana -> Observability -> APM -> Add Elastic APM and then fill the Server configuration.), so what I'm missing here?
It looks like you are mixing up Fleet Server and APM. Both of your agent policies are creating Fleet Server policies. Do you want both Fleet Server and APM on the same policy? If so, try:
Apache, Apache Lucene, Apache Hadoop, Hadoop, HDFS and the yellow elephant
logo are trademarks of the
Apache Software Foundation
in the United States and/or other countries.