Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/i-am-bee/bee-observe

Observability API server for bee-agent-framework
https://github.com/i-am-bee/bee-observe

ai bee-agent-framework bee-observe mlflow

Last synced: about 17 hours ago
JSON representation

Observability API server for bee-agent-framework

Awesome Lists containing this project

README

        



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](#-get-started-with-observe)
2. [๐Ÿช‘ Local set-up](#-local-set-up)
- [Prerequisites](#prerequisites)
- [Steps](#steps)
3. [๐Ÿš€ Run](#-run)
- [Running the server via Docker](#running-the-server-via-docker)
- [Running the Server via Node.js](#running-the-server-via-nodejs)
- [Development Mode](#development-mode)
4. [๐Ÿงช Run tests](#-run-tests)
5. [๐Ÿ“ฃ Publishing](#-publishing)
6. [Code of conduct](#code-of-conduct)
7. [Legal notice](#legal-notice)
8. [๐Ÿ“– Docs](#-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](./.env.example).

2. 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](https://rancherdesktop.io/))
- Git

### Steps

1. Clone the repository:

```bash
git clone [email protected]:i-am-bee/bee-observe
cd bee-observe
```

2. Use the appropriate Node.js version:

```
nvm use
```

3. Install dependencies

```
yarn
```

4. 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.

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

```
yarn start:infra
```

6. Run migrations

```
yarn migration:up
```

### ๐Ÿš€ Run

#### Running the server via Docker

1. Build the docker image

```
docker compose build
```

2. Start the `observe_api` service

```
docker compose up -d
```

#### Running the Server via Node.js

1. Build the source code

```
yarn build
```

2. 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](./CODE_OF_CONDUCT.md). By participating, you are expected to uphold this code. Please read the [full text](./CODE_OF_CONDUCT.md) 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.

- [Overview](./docs/overview.md)
- [API](./docs/api.md)
- [Data persistence](./docs/data-persistence.md)