OpenTelemetry counter #34096
-
Hello, I'm new to OpenTelemetry, and I'm trying to create a simple counter to send metrics to Datadog. Here is my Kotlin code: import io.opentelemetry.api.OpenTelemetry
import io.opentelemetry.api.metrics.LongCounter
import jakarta.enterprise.context.ApplicationScoped
import jakarta.inject.Inject
@ApplicationScoped
class Metrics @Inject constructor(private val openTelemetry: OpenTelemetry) {
fun incrementCounter() {
val counter: LongCounter = openTelemetry.getMeter("my-metrics")
.counterBuilder("counter")
.build()
counter.add(1)
}
} And the Quarkus configuration: quarkus:
otel:
sdk:
disabled: false
exporter:
otlp:
traces:
endpoint: ${OTEL_EXPORTER_OTLP_ENDPOINT} When I run it, the counter is an instance of It seems that the Any ideas? Thanks in advance for your help :) |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 1 reply
-
/cc @brunobat (opentelemetry), @evanchooly (kotlin), @geoand (kotlin), @radcortez (opentelemetry) |
Beta Was this translation helpful? Give feedback.
-
Quarkus doesn't support Micrometer metrics yet. |
Beta Was this translation helpful? Give feedback.
Quarkus doesn't support Micrometer metrics yet.
You can use Micrometer metrics and the quarkiverse OTLP registry to send the output in an OTel compatible format.