Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Beacon Agent: improvements #6415

Draft
wants to merge 3 commits into
base: develop
Choose a base branch
from
Draft
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,6 @@ Before you begin, you need to have the following:
* The access key for a machine user with the `estate ingester` role assigned to it. For more information, see [Creating a machine user](create-machine-user).
* The project ID for the project you want to monitor. You can find this in the URL when you are in the project in the EDB Postgres AI Console.



## Enable your system to download packages

You need to enable the system you are planning on running the agent on to download packages from the EDB repositories for EDB Postgres AI.
Expand Down Expand Up @@ -75,7 +73,7 @@ Create a Beacon configuration directory in your home directory:
mkdir ${HOME}/.beacon
```

Next, configure Beacon Agent by setting the access key (the one you obtained while [Creating a machine user](create-machine-user/)) and project ID:
Next, set the user access key (the one you obtained while [Creating a machine user](create-machine-user/)) and project ID:

```
export BEACON_AGENT_ACCESS_KEY=<your-access-key>
Expand All @@ -84,9 +82,9 @@ export BEACON_AGENT_PROJECT_ID=<your-project-id>

These environment variables are used when you run the `beacon-agent setup` command to create a configuration file in the Beacon configuration directory.

You also need to specify the Beacon configuration directory for storing the configuration file and the name of the configuration file to generate there.
Use the `-file` flag to provide the created configuration directory as well as the name of the configuration file that you want the agent setup process to use for the file generation.

The `$HOME/.beacon/` file is one of the default locations which `beacon_agent` searches for `beacon_agent.yaml` when it starts.
Using the `-file` flag tells the agent setup process to create its configuration file in a specific location.

```
beacon-agent setup -file="$HOME/.beacon/beacon_agent.yaml"
Expand All @@ -98,13 +96,31 @@ Upon a successful registration, you should see a message indicating that you hav

## Configure database connections

Create DSN/connection strings for each database you want to monitor. These should include the database name, the user, the password, the host, and the port. For example:
For the Beacon Agent to be able to read your database, you must provide the connection details in the form of a connection string or DNS in the `beacon_agent.yaml` configuration file.

Create a connection string or DSN for each database you want to monitor. These should include the database type, database name, user, password, host, and port.

**Connection string example:**

```
"user=postgres password=postgres dbname=postgres host=localhost port=5432"
```

You can also use a DSN in the format `postgres://user:password@host:port/dbname`.
**DSN example:**

Ensure the DSN follows the `<database_type>://<user>:<password>@<host>:<port>/<database_name>` format.

!!!note
The `<database_type>` can be `postgresql`, or `oracle`.
!!!

Example:

```
postgresql://postgres:<password>@localhost:5432/postgres
```

As DSNs can contain sensitive information such as the password, its best practice to create an environmental variable for each database you want to monitor and set each to the a corresponding DSN.
If you don't want your password to be visible in the `beacon_agent.yaml` file, its best practice to create an environment variable for each database you want to monitor and set each to the corresponding DSN.

```shell
export DSN1=<dsn1>
Expand Down