Skip to content

i-am-bee/bee-observe

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Bee Observe

Open-source observability service for Bee Agent Framework

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.

Table of Contents

  1. 👩‍💻 Get started with Observe
  2. 🪑 Local set-up
  3. 🚀 Run
  4. 🧪 Run tests
  5. 📣 Publishing
  6. Code of conduct
  7. Legal notice
  8. 📖 Docs

👩‍💻 Get started with Observe

The running Observe instance uses the Redis, MongoDB and Mlflow services. See ./compose-before.yml for more info on how to run them.

  1. create .env.docker file

    Use the BASE_AUTH authorization strategy in the production. See MLFLOW_AUTHORIZATION env variable.

    Use TLS certificate for MongoDB and Redis. See MONGODB_CA_CERT and REDIS_CA_CERT env variables.

Create the .env.docker file and specify the environment variables. See a list of supported environment variables.

  1. Start the observe_api service
docker run --name observe_api -p 3000:3000 --env-file .env.docker iambeeagent/bee-observe:tagname

🪑 Local set-up

Prerequisites

  • Node.js (version managed using nvm)
  • Yarn package manager (corepack)
  • Docker (we recommend using Rancher Desktop)
  • Git

Steps

  1. Clone the repository:
   git clone git@github.com:i-am-bee/bee-observe
   cd bee-observe
  1. Use the appropriate Node.js version:
nvm use
  1. Install dependencies
yarn
  1. 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.

  2. Run infra To start all necessary services like redis, mongo and mlflow run this command:

yarn start:infra
  1. Run migrations
yarn migration:up

🚀 Run

Running the server via Docker

  1. Build the docker image
docker compose build
  1. Start the observe_api service
docker compose up -d

Running the Server via Node.js

  1. Build the source code
yarn build
  1. To start the Fastify server, use the following command:
yarn start

Development Mode

For development mode with hot-reloading, use:

yarn dev

🧪 Run tests

This project uses integration API tests that require a running observe instance to be executed.

yarn test

The coverage

yarn coverage

Code of conduct

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.

Legal notice

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.

📖 Docs

Read all related document pages carefully to understand the Observer API architecture and limitations.