I’m curious how people are addressing billing/mete...
# koog-agentic-framework
f
I’m curious how people are addressing billing/metering with Koog. I was initially using a custom executor that handled metering. But I was wondering if people are using metering pass through nodes or installing custom AIFeature’s. Is there a recommended approach?
v
Have you tried https://docs.koog.ai/opentelemetry-support/ Apart from https://docs.koog.ai/opentelemetry-langfuse-exporter/ and https://docs.koog.ai/opentelemetry-weave-exporter/ you can also just consume OpenTelemetry events by yourself, which contain information about used tokens. Alternatively, you can also https://docs.koog.ai/tracing/ and in your
FeatureMessageProcessor
in
override uspend fun processMessage(message: FeatureMessage)
you have to handle
LLMCallCompletedEvent
which has
responses: List<Message.Response>
. Each response has
val metaInfo: ResponseMetaInfo
that has the information you need:
Copy code
public val totalTokensCount: Int? = null,
    public val inputTokensCount: Int? = null,
    public val outputTokensCount: Int? = null,
Does that help?
f
Hey Vadim! Yes that helps I think I will try the opentelemetry feature
kodee happy 1