I'm using asp.net core and docker and the goal is to use Elastic APM, here is my configuration:
Program.cs:
app.UseAllElasticApm(builder.Configuration);
appsettings.json:
"ElasticApm": {
"ServiceName": "Appraisal360APMSerivce",
"LogLevel": "verbose",
"ServerUrl": "http://localhost:8200",
"apm-server-secret-token": "",
"TransactionSampleRate": 1.0
}
docker-compose file:
version: '3.4'
services:
apm-server:
image: docker.elastic.co/apm/apm-server:7.15.2
ports:
- 8200:8200
- 6060:6060
volumes:
- ./apm-server.yml:/usr/share/kibana/config/apm-server.yml
environment:
- output.elasticsearch.hosts=["http://elasticsearch:9200"]
networks:
- elastic
command: >
apm-server -e
-E apm-server.rum.enabled=true
-E apm-server.host=0.0.0.0:8200
-E setup.kibana.host=kibana:5601
cap_drop:
- ALL
cap_add:
- CHOWN
- DAC_OVERRIDE
- SETGID
- SETUID
logging:
driver: 'json-file'
options:
max-size: '200m'
max-file: '50'
elasticsearch:
container_name: elasticsearch
image: elasticsearch:8.5.0
ports:
- 9200:9200
volumes:
- elasticsearch-data:/usr/share/elasticsearch/data
environment:
- discovery.type=single-node
- xpack.security.enabled=true
networks:
- elastic
kibana:
container_name: kibana
image: kibana:8.5.0
volumes:
- ./kibana.yml:/usr/share/kibana/config/kibana.yml
environment:
- XPACK_MONITORING_ENABLED=true
- XPACK_MONITORING_COLLECTION_ENABLED=true
- XPACK_SECURITY_ENABLED=true
- ELASTICSEARCH_HOSTS=http://elasticsearch:9200
ports:
- 5601:5601
networks:
- elastic
elastic-agent:
image: docker.elastic.co/beats/elastic-agent:8.5.0
container_name: elastic-agent
restart: always
user: root # note, synthetic browser monitors require this set to `elastic-agent`
environment:
- fleet-server-es=http://localhost:9200
- fleet-server-service-token=*****
- fleet-server-policy=fleet-server-policy
networks:
elastic:
driver: bridge
volumes:
elasticsearch-data:
my container is up and running without error
now the problem is here that fleet server does not find any connection like what u see in the picture: