Uploaded image for project: 'Nuxeo Platform'
  1. Nuxeo Platform
  2. NXP-28180

Make Datadog Reporter disabled if no apikey configured

    XMLWordPrintable

    Details

    • Type: Improvement
    • Status: Resolved
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 11.1, 2021.0
    • Component/s: Datadog

      Description

      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");
      

        Attachments

          Activity

            People

            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Time Tracking

                Estimated:
                Original Estimate - Not Specified
                Not Specified
                Remaining:
                Remaining Estimate - 0 minutes
                0m
                Logged:
                Time Spent - 1 day
                1d