Bee Observe
is a REST API with OpenAPI documentation designed to collect information about bee-agent-framework
events in the Opentelemetry format and save them as a Trace entity with additional information about request
, response
etc. to a MongoDB database. This app is built using the Fastify framework.
- 👩💻 Get started with Observe
- 🪑 Local set-up
- 🚀 Run
- 🪑 Setup with OpenTelemetry
- 🧪 Run tests
- 📣 Publishing
- Code of conduct
- Legal notice
- 📖 Docs
The running Observe instance uses the
Redis
,MongoDB
andMlflow
services. See./compose-before.yml
for more info on how to run them.
-
create .env.docker file
Use the
BASE_AUTH
authorization strategy in the production. SeeMLFLOW_AUTHORIZATION
env variable.Use TLS certificate for MongoDB and Redis. See
MONGODB_CA_CERT
andREDIS_CA_CERT
env variables.
Create the .env.docker
file and specify the environment variables. See a list of supported environment variables.
- Start the
observe_api
service
docker run --name observe_api -p 3000:3000 --env-file .env.docker iambeeagent/bee-observe:tagname
- Node.js (version managed using
nvm
) - Yarn package manager (
corepack
) - Docker (we recommend using Rancher Desktop)
- Git
- Clone the repository:
git clone [email protected]:i-am-bee/bee-observe
cd bee-observe
- Use the appropriate Node.js version:
nvm use
- Install dependencies
yarn
-
Prepare .env file Create a .env file in the root directory of the project and configure the necessary environment variables. Copy all (from
.env.example
) and fill in values. -
Run infra To start all necessary services like
redis
,mongo
andmlflow
run this command:
yarn start:infra
- Run migrations
yarn migration:up
- Build the docker image
docker compose build
- Start the
observe_api
service
docker compose up -d
- Build the source code
yarn build
- To start the Fastify server, use the following command:
yarn start
For development mode with hot-reloading, use:
yarn dev
The Observe service can be used only with the bee-agent-framework. See OpenTelemetry Instrumentation in Bee-Agent-Framework for instructions on how to enable the instrumentation there.
For more info on setting up observe service in the OpenTelemetry collector read the Configuration page.
This project uses integration API tests that require a running observe instance to be executed.
yarn test
The coverage
yarn coverage
This project and everyone participating in it are governed by the Code of Conduct. By participating, you are expected to uphold this code. Please read the full text so that you can read which actions may or may not be tolerated.
All content in these repositories including code has been provided by IBM under the associated open source software license and IBM is under no obligation to provide enhancements, updates, or support. IBM developers produced this code as an open source project (not as an IBM product), and IBM makes no assertions as to the level of quality nor security, and will not be maintaining this code going forward.
Read all related document pages carefully to understand the Observer API architecture and limitations.