Unify jaeger enabling method for adservice. (#115)
This commit is contained in:
parent
85c7131d43
commit
33ca3b63d8
2 changed files with 8 additions and 7 deletions
|
@ -31,8 +31,8 @@ spec:
|
|||
env:
|
||||
- name: PORT
|
||||
value: "9555"
|
||||
- name: JAEGER_ENABLED
|
||||
value: "false"
|
||||
#- name: JAEGER_SERVICE_ADDR
|
||||
# value: "jaeger-collector:14268"
|
||||
resources:
|
||||
requests:
|
||||
cpu: 200m
|
||||
|
@ -42,12 +42,12 @@ spec:
|
|||
memory: 300Mi
|
||||
readinessProbe:
|
||||
initialDelaySeconds: 20
|
||||
periodSeconds: 5
|
||||
periodSeconds: 15
|
||||
exec:
|
||||
command: ["/bin/grpc_health_probe", "-addr=:9555"]
|
||||
livenessProbe:
|
||||
initialDelaySeconds: 20
|
||||
periodSeconds: 5
|
||||
periodSeconds: 15
|
||||
exec:
|
||||
command: ["/bin/grpc_health_probe", "-addr=:9555"]
|
||||
---
|
||||
|
|
|
@ -238,10 +238,11 @@ public class AdService {
|
|||
}
|
||||
|
||||
static void initJaeger() {
|
||||
boolean enabled = Boolean.parseBoolean(System.getenv("JAEGER_ENABLED"));
|
||||
if (enabled) {
|
||||
String jaegerAddr = System.getenv("JAEGER_SERVICE_ADDR");
|
||||
if (jaegerAddr != null && !jaegerAddr.isEmpty()) {
|
||||
String jaegerUrl = String.format("http://%s/api/traces", jaegerAddr);
|
||||
// Register Jaeger Tracing.
|
||||
JaegerTraceExporter.createAndRegister("http://jaeger-collector:14268/api/traces", "adservice");
|
||||
JaegerTraceExporter.createAndRegister(jaegerUrl, "adservice");
|
||||
logger.info("Jaeger initialization complete.");
|
||||
} else {
|
||||
logger.info("Jaeger initialization disabled.");
|
||||
|
|
Loading…
Reference in a new issue