Skip to content

Commit a6653bf

Browse files
committed
use cfenv spel in application.yaml
1 parent 64a3cec commit a6653bf

File tree

2 files changed

+18
-12
lines changed

2 files changed

+18
-12
lines changed

cloudfoundry/app.yaml

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,4 +15,19 @@ applications:
1515
JBP_CONFIG_OPEN_JDK_JRE: '{ jre: { version: 21.+ } }'
1616
SPRING_DATA_MONGODB_URI: mongodb://xxx:yyy@rs0-0-mongo-server:27017,rs0-1-mongo-server:27017,rs0-2-mongo-server:27017/db?replicaSet=rs0&tls=true
1717
OTEL_SERVICE_NAME: mongodb-probe-cf
18+
OTEL_TRACES_EXPORTER: otlp
19+
OTEL_LOGS_EXPORTER: none
20+
OTEL_METRICS_EXPORTER: none
21+
22+
#TODO: replace with cfEnv binding
1823
OTEL_EXPORTER_OTLP_ENDPOINT: http://jaeger-collector-otel-server:443
24+
25+
26+
#for troubleshooting purpose
27+
LOGGING_LEVEL_ORG_SPRINGFRAMEWORK_BOOT_AUTOCONFIGURE_SSL: DEBUG
28+
LOGGING_LEVEL_ORG_SPRINGFRAMEWORK_BOOT_SSL: DEBUG
29+
LOGGING_LEVEL_ORG_SPRINGFRAMEWORK_DATA_MONGODB: DEBUG
30+
LOGGING_LEVEL_ORG_MONGODB: DEBUG
31+
JAVA_OPTS: -Djdk.tls.client.protocols=TLSv1.2 -Djavax.net.debug=SSL,handshake,verbose,trustmanager
32+
33+

src/main/resources/application.yaml

Lines changed: 3 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -57,9 +57,7 @@ spring:
5757
on-profile: cloud
5858
data:
5959
mongodb:
60-
#uri: ${vcap.services.mongodb-service.credentials.uri}
61-
#cassandra.contact-points=#{ cfEnv.findCredentialsByTag('cassandra').get('node_ips') }
62-
uri: #{ cfEnv.findCredentialsByTag('mongodb').get('uri')
60+
uri: #{ cfEnv.findCredentialsByTag('mongodb').get('uri') }
6361
ssl:
6462
bundle:
6563
pem:
@@ -68,14 +66,6 @@ spring:
6866
truststore:
6967
certificate: #{ cfEnv.findCredentialsByTag('mongodb').get('tlsCert') }
7068
private-key: #{ cfEnv.findCredentialsByTag('mongodb').get('tlsKey') }
71-
72-
73-
#certificate: ${VCAP_SERVICES[mongodb-service][0].credentials.tlsCert}
74-
#private-key: ${VCAP_SERVICES[mongodb-service][0].credentials.tlsKey}
75-
76-
# In application.properties format:
77-
# spring.ssl.bundle.pem.clientbundle.truststore.certificate=${VCAP_SERVICES[your-service-name][0].credentials.certificate}
78-
# spring.ssl.bundle.pem.clientbundle.truststore.private-key=${VCAP_SERVICES[your-service-name][0].credentials.private_key}
7969

8070
otel:
8171
traces:
@@ -86,7 +76,8 @@ otel:
8676
exporter: none
8777
exporter:
8878
otlp:
89-
endpoint: ${vcap.services.observability-service.credentials.jaegerCollectorHost}
79+
#endpoint: ${vcap.services.observability-service.credentials.jaegerCollectorHost}
80+
endpoint: #{ cfEnv.findCredentialsByTag('observability').get('jaegerCollectorHost') }
9081
---
9182
spring:
9283
config:

0 commit comments

Comments
 (0)