我正在尝试为Lightbend提供的遥测设置开发人员的沙箱。
在有关遥测here的介绍页面中指出:
在开发过程中免费使用Lightbend Telemetry,但您必须具有有效的许可证才能在生产中使用它。要访问所需的库,您需要一个Lightbend帐户
这使我相信,在开发过程中可能具有遥测功能。
在沙盒页面here中也指出:
开发人员沙箱仅用于开发和测试目的,不应在生产中使用。
但是关于如何设置它的指示很少。我按照指示进行了here所述的遥测工作,但未成功。
我正在使用sbt 1.2.7
到目前为止,我所做的包括:
添加了肉桂依赖项:
libraryDependencies ++ = Seq( Cinnamon.library.cinnamonCHMetrics, Cinnamon.library.cinnamonCHMetricsElasticsearchReporter, Cinnamon.library.cinnamonSlf4j事件 )
在Lightbend.com上创建帐户
在bintray.com上创建帐户
在~/.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
在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)```
在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)
客户端错误:401未经授权,表示此错误主要是由授权问题引起的,但是我不确定该在哪里修复。文档中的步骤不是很详细,所以我也不确定设置沙箱的正确方法。
有人知道如何解决此问题吗?帮助将不胜感激!
更新1
发现this page涉及凭证,看来~/.lightbend/commercial.credentials
需要输入的是用户名和令牌。但是从链接来看,令牌似乎仅可用于订阅。
现在的问题是,关于在开发中使用遥测的可能性,遥测指南的上一节中的信息是否正确?如果没有,那么没有订阅怎么办?