Skip to content

Commit

Permalink
Merge pull request #98 from lucidsoftware/update-datadog-statsd-client
Browse files Browse the repository at this point in the history
use newer version of datadog statsdclient
  • Loading branch information
tmccombs authored Jan 20, 2023
2 parents 22b129f + 398d2db commit 5cd6e7f
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion worker/build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ libraryDependencies ++= Seq(
"joda-time" % "joda-time" % "2.8.1",
"org.joda" % "joda-convert" % "1.7",
"com.typesafe" % "config" % "1.0.0",
"com.datadoghq" % "java-dogstatsd-client" % "2.3",
"com.datadoghq" % "java-dogstatsd-client" % "4.1.0",
"org.scala-lang.modules" %% "scala-collection-compat" % "2.1.6"
)

Expand Down
10 changes: 5 additions & 5 deletions worker/src/main/scala/com/lucidchart/piezo/Worker.scala
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package com.lucidchart.piezo

import com.timgroup.statsd.NonBlockingStatsDClient
import com.timgroup.statsd.{NonBlockingStatsDClient, NonBlockingStatsDClientBuilder}
import java.io._
import java.util.Properties
import java.util.concurrent.{Semaphore, TimeUnit}
Expand Down Expand Up @@ -32,10 +32,10 @@ object Worker {
val scheduler = schedulerFactory.getScheduler()
val props = schedulerFactory.props
val useDatadog = Try(props.getProperty("com.lucidchart.piezo.statsd.useDatadog", "false").toBoolean).getOrElse(false)
val statsd = new NonBlockingStatsDClient(
props.getProperty("com.lucidchart.piezo.statsd.prefix", "applications.piezo.worker"),
props.getProperty("com.lucidchart.piezo.statsd.host", "localhost"),
Try(props.getProperty("com.lucidchart.piezo.statsd.port").toInt).getOrElse(8125)
val statsd = new NonBlockingStatsDClient( new NonBlockingStatsDClientBuilder()
.prefix(props.getProperty("com.lucidchart.piezo.statsd.prefix", "applications.piezo.worker"))
.hostname(props.getProperty("com.lucidchart.piezo.statsd.host", "localhost"))
.port(Try(props.getProperty("com.lucidchart.piezo.statsd.port").toInt).getOrElse(8125))
)
scheduler.getListenerManager.addJobListener(new WorkerJobListener(props, statsd, useDatadog))
scheduler.getListenerManager.addTriggerListener(new WorkerTriggerListener(props, statsd, useDatadog))
Expand Down

0 comments on commit 5cd6e7f

Please sign in to comment.