i-am-bee / bee-agent-framework

The framework for building scalable agentic applications.
https://i-am-bee.github.io/bee-agent-framework/
Apache License 2.0
1.09k stars 106 forks source link

feat(instrumentation): add fw metrics #187

Open GALLLASMILAN opened 2 days ago

GALLLASMILAN commented 2 days ago

Description

I added the new custom middleware, that collects module_usage statistics with data about os, version etc. This middleware is enabled by default and sends data about the (agent, llm, tool) entities. Data are automatically sent via the open telemetry SDK that is part of the framework right now, but it's configured only for metrics. I use PeriodicMetric reader, but I need to push the metrics when each run ends. Otherwise, I would drop a lot of metrics because the runtime does not wait for the SDK pushing. This default telemetry can be disabled via the BEE_FRAMEWORK_INSTRUMENTATION_METRICS_DISABLED environment variable. See the new ./docs/docs/native-telemetry.md file for more info.

Checklist