All Downloads are FREE. Search and download functionalities are using the official Maven repository.

io.opencensus.scala.elastic4s.implicits.scala Maven / Gradle / Ivy

package io.opencensus.scala.elastic4s

import com.sksamuel.elastic4s.ElasticClient
import io.opencensus.trace.Span

object implicits {

  implicit class ClientWithTracing(elastiClient: ElasticClient) {

    /**
      * Enriches the `ElasticClient` with tracing `.execute` calls.
      *
      * @param parentSpan the current span which will act as parent of the new span
      */
    def traced(parentSpan: Span): ElasticClient =
      TracingElasticClient(elastiClient, Some(parentSpan))

    /**
      * Enriches the `ElasticClient` with tracing `.execute` calls.
      */
    def traced: ElasticClient =
      TracingElasticClient(elastiClient, None)

  }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy