Skip to content

Commit

Permalink
feat: update observability instructions
Browse files Browse the repository at this point in the history
Signed-off-by: Tomas Dvorak <[email protected]>
  • Loading branch information
Tomas2D committed Oct 11, 2024
1 parent c586e71 commit 616dd1d
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 5 deletions.
8 changes: 7 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,14 +15,20 @@
>
> - [Docker](https://www.docker.com/)
> - [Rancher](https://www.rancher.com/) - macOS users may want to use VZ instead of QEMU
> - [Podman](https://podman.io/) - requires [compose](https://podman-desktop.io/docs/compose/setting-up-compose) and **rootful machine** (if your current machine is rootless, please create a new one)
Get full visibility of the agent's inner working via our observability stack.

- The [MLFlow](https://mlflow.org/) is used as UI for observability.
- The [Bee Observe](https://github.com/i-am-bee/bee-observe) is the main Open-source observability service for Bee Agent Framework.
- The [Bee Observe Connector](https://github.com/i-am-bee/bee-observe-connector) is the observability connector for Bee Agent Framework

Configuration (ENV variables) can be found [here](./infra/observe/.env.docker).

### Steps

1. Start all services related to Observe `npm run infra:start-observe`
2. Start the agent using the observe and MLFlow `npm run start:observe` (it runs ./src/agent_observe.ts file). The output of the `curl` command is saved in the **./tmp/observe/trace.json** file
2. Start the agent using the observe and MLFlow `npm run start:observe` (it runs the `./src/agent_observe.ts` file).
3. Run the `curl` command that retrieves data from Bee Observe and passes them to the `MLFlow` instance.
4. Access MLFlow web application [`http://localhost:8080/#/experiments/`](http://localhost:8080/#/experiments/)
- Credentials: (user: `admin`, password: `password`)
9 changes: 5 additions & 4 deletions src/agent_observe.ts
Original file line number Diff line number Diff line change
Expand Up @@ -56,15 +56,16 @@ try {
console.error(`Agent 🤖 : `, ObserveError.ensure(err).explain());
} else {
const { id, response } = data?.result || {};
console.log(`Agent 🤖 : `, response?.text || "Invalid output");
console.info(`Observe 🔎 : `, response?.text || "Invalid output");

// you can use `&include_mlflow_tree=true` as well to return all sent data to mlflow
console.log(
`Agent 🤖 : Call the Observe API via this curl command outside of this Interactive session and see the trace data in the "trace.json" file: \n\n`,
console.info(
`Observe 🔎 : Call the Observe API via this curl command outside of this Interactive session and see the trace data in the "trace.json" file: \n\n`,
`curl -X GET "${beeObserveApiSetting.baseUrl}/trace/${id}?include_tree=true&include_mlflow=true" \\
\t-H "x-bee-authorization: ${beeObserveApiSetting.apiAuthKey}" \\
\t-H "Content-Type: application/json" \\
\t-o tmp/observe/trace.json`,
\t-o ${process.cwd()}/tmp/observe/trace.json`,
`\n`,
);
}
},
Expand Down

0 comments on commit 616dd1d

Please sign in to comment.