I am integrating my Spring Boot application to Kibana and followed these steps:
JDK: 17
step-1: Adding elastic-apm-agent
added elastic-apm-agent.jar(1.51.1) into dockerfile. And I see the APM on Kibana and micrometer metrics, but micrometer metrics was increased monotonically.
-javaagent:$ELASTIC_APM_PATH -Delastic.apm.application_packages=com.development -Delastic.apm.secret_token=ELASTIC_APM_TOKEN -Delastic.apm.server_url=http://xxxx:8200
question1
How was it able to send custom metrics before doing step-2?
step-2: Micrometer export configuration
I wanted to see the values in a certain time interval and decided to use ElasticMeterRegistery as shown below. Then, start to see the metrics as expected.
build.gradle.kts
implementation("io.micrometer:micrometer-registry-elastic:1.12.1")
application.yaml
elastic:
metrics:
export:
host: http://xxxx:9200
step: 1m
enabled: true
I get this error:
failed to send metrics to elastic
with exception: java.SocketTimeoutException: Read timed out
question2
How can I fix this error?
I am integrating my Spring Boot application to Kibana and followed these steps:
JDK: 17
step-1: Adding elastic-apm-agent
added elastic-apm-agent.jar(1.51.1) into dockerfile. And I see the APM on Kibana and micrometer metrics, but micrometer metrics was increased monotonically.
-javaagent:$ELASTIC_APM_PATH -Delastic.apm.application_packages=com.development -Delastic.apm.secret_token=ELASTIC_APM_TOKEN -Delastic.apm.server_url=http://xxxx:8200
question1
How was it able to send custom metrics before doing step-2?
step-2: Micrometer export configuration
I wanted to see the values in a certain time interval and decided to use ElasticMeterRegistery as shown below. Then, start to see the metrics as expected.
build.gradle.kts
implementation("io.micrometer:micrometer-registry-elastic:1.12.1")
application.yaml
elastic:
metrics:
export:
host: http://xxxx:9200
step: 1m
enabled: true
I get this error:
failed to send metrics to elastic
with exception: java.SocketTimeoutException: Read timed out
question2
How can I fix this error?
Share Improve this question edited Feb 3 at 8:43 Mark Rotteveel 109k229 gold badges156 silver badges220 bronze badges asked Feb 2 at 15:26 S.BalabanS.Balaban 1964 silver badges20 bronze badges1 Answer
Reset to default 1The correct configuration key for setting the Elasticsearch host is management.elastic.metrics.export.host
. You will probably need to configure management.elastic.metrics.export.api-key-credentials
as well.
See https://docs.spring.io/spring-boot/appendix/application-properties/index.html#application-properties.actuator.management.elastic.metrics.export.host