【问题标题】:Google Cloud Java Client for Stackdriver Trace用于 Stackdriver Trace 的 Google Cloud Java 客户端
【发布时间】:2019-01-18 04:44:46
【问题描述】:

我在 GKE 中运行我的 spring boot(1.4 版本)应用程序。我在我的 pom.xml 中添加了以下依赖项

<dependency>
  <groupId>com.google.cloud</groupId>
  <artifactId>google-cloud-trace</artifactId>
  <version>0.56.0-beta</version>
</dependency>

我通过在服务帐户(key.json 文件)中启用堆栈驱动程序跟踪并将其设置在我的环境变量(GOOGLE_APPLICATION_CREDENTIALS)中来设置身份验证。

我没有看到来自我的应用程序的任何痕迹,也没有在日志中看到任何异常。我是否遗漏了什么或者是否有任何相同的工作示例?

【问题讨论】:

    标签: spring-boot google-cloud-platform google-cloud-stackdriver


    【解决方案1】:

    添加该依赖项不足以开始自动收集跟踪。需要加spring-cloud-gcp-starter-trace

    <dependency>
        <groupId>org.springframework.cloud</groupId>
        <artifactId>spring-cloud-gcp-starter-trace</artifactId>
    </dependency>
    

    请参阅 Spring Cloud GCP docs

    【讨论】:

    • 此外,它仅适用于 springboot 2.0 或更高版本
    猜你喜欢
    • 2020-03-28
    • 2020-07-08
    • 2019-10-11
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2014-08-11
    • 2019-01-07
    • 2020-02-04
    相关资源
    最近更新 更多