diff options
author | Colin Smith <Colin.Smith@monitise.com> | 2015-10-09 14:31:20 +0100 |
---|---|---|
committer | Colin Smith <Colin.Smith@monitise.com> | 2015-10-09 14:31:20 +0100 |
commit | a4924ee0607f17bfe5ba61742e035af19c381785 (patch) | |
tree | 91f297a67952f91ffc492bb73ad660787862a174 /kamon-newrelic/src/test/scala/kamon/newrelic | |
parent | 91859be4df789c64ae30ef879b9c6c83503b99c2 (diff) | |
download | Kamon-a4924ee0607f17bfe5ba61742e035af19c381785.tar.gz Kamon-a4924ee0607f17bfe5ba61742e035af19c381785.tar.bz2 Kamon-a4924ee0607f17bfe5ba61742e035af19c381785.zip |
+ newrelic: add ssl support to agent
Use kamon.newrelic.ssl = true to send metrics over https
Diffstat (limited to 'kamon-newrelic/src/test/scala/kamon/newrelic')
3 files changed, 11 insertions, 8 deletions
diff --git a/kamon-newrelic/src/test/scala/kamon/newrelic/AgentSpec.scala b/kamon-newrelic/src/test/scala/kamon/newrelic/AgentSpec.scala index e4289231..063755a8 100644 --- a/kamon-newrelic/src/test/scala/kamon/newrelic/AgentSpec.scala +++ b/kamon-newrelic/src/test/scala/kamon/newrelic/AgentSpec.scala @@ -48,6 +48,7 @@ class AgentSpec extends BaseKamonSpec("metric-reporter-spec") with RequestBuildi | license-key = 1111111111 | connect-retry-delay = 1 second | max-connect-retries = 3 + | ssl = true | } | | modules.kamon-newrelic.auto-start = no @@ -85,14 +86,15 @@ class AgentSpec extends BaseKamonSpec("metric-reporter-spec") with RequestBuildi | "host": "$host", | "identifier": "java:kamon", | "language": "java", - | "pid": $pid + | "pid": $pid, + | "ssl": "true" | } | ] """.stripMargin.parseJson)(sprayJsonMarshaller(JsValueFormat)) }) // Receive the runID - EventFilter.info(message = "Configuring New Relic reporters to use runID: [161221111] and collector: [collector-8.newrelic.com]", occurrences = 1).intercept { + EventFilter.info(message = "Configuring New Relic reporters to use runID: [161221111] and collector: [collector-8.newrelic.com] over: [https]", occurrences = 1).intercept { httpManager.reply(jsonResponse( """ | { @@ -143,7 +145,8 @@ class AgentSpec extends BaseKamonSpec("metric-reporter-spec") with RequestBuildi | "host": "$host", | "identifier": "java:kamon", | "language": "java", - | "pid": $pid + | "pid": $pid, + | "ssl": "true" | } | ] """.stripMargin.parseJson)(sprayJsonMarshaller(JsValueFormat)) @@ -151,7 +154,7 @@ class AgentSpec extends BaseKamonSpec("metric-reporter-spec") with RequestBuildi // Receive the runID EventFilter.info( - message = "Configuring New Relic reporters to use runID: [161221112] and collector: [collector-8.newrelic.com]", occurrences = 1).intercept { + message = "Configuring New Relic reporters to use runID: [161221112] and collector: [collector-8.newrelic.com] over: [https]", occurrences = 1).intercept { httpManager.reply(jsonResponse( """ @@ -202,7 +205,7 @@ class AgentSpec extends BaseKamonSpec("metric-reporter-spec") with RequestBuildi } def rawMethodUri(host: String, methodName: String): Uri = { - Uri(s"http://$host/agent_listener/invoke_raw_method").withQuery( + Uri(s"https://$host/agent_listener/invoke_raw_method").withQuery( "method" -> methodName, "license_key" -> "1111111111", "marshal_format" -> "json", diff --git a/kamon-newrelic/src/test/scala/kamon/newrelic/ConnectJsonWriterSpec.scala b/kamon-newrelic/src/test/scala/kamon/newrelic/ConnectJsonWriterSpec.scala index 1e903e59..cba2bb18 100644 --- a/kamon-newrelic/src/test/scala/kamon/newrelic/ConnectJsonWriterSpec.scala +++ b/kamon-newrelic/src/test/scala/kamon/newrelic/ConnectJsonWriterSpec.scala @@ -34,7 +34,7 @@ class ConnectJsonWriterSpec extends WordSpecLike with Matchers { } } - def agentSettings(appName: String) = AgentSettings("1111111111", appName, "test-host", 1, Timeout(5 seconds), 1, 30 seconds, 1D) + def agentSettings(appName: String) = AgentSettings("1111111111", appName, "test-host", 1, Timeout(5 seconds), 1, 30 seconds, 1D, false) - def expectedJson(appName: String) = s"""[{"identifier":"java:app1","agent_version":"3.1.0","host":"test-host","pid":1,"language":"java","app_name":[$appName]}]""" + def expectedJson(appName: String) = s"""[{"identifier":"java:app1","agent_version":"3.1.0","host":"test-host","ssl":"false","pid":1,"language":"java","app_name":[$appName]}]""" }
\ No newline at end of file diff --git a/kamon-newrelic/src/test/scala/kamon/newrelic/MetricReporterSpec.scala b/kamon-newrelic/src/test/scala/kamon/newrelic/MetricReporterSpec.scala index d4e815e5..ddc6ed69 100644 --- a/kamon-newrelic/src/test/scala/kamon/newrelic/MetricReporterSpec.scala +++ b/kamon-newrelic/src/test/scala/kamon/newrelic/MetricReporterSpec.scala @@ -55,7 +55,7 @@ class MetricReporterSpec extends BaseKamonSpec("metric-reporter-spec") with Spra | """.stripMargin) - val agentSettings = AgentSettings("1111111111", "kamon", "test-host", 1, Timeout(5 seconds), 1, 30 seconds, 1D) + val agentSettings = AgentSettings("1111111111", "kamon", "test-host", 1, Timeout(5 seconds), 1, 30 seconds, 1D, false) val baseQuery = Query( "license_key" -> agentSettings.licenseKey, "marshal_format" -> "json", |