> ## Documentation Index
> Fetch the complete documentation index at: https://docs.honeycomb.io/llms.txt
> Use this file to discover all available pages before exploring further.

# Goal Agents

> Give your Honeycomb agents ongoing jobs, such as watching each release, and get a finding with evidence when something needs a person.

Goal Agents work on ongoing jobs, called goals, in the background.
For example, you might set a goal that "every checkout service deployment performs as well as the previous deployment."

When a goal run finds something, your team agent records a [finding](https://docs.honeycomb.io/investigate/canvas/findings.md).
Each finding gives you a summary, supporting evidence such as links to queries, traces, or deployments, and suggested next steps.

> [!NOTE]
>
> To use Goal Agents, your team must have [Honeycomb Intelligence](https://docs.honeycomb.io/configure/teams/manage-behavior.md#enable-honeycomb-intelligence) enabled and be on a Pro, Pro Plus, or Enterprise plan, or in an active trial.

## How it works

Each goal has an objective and a list of criteria that describe what healthy looks like.
Each time the goal runs, the agent checks the goal's subjects, usually datasets, against those criteria.

* When it finds a problem, it files a finding with the evidence attached.
* When a later run sees the same problem, it adds to the existing finding instead of filing a new one.
* When everything is healthy, the run ends with a summary and nothing to report.

### Goals from Honeycomb

Honeycomb provides these goals, which you can enable without changes.
Honeycomb releases goals to teams separately, so the goals you see can differ from this list.

| Goal | What it does | When it runs |
| - | - | - |
| **Improve instrumentation** | Audits each dataset for instrumentation gaps that stop your team from answering common questions, following OpenTelemetry standards and semantic conventions. Grades each dataset from A to F. | Once a week |
| **Notice downward trends** | Compares each dataset's latency, error rate, and the Triggers and SLOs that watch it with its own recent history. Reports gradual degradation before it becomes an incident. | Once a week |
| **Surface missing SLOs and triggers** | Reviews which services and failure modes your SLOs and Triggers watch. Reports gaps, such as a service that nothing watches, and proposes the SLO or Trigger that would cover it. | Once a week |
| **Watch a release** | Compares a service's errors and latency before and after each release, and reports a regression while your team can still act on it. | When your deployment pipeline sends a [webhook event](#start-a-goal-from-your-deployment-pipeline) |

You can also [describe a goal in your own words](#describe-a-goal).
Honeycomb hasn't tuned or tested goals that you describe the way it has tested the goals it provides.

### Recommended goals

Each night, Honeycomb checks your team's environments and recommends goals that fit them.
Recommended goals appear on the **Recommended** tab of the **Goal Agents** page.
A recommended goal doesn't run until a team owner enables it.

### Connections and tools

Goals run as your team's agent, not as the person who enabled them.
A goal can use only the connectors that a team owner connected for team agents, and only the tools allowed for them.
A goal that only reads telemetry needs no connectors.

To let a goal use context outside Honeycomb, such as code, tickets, or incidents, or to let it act on a finding, such as filing an issue, connect a [connector](https://docs.honeycomb.io/investigate/canvas/connectors/) for team agents and allow the tools the goal needs.

### Agent hours

Goal runs use your team's agent hours.
Your plan sets the hours included each month.
If your team has agent hours, team owners can see the plan's included hours on the billing page.

### Who can manage goals

| Role | Permissions |
| - | - |
| Team owner | Enable, describe, edit, run, pause, archive, restore, and delete goals |
| Team member | View goals, their run history, and their findings; close and reopen findings |
| Read-only | View goals, their run history, and their findings |

Where team owners see controls to change a goal, team members see **Owners manage goals**.

## View your goals

Navigate to  **Canvas** and select **Goal Agents** in the sidebar.

The **Goal Agents** page lists your team's goals on four tabs: **Active**, **Recommended**, **Paused**, and **Archived**.
Use **Search goals** to find a goal by name.

Each goal shows its state:

| State | Meaning |
| - | - |
| **Watching** | The goal is active and waiting for its next run. |
| **Working** | A run is in progress. |
| **Finishing up** | A run ended, and the goal is waiting to release it. |
| **Paused** | The goal doesn't run until a team owner resumes it. |
| **Archived** | The goal doesn't run. Its run history and findings are kept. |
| **Recommended** | Honeycomb suggests the goal. It doesn't run until a team owner enables it. |

Canvas home also lists your active goals and when each one last ran.

## Enable a goal

If you're a team owner, you can enable a goal from Honeycomb or a recommended goal.

### 1. Start enabling a goal

On the **Goal Agents** page, select **Enable a goal**.
If your team can describe its own goals, the page has **New goal** instead, so select **New goal**, then **Start from a template**.
To enable a recommendation, open it on the **Recommended** tab and select **Enable goal**.

### 2. Choose the goal

In **Goal**, select the goal to enable.

### 3. Choose where it runs

In **Environments**, select at least one environment.

In **Datasets**, select the datasets the goal covers.
To cover every active events dataset in the environments you chose, leave all datasets cleared.
A dataset you select is covered in each chosen environment that has it.
One goal covers every environment and dataset you choose.

Goals don't cover metrics datasets.

### 4. Review the name and schedule

Honeycomb names the goal from your choices.
Change **Name** if you want a different one.

Review **Schedule**, which starts with the goal's default.
For the options, see [Change when a goal runs](#change-when-a-goal-runs).

### 5. Enable it

Select **Enable goal**.
Honeycomb confirms that **The goal is enabled**.
To open the goal, select **Go to the goal**.

If you don't want a recommended goal, select **Not interested** in its menu.
Honeycomb doesn't recommend that goal again.

## Describe a goal

If you're a team owner and your team can describe its own goals, you can describe a goal in plain language, such as "keep checkout fast after deploys."
Honeycomb asks a few questions, then drafts the goal for you to review.

1. On the **Goal Agents** page, select **New goal**, then **Describe a goal**.
   You can also select **Describe a goal** on Canvas home.
2. Describe what you want Honeycomb to keep watch over, or select one of the suggested goals.
3. Answer the questions that Honeycomb asks, such as when the goal runs and which datasets it checks.
   Pick an option, or type your own answer in **Something else**.
4. Review the **Goal summary**: its **Name**, **Objective**, **Healthy looks like**, **Covers**, **Runs**, and **Instructions**.
5. To change the draft, tell Honeycomb what to change, or select **Edit goal**.
6. When the draft is right, select **Activate goal**.

You can also ask [Hexie](https://docs.honeycomb.io/get-started/hexie.md) to create a goal for you.

## Run a goal

An active goal runs on its schedule or when an event arrives.
To start a run yourself, open the goal and select **Run now**.

A goal runs one run at a time.
While a run is in progress, **Run now** is unavailable.
To end a run that is in progress, select **Stop run**.

## Change when a goal runs

1. Open the goal and select **Edit goal**.

2. In **Check-in schedule**, choose an option:

   | Option | When the goal runs |
   | - | - |
   | **Only when I start it** | Only when someone selects **Run now**. |
   | **At a regular interval** | Every set number of hours or days, counted from its latest run, including a run that you start. Runs can be at most 31 days apart. |
   | **On certain days** | On the days and at the time you choose, in the timezone you choose. For example, Monday nights. |
   | **Listen for webhook event** | When your deployment pipeline sends an event with the goal's key. Available for **Watch a release** goals. |

3. Select **Save changes**.

## Start a goal from your deployment pipeline

A **Watch a release** goal starts a check when your deployment pipeline tells Honeycomb that a deployment finished.
The goal opens a case for each new release and first checks it about 10 minutes after the deployment.
It keeps checking for up to about three hours, until it can tell whether the release regressed.

### 1. Turn on the webhook

Open a **Watch a release** goal and select **Edit goal**.
In **Check-in schedule**, choose **Listen for webhook event**, enter a label, and select **Save changes**.

You can also choose **Listen for webhook event** in **Schedule** when you enable the goal.

### 2. Copy the key

Honeycomb shows the goal's webhook key only once, in **Your webhook key**.
Copy it and store it as a secret in your pipeline, such as the GitHub Actions secret `HONEYCOMB_GOAL_WEBHOOK`.
To test the key, run the `curl` command in **Send a test event**.

If the goal covers more than one environment, each event must name its environment in the `environment` field.
If the dataset that holds the service's telemetry has a different name than the service, list the dataset names in `data.datasets`.

### 3. Send an event after each deployment

After each deployment of a service, send a `deployment.finished` event to the Goal Events API endpoint, `POST /1/goals/events`, with the key in the `Authorization` header.
Include `commit_sha` and `previous_version` in `data.attributes`, so the agent can compare the deployed commit with your telemetry and with the version before it.

This example GitHub Actions step reports a deployment of the `checkout` service:

```yaml theme={}
- name: Report the deployment to Honeycomb
  if: success()
  continue-on-error: true
  env:
    HONEYCOMB_GOAL_WEBHOOK: ${{ secrets.HONEYCOMB_GOAL_WEBHOOK }}
  run: |
    curl --fail-with-body --silent --show-error \
      --retry 8 --retry-max-time 300 --retry-connrefused --max-time 30 \
      -X POST https://api.honeycomb.io/1/goals/events \
      -H "Authorization: Bearer $HONEYCOMB_GOAL_WEBHOOK" \
      -H "Content-Type: application/json" \
      -d '{
        "type": "deployment.finished",
        "version": 1,
        "id": "gha-${{ github.run_id }}-${{ github.run_attempt }}-checkout",
        "data": {
          "service": "checkout",
          "service_version": "${{ github.sha }}",
          "attributes": {
            "commit_sha": "${{ github.sha }}",
            "repository": "${{ github.repository }}"
          }
        }
      }'
```

If your team is in the EU region, send events to `https://api.eu1.honeycomb.io/1/goals/events`.

Send the same `id` when you retry an event, so Honeycomb doesn't open a second case.
Send a new `id` for each new deployment.

If you select **Generate New Key**, the previous key stops working immediately.
Update the secret in each pipeline that sends events to the goal.

To stop listening for events, select **Turn off**.
A paused or archived goal ignores the events it receives.

## Read a goal's results

Open a goal to see:

* **Details**: why Honeycomb recommended the goal, its open findings, its subjects, what **Healthy looks like**, and the **Context for the agent**.
* **Run history**: each run, what triggered it, how long it took, its summary, and the findings it created or updated.

Select a run to read its summary.
A run that found nothing worth a finding shows **Nothing to report**.

## Edit a goal

Team owners can change a goal's name, objective, schedule, and the context the agent uses on every run.

1. Open the goal and select **Edit goal**.
2. Change **Name**, **Objective**, **Context for the agent**, or the **Check-in schedule**.
3. Select **Save changes**.

Use **Context for the agent** for facts that a run should always know.
For example, "pricing-service deploys every Tuesday. Ignore p99 spikes under 5 minutes during cache warmup."

## Pause, archive, or delete a goal

Team owners can stop a goal from the menu on its row, or from the menu on its page.

* **Pause** stops a goal until you select **Resume**. It keeps its schedule.
* **Archive** stops a goal and keeps its run history and findings. Select **Restore** to make it active again.
* **Delete** removes a goal and its runs from view everywhere. You can't undo it.
  To keep its history visible, select **Archive instead**.

Pausing, archiving, or deleting a goal also ends its run in progress.
