The `org.springframework.cloud.gateway.filter.NettyRoutingFilter` in SC Gateway
is adding only these headers that were set when the request came in. That means
that adding any additional headers (via instrumentation) is completely ignored.
That's why we're wrapping the `HttpClientRequest` in such a wrapper that
when `setHeaders` is called (that clears any current headers), will also add
the tracing headers
fixes gh-907
There was some doubt on gitter about sleuth generating spans with floating-point
rendered timestamps. While this shouldn't break people we certainly shouldn't
create json like this.
This was presumed to be caused by sleuth's rest template sender by @mojsha who
was trying Jaeger. Jaeger's parser doesn't give any errors with a 400.
```json
[
{
"traceId": "a65dac9d8bbb57f8",
"parentId": "a65dac9d8bbb57f8",
"id": "f223bb97e1eba9b2",
"kind": "SERVER",
"name": "https:\/hello3",
"timestamp": 1.521027116604e+15,
"duration": 1525,
"localEndpoint": {
"serviceName": "${spring.application.name}",
"ipv4": "10.128.6.98",
"port": 8443
},
```
I added a test to make sure it is not the case.
without this change we were not reusing a span context if there was no previous span. Instead we were overwrriting it with an empty one
with this change, if the context is there we are reusing it instead of overwriting it
fixes gh-897
Instrumentation around brave is more likely to use a simple bean name
like "tracing" vs "sleuthTracing". This changes the commodity beans to
simple names so that we can avoid having to teach naming prefixes unless
necessary.
This affects the following beans:
* httpTracing
* tracing
* tracer
* spanCustomizer
This came up when integrating dubbo, as their extension loader prefers
stable bean names. For example, loading `brave.Tracing` with their
spring extension silently failed because our bean was named
"sleuthTracing". Even if we can provide instructions to override this,
seems best to dodge.
* Aligned HTTP instrumentation with Brave
with this change we remove TraceFilter and make TraceHandlerInterceptor a legacy component. All HTTP instrumentation is done via Brave.
fixes gh-873