- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我们最近设置了一个 jaeger 服务器,以便跟踪整个系统中的所有请求。通过简单地将必要的 spring (cloud) starter 依赖项添加到我们的构建文件中,初始设置工作得非常好。每次请求到达我们的一台服务器时,都会创建一个新跨度并将其报告给使用一体式 docker 镜像设置的 jaeger 服务器。
最重要的依赖项如下:
compile "org.springframework.boot:spring-boot-starter-web"
compile "org.springframework.boot:spring-boot-starter-actuator"
compile "org.springframework.boot:spring-boot-starter-undertow"
compile "org.springframework.boot:spring-boot-starter-aop"
compile "org.springframework.cloud:spring-cloud-starter-netflix-hystrix:2.0.2.RELEASE"
compile "org.springframework.cloud:spring-cloud-starter-openfeign:2.0.2.RELEASE"
compile "io.opentracing.contrib:opentracing-spring-cloud-feign-starter:0.2.1"
compile "io.opentracing.contrib:opentracing-spring-jaeger-cloud-starter:0.2.1"
compile "io.opentracing.contrib:opentracing-spring-jaeger-starter:0.2.1"
compile "io.opentracing.contrib:opentracing-spring-web-autoconfigure:0.2.1"
虽然在服务器上创建了跨度,但不会将必要的 header 转发给假客户端。根据文档,添加 opentracing-spring-cloud-feign-starter 依赖项应该可以解决问题,但到目前为止,没有一个 feign 客户端起作用。
我还在opentracing提供的auto configure类中加了一个断点
@Bean
FeignContextBeanPostProcessor feignContextBeanPostProcessor(BeanFactory beanFactory) {
return new FeignContextBeanPostProcessor(tracer, beanFactory, spanDecorators);
}
并且在应用程序启动时调用此方法。日志中还有一些关于 jaeger/opentracing 初始化的信息:
main 22:26:53.371 3222 INFO o.s.c.s.PostProcessorRegistrationDelegate$BeanPostProcessorChecker - Bean 'io.opentracing.contrib.spring.cloud.async.DefaultAsyncAutoConfiguration$DefaultTracedAsyncConfigurerSupport' of type [io.opentracing.contrib.spring.cloud.async.DefaultAsyncAutoConfiguration$DefaultTracedAsyncConfigurerSupport$$EnhancerBySpringCGLIB$$4ab0858a] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying)
main 22:26:53.478 3329 INFO o.s.c.s.PostProcessorRegistrationDelegate$BeanPostProcessorChecker - Bean 'io.opentracing.contrib.spring.cloud.async.DefaultAsyncAutoConfiguration' of type [io.opentracing.contrib.spring.cloud.async.DefaultAsyncAutoConfiguration$$EnhancerBySpringCGLIB$$4bce5627] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying)
main 22:26:53.670 3521 INFO o.s.c.s.PostProcessorRegistrationDelegate$BeanPostProcessorChecker - Bean 'io.opentracing.contrib.spring.cloud.feign.FeignTracingAutoConfiguration' of type [io.opentracing.contrib.spring.cloud.feign.FeignTracingAutoConfiguration$$EnhancerBySpringCGLIB$$3a2361a6] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying)
main 22:26:53.905 3756 INFO o.s.c.s.PostProcessorRegistrationDelegate$BeanPostProcessorChecker - Bean 'io.opentracing.contrib.java.spring.jaeger.starter.JaegerAutoConfiguration' of type [io.opentracing.contrib.java.spring.jaeger.starter.JaegerAutoConfiguration$$EnhancerBySpringCGLIB$$5c956416] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying)
main 22:26:53.942 3793 INFO o.s.c.s.PostProcessorRegistrationDelegate$BeanPostProcessorChecker - Bean 'opentracing.jaeger-io.opentracing.contrib.java.spring.jaeger.starter.JaegerConfigurationProperties' of type [io.opentracing.contrib.java.spring.jaeger.starter.JaegerConfigurationProperties] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying)
main 22:26:53.962 3813 INFO o.s.c.s.PostProcessorRegistrationDelegate$BeanPostProcessorChecker - Bean 'metricsFactory' of type [io.jaegertracing.internal.metrics.NoopMetricsFactory] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying)
main 22:26:53.977 3828 INFO o.s.c.s.PostProcessorRegistrationDelegate$BeanPostProcessorChecker - Bean 'reporterMetrics' of type [io.jaegertracing.internal.metrics.Metrics] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying)
main 22:26:53.982 3833 INFO o.s.c.s.PostProcessorRegistrationDelegate$BeanPostProcessorChecker - Bean 'sampler' of type [io.jaegertracing.internal.samplers.ConstSampler] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying)
main 22:26:54.013 3864 INFO o.s.c.s.PostProcessorRegistrationDelegate$BeanPostProcessorChecker - Bean 'reporter' of type [io.jaegertracing.internal.reporters.CompositeReporter] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying)
main 22:26:54.028 3879 INFO o.s.c.s.PostProcessorRegistrationDelegate$BeanPostProcessorChecker - Bean 'tracer' of type [io.jaegertracing.internal.JaegerTracer] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying)
main 22:26:59.495 9346 INFO o.s.c.s.PostProcessorRegistrationDelegate$BeanPostProcessorChecker - Bean 'org.springframework.cloud.autoconfigure.ConfigurationPropertiesRebinderAutoConfiguration' of type [org.springframework.cloud.autoconfigure.ConfigurationPropertiesRebinderAutoConfiguration$$EnhancerBySpringCGLIB$$216245cc] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying)
我花了很多时间阅读文档并寻找如何正确配置 spring boot/cloud 应用程序以便与假客户端一起工作的示例,但到目前为止我没有运气。大多数示例都使用 Springs 的 RestTemplate 而不是 Feign 客户端。
如果有人能指出我正确的方向,我会很高兴。
最佳答案
事实证明,Feign 客户端当前不支持,或者准确地说,spring 启动不会相应地配置 Feign 客户端。如果您想将 Jaeger 与您的 Feign 客户端一起使用,您必须提供自己的集成。
根据我目前的经验,jaeger 社区的支持度较低,因此您必须自己获得此类知识,我认为这是一个很大的缺点,您可能应该考虑使用替代方案。
关于spring-boot - spring cloud、hystrix、feign如何集成opentracing/jaeger?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/53453160/
有什么区别: spring-cloud-starter-openfeign ( https://github.com/spring-cloud/spring-cloud-openfeign ) 和 s
我们正在使用netflix feign来调用 Restful Web服务。对于补丁请求,看来不支持PATCH请求。 Caused by: feign.RetryableException: Inval
据我了解,当请求响应状态码!= 2xx 时,将调用 feign ErrorDecoder 的 decode() 方法。通过调试我的测试,我发现我的 CustomErrorDecoder 的 decod
我有一个像这样构建的假客户端服务: Feign.Builder builder = Feign.builder() .contract(new SpringMvcContract())
使用spring cloud feign调用我的服务,当服务返回401异常时,respose.body()一片空白。 当我抛出异常时 throw new BadRequestException(400
我使用 ErrorDecoder 返回正确的异常而不是 500 状态代码。 有没有办法在解码器中检索原始消息。我可以看到它在 FeignException 中,但不在 decode 方法中。我所拥有的
通过学习曲线,遇到了这个场景: 鉴于90%的调用都是JSON,在构建客户端时添加了GSON解码器。不过接口(interface)中有些方法调用应该是支持raw return without decod
我正在尝试使用以下 Feign 客户端在 Spring Boot 应用程序中检索在线图像内容。 @FeignClient(name = "image") public interface ImageC
我正在使用需要设置几个字段的 REST api。我的应用程序应始终将某些字段设置为相同的值。是否可以在带有 feign 定义(或其他地方)的界面中使这些值“硬编码”? 我的假声明看起来像这个例子。假设
我是新来的 Spring 和假装和探索几天以来。我能够向我们的 protected 资源(用户名/密码)发出身份验证请求,并在后续请求 header 中使用身份验证服务返回的 JWT token 。但
我尝试在我的 Spring Boot 应用程序上配置 OpenFeign,我使用 pokeapi 进行测试。 我编写了这段代码: @FeignClient(value = "pokeapi", url
快速浏览了Feign的源码,发现Feign使用的是JDK的HttpUrlConnection在不使用连接池的情况下发出 HTTP 请求并在请求完成时关闭它。我怀疑这种方式的效率。然后我看了Spring
我为 feignClients 启用了我的 spring 云,如下所示: @Configuration @EnableAutoConfiguration @RestController @Enable
当我发帖时 Map使用 Feign Client,我收到错误消息: feign.FeignException: status 400 reading MAp . 代码 //Client side @C
目录 使用HttpClient和OkHttp 使用HttpClient 使用OkHttp OpenFeign替换为OkHtt
需求 最近小编的项目中出现了很多feign 调用出现 Read Time out 的异常,但因为没有集成链路追踪的第三方框架,查不到原因。 所以想到打印请求的ip地址,判断是指定的服务器出现的问
我正在使用 spring feign 压缩请求和响应 服务器端: server: servlet: context-path: /api/v1/ compression: en
我面临以下情况,令我惊讶的是,我找不到太多文档:有一项服务仅通过一一获取项目详细信息来提供休息调用。总共有 1000 多个项目。 出于响应能力的原因,我想将这些数据保留在我的一端,而不是懒惰地获取它。
我正在尝试实现一个涉及 FeignClient 调用的单元测试,该调用应返回 404 Not Found。 由于 Feign 抛出了 404 异常,那么实现此测试用例的正确方法是什么? 我正在尝试这样
当使用spring-cloud-feign连接到本地主机时,Feign找不到url,而是给我以下错误消息。 2019-11-13 12:01:55.553 ERROR 23798 --- [n
我是一名优秀的程序员,十分优秀!