Skip to content

Commit

Permalink
add prometheus label for grpc status (#138)
Browse files Browse the repository at this point in the history
  • Loading branch information
Zen Yui authored Dec 2, 2020
1 parent 9c89a9e commit 0bf3207
Showing 1 changed file with 4 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,9 @@ import io.opentracing.Tracer
import io.opentracing.util.GlobalTracer

case class TelemetryTools(config: Config, serviceName: String) {

val GRPC_STATUS_LABEL: String = "grpc.status"

val logger: Logger = LoggerFactory.getLogger(getClass)
// create a composite registry
val compositeRegistry = new CompositeMeterRegistry()
Expand All @@ -22,6 +25,7 @@ case class TelemetryTools(config: Config, serviceName: String) {
.newMetricsReporter()
.withRegistry(compositeRegistry)
.withName(serviceName)
.withTagLabel(GRPC_STATUS_LABEL, "")
.build()
// create & register jaeger tracer
val jaegerTracer: Tracer = io.jaegertracing.Configuration.fromEnv().getTracer
Expand Down

0 comments on commit 0bf3207

Please sign in to comment.