-
Type: Improvement
-
Status: Resolved
-
Priority: Major
-
Resolution: Fixed
-
Affects Version/s: None
-
Component/s: Datadog
-
Epic Link:
-
Tags:
-
Team:PLATFORM
-
Sprint:nxplatform 11.1.21, nxplatform 11.1.22
-
Story Points:2
When installing nuxeo-datadog-reporter on a Nuxeo server without configuring the datadog.apikey property, the server logs is filled with
2019-10-18T16:03:01,789 ERROR [DatadogReporter] Error reporting metrics to Datadog java.lang.IllegalArgumentException: Illegal character in query at index 49: https://app.datadoghq.com/api/v1/series?api_key=${datadog.apikey} at java.net.URI.create(URI.java:883) ~[?:?] at org.apache.http.client.methods.HttpPost.<init>(HttpPost.java:73) ~[httpclient-4.5.6.jar:4.5.6] at org.apache.http.client.fluent.Request.Post(Request.java:96) ~[fluent-hc-4.3.2.jar:4.3.2] at org.coursera.metrics.datadog.transport.HttpTransport$HttpRequest.send(HttpTransport.java:102) ~[metrics-datadog-1.0.2.jar:?] at org.coursera.metrics.datadog.DatadogReporter.report(DatadogReporter.java:96) [metrics-datadog-1.0.2.jar:?] at com.codahale.metrics.ScheduledReporter.report(ScheduledReporter.java:237) [metrics-core-4.0.3.jar:4.0.3] at com.codahale.metrics.ScheduledReporter.lambda$start$0(ScheduledReporter.java:177) [metrics-core-4.0.3.jar:4.0.3] at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:515) [?:?] at java.util.concurrent.FutureTask.runAndReset(FutureTask.java:305) [?:?] at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:305) [?:?] at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128) [?:?] at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628) [?:?] at java.lang.Thread.run(Thread.java:834) [?:?] Caused by: java.net.URISyntaxException: Illegal character in query at index 49: https://app.datadoghq.com/api/v1/series?api_key=${datadog.apikey} at java.net.URI$Parser.fail(URI.java:2915) ~[?:?] at java.net.URI$Parser.checkChars(URI.java:3086) ~[?:?] at java.net.URI$Parser.parseHierarchical(URI.java:3174) ~[?:?] at java.net.URI$Parser.parse(URI.java:3116) ~[?:?] at java.net.URI.<init>(URI.java:600) ~[?:?] at java.net.URI.create(URI.java:881) ~[?:?] ... 12 more
If the datadog.apikey is not present, the Datadog reporter must be disabled and must not try any call on Datadog.
At the server startup, log something like:
log.warn("Missing Datadog API key: Datadog Reporter disabled");