Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Example of Cinnamon + DataDog OT integration
/**
* Add the following setting to the application.conf to wire things up.
*
* cinnamon.opentracing {
* tracers = [datadog]
*
* datadog {
* factory-class = "sample.DataDogTracerFactory"
* }
* }
*/
package sample
import com.lightbend.cinnamon.opentracing.TracerFactory
import com.typesafe.config.Config
import datadog.opentracing.DDTracer
import datadog.trace.common.DDTraceConfig
import io.opentracing.Tracer
class DatadogTracerFactory extends TracerFactory {
def create(config: Config): Tracer = {
val serviceName = config.getString("cinnamon.application")
val host = config.getString("cinnamon.opentracing.datadog.host")
val port = config.getInt("cinnamon.opentracing.datadog.port")
val traceConfig = new DDTraceConfig(serviceName)
traceConfig.setProperty(DDTraceConfig.AGENT_HOST, host)
traceConfig.setProperty(DDTraceConfig.AGENT_PORT, port.toString)
new DDTracer(traceConfig)
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.