In my application.yml of my spring boot app I want to configure the actuator metrics to push to my elastic server.
metrics:
enable:
all: false
diskspace: true
jvm: true
mycustomstuff: true
export:
elastic:
enabled: true
host: https://${vcap.services.my-cloud-logging.credentials.Elasticsearch-endpoint}
password: ${vcap.services.my-cloud-logging.credentials.Elasticsearch-password}
user-name: ${vcap.services.my-cloud-logging.credentials.Elasticsearch-username}
auto-create-index: false
index: metrics
But micrometer keeps failing when sending metrics because my variable is not well expended
Illegal character in authority at index 8: https://${vcap.services.my-cloud-logging.credentials.Elasticsearch-endpoint}/metrics-2021-10/_bulk"
I checked at runtime all the variables have the correct value. They are created by CloudFoundryVcapEnvironmentPostProcesso.
Actually, I have the feeling the problem is caused by the concatenation of "https://" with the variable.
Also confirmed by this unanswered question, where the OP wants to prepend "jdbc:" to a vcap variable
Using double quotes as "host: https://${vcap.services.my-cloud-logging.credentials.Elasticsearch-endpoint}"
didn't help