1
votes

I have created a spring boot application with spring cloud sleuth. For POC purposes, I used zipkin on my local machine and I am able to instrument a external service which is not instrumented by creating manual span. I reffered below link. https://cloud.spring.io/spring-cloud-sleuth/1.2.x/multi/multi__customizations.html

Now, When I move to PCF environment, then I am unable to collect proper custom spans. PCF metrics always shows parent span and service with total time taken. Could anyone please let me know where I am going wrong.

Zipkin Output:-

enter image description here

PCF Metrics:-

enter image description here

UPDATE screen shot for Zipkin with @NewSpan.

enter image description here

PCF metrics screen shot without call hierachy

enter image description here

2

2 Answers

0
votes

You have to provide a different logging pattern to make it work with PCF Metrics AFAIR. You need the parent span to be present in logs. Set the property logging.pattern.level: "%clr(%5p) %clr([${spring.application.name:-},%X{X-B3-TraceId:-},%X{X-B3-SpanId:-},%X{X-B3-ParentSpanId:-},%X{X-Span-Export:-}]){yellow}". Check this example: https://github.com/pivotal-cf/pcf-metrics-trace-example-spring

0
votes

PCF metrics does not support custom spans, it only shows the respomse time distribution span that corresponds to http request routed by goRouter.