http在NewRelic中未显示指标

http在NewRelic中未显示指标

本文介绍了akka-http在NewRelic中未显示指标的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试使用NewRelic监视我的akka​​-http Rest网络服务

I'm trying to monitor my akka-http Rest web-service with NewRelic

该应用程序只有一个 GET网址(由akka-http定义)

The application has only one GET url (defined with akka-http)

我在 plugins.sbt

logLevel := Level.Warn
addSbtPlugin("com.typesafe.sbt" % "sbt-native-packager" % "1.0.4")
addSbtPlugin("com.gilt.sbt" % "sbt-newrelic" % "0.1.4")

我在 build.sbt

scalaVersion := "2.11.7"
name := "recommender-api"

...blablabla...

libraryDependencies += "com.typesafe.akka" % "akka-actor_2.11" % "2.4.2"
libraryDependencies += "com.typesafe.akka" % "akka-http-experimental_2.11" % "2.4.2"
libraryDependencies += "com.typesafe.akka" % "akka-http-spray-json-experimental_2.11" % "2.4.2"
libraryDependencies += "com.typesafe.akka" % "akka-slf4j_2.11" % "2.4.2"

newrelicIncludeApi := true
newrelicAppName := name.toString
enablePlugins(JavaServerAppPackaging, UniversalDeployPlugin, NewRelic)

我使用 sbt Universal:publish 编译(并部署)代码,它创建一个.zip,在.zip内部有一个可执行文件.

I compile (and deploy) the code with sbt universal:publish, it creates a .zip, inside the .zip there is an executable file.

我通过环境(NEW_RELIC_LICENSE_KEY)传递了newRelic licenceKey

I pass the newRelic licenceKey by enviroment (NEW_RELIC_LICENSE_KEY)

程序启动并且一切正常,找到了newRelic密钥(因为日志没有说没有找到密钥)

The program starts and all works fine, the newRelic key is found (because the log dosen't say that it didn't find the key)

newRelic监视系统中的正确应用将显示正确的

The aplication apears in the newRelic monitor system with the correct name

但是NewRelic没有显示任何指标

我该怎么做才能查看有关NewRelic的一些指标?

推荐答案

我真的不知道我做了什么工作,所做的更改是:

I realy don't know what I did to make it work, the changes I made were:

在build.sbt

In the build.sbt

newrelicVersion := "3.26.1"
newrelicAppName := "recommenders-jobs-api-monitor"

在plugin.sbt

In the plugin.sbt

addSbtPlugin("com.gilt.sbt" % "sbt-newrelic" % "0.1.5")

(我更新了de sbt-newrelic版本)
(我为新的遗物应用命名了)
(我指定了Java Agent的版本)

(I updated de sbt-newrelic version)
(I harcoded the name of the new relic app)
(I specified the version of the Java Agent)

这篇关于akka-http在NewRelic中未显示指标的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-15 10:15