如何设置 Lightbend 的 Telemetry Developer 沙箱

How to set up Lightbend's Telemetry Developer sandbox

我正在尝试为 Lightbend 提供的遥测设置开发人员沙箱。

从有关遥测的介绍页面 here 可以看出:

Using Lightbend Telemetry is free during development, but you must have a valid license to use it in production. To gain access to the required libraries you need a Lightbend account

这让我相信,在开发过程中可以拥有遥测功能。

同样在沙盒页面 here 中指出:

The developer sandbox is only meant for development and testing purposes and should not be used in production.

但是关于如何设置它的说明很少。我按照说明按照概述进行遥测工作 here 但没有成功。

我正在使用 sbt 1.2.7

到目前为止我所做的包括:

  1. 添加了 Cinnamon 依赖项:

    libraryDependencies ++= Seq( Cinnamon.library.cinnamonCHMetrics, Cinnamon.library.cinnamonCHMetricsElasticsearchReporter, Cinnamon.library.cinnamonSlf4jEvents )

  2. 在 Lightbend.com

  3. 上创建了一个帐户
  4. 在 bintray.com

  5. 上创建了一个帐户
  6. 已在 ~/.lightbend/commercial.credentials 创建了包含以下内容的文件:

    realm = Bintray
    host = dl.bintray.com
    user = <uname> tried both lightbend and bintray username
    password = <pass> tried both lightbend and bintray password
    
  7. 将以下内容添加到 plugins.sbt

    
    addSbtPlugin("com.lightbend.cinnamon" % "sbt-cinnamon" % "2.12.1")
    
    credentials += Credentials(Path.userHome / ".lightbend" / "commercial.credentials")
    
    resolvers += Resolver.url("lightbend-commercial", url("https://repo.lightbend.com/commercial-releases"))(Resolver.ivyStylePatterns)```
    
  8. 将以下内容添加到 build.sbt

      ...
      Cinnamon.library.cinnamonPrometheus,
      Cinnamon.library.cinnamonPrometheusHttpServer
      ...
    )```
    
    and
    
    ```enablePlugins(Cinnamon)```
    

然后当我尝试 运行 应用程序时,构建过程失败并显示以下消息:

[warn] CLIENT ERROR: 401 Unauthorized. Check your resolvers username and password. [warn] module not found: com.lightbend.cinnamon#sbt-cinnamon;2.12.1 [warn] ==== typesafe-ivy-releases: tried [warn] https://repo.typesafe.com/typesafe/ivy-releases/com.lightbend.cinnamon/sbt-cinnamon/scala_2.12/sbt_1.0/2.12.1/ivys/ivy.xml [warn] ==== sbt-plugin-releases: tried [warn] https://repo.scala-sbt.org/scalasbt/sbt-plugin-releases/com.lightbend.cinnamon/sbt-cinnamon/scala_2.12/sbt_1.0/2.12.1/ivys/ivy.xml [warn] ==== local: tried [warn] /home/.ivy2/local/com.lightbend.cinnamon/sbt-cinnamon/scala_2.12/sbt_1.0/2.12.1/ivys/ivy.xml [warn] ==== public: tried [warn] https://repo1.maven.org/maven2/com/lightbend/cinnamon/sbt-cinnamon_2.12_1.0/2.12.1/sbt-cinnamon-2.12.1.pom [warn] ==== local-preloaded-ivy: tried [warn] /home/.sbt/preloaded/com.lightbend.cinnamon/sbt-cinnamon/2.12.1/ivys/ivy.xml [warn] ==== local-preloaded: tried [warn] file:////home/.sbt/preloaded/com/lightbend/cinnamon/sbt-cinnamon_2.12_1.0/2.12.1/sbt-cinnamon-2.12.1.pom [warn] ==== lightbend-commercial: tried [warn] https://repo.lightbend.com/commercial-releases/com.lightbend.cinnamon/sbt-cinnamon/scala_2.12/sbt_1.0/2.12.1/ivys/ivy.xml [warn] :::::::::::::::::::::::::::::::::::::::::::::: [warn] :: UNRESOLVED DEPENDENCIES :: [warn] :::::::::::::::::::::::::::::::::::::::::::::: [warn] :: com.lightbend.cinnamon#sbt-cinnamon;2.12.1: not found [warn] :::::::::::::::::::::::::::::::::::::::::::::: [warn] [warn] Note: Some unresolved dependencies have extra attributes. Check that these dependencies exist with the requested attributes. [warn] com.lightbend.cinnamon:sbt-cinnamon:2.12.1 (scalaVersion=2.12, sbtVersion=1.0) [warn] [warn] Note: Unresolved dependencies path: [warn] com.lightbend.cinnamon:sbt-cinnamon:2.12.1 (scalaVersion=2.12, sbtVersion=1.0) (/home/Documents/masters/large_systems/project/akka-cluster-playground/project/plugins.sbt#L2-3) [warn] +- default:akka-cluster-playground-build:0.1.0-SNAPSHOT (scalaVersion=2.12, sbtVersion=1.0) [error] sbt.librarymanagement.ResolveException: unresolved dependency: com.lightbend.cinnamon#sbt-cinnamon;2.12.1: not found [error] at sbt.internal.librarymanagement.IvyActions$.resolveAndRetrieve(IvyActions.scala:332)

消息中的CLIENT ERROR: 401 Unauthorized 表明此错误主要是由授权问题引起的,但我不确定在哪里修复它。文档中的步骤不是那么详细,所以我也不确定设置沙箱的正确方法是什么。

有人知道如何解决这个问题吗?帮助将不胜感激!

更新 1

发现 this page 谈论凭据,似乎需要进入 ~/.lightbend/commercial.credentials 的是用户名和令牌。但是从 link 来看,令牌似乎只能通过订阅获得。

现在的问题是,遥测指南上一节中关于在开发中使用遥测的可能性的信息是否不正确?如果没有,那么没有订阅怎么办?

您可以contact Lightbend请求评估并了解如何开始使用 Lightbend Telemetry。