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

docs: Document telemetry #4972

Open
wants to merge 11 commits into
base: main
Choose a base branch
from
3 changes: 2 additions & 1 deletion website/content/docs/concepts/filtering/events.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,8 @@ and the second event is an observation event.

To filter an event sink which was configured for every event type to
only include the above events, use the following sink configuration:
```

```hcl
sink "stderr" = {
name = "all-events"
description = "All events sent to stderr"
Expand Down
70 changes: 70 additions & 0 deletions website/content/docs/configuration/events/configure-events.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
---
layout: docs
page_title: Configure events
description: >-
Configure log event sinks for controllers and workers to monitor Boundary resources and actions.
---

# Configure event logging

The [`events`](/boundary/docs/configuration/events) stanza lets you log system information in a well-defined, structured format that gives you visibility into emitted events.

You configure emitted events and sinks in the configuration file for any [controller](/boundary/docs/configuration/controller) or [worker](/boundary/docs/configuration/worker) server.
Complete the following steps to configure events:

1. Open the configuration file for the controller or worker server that you want to emit events.
1. Edit the `events` stanza in the configuration file.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this should be item 2

Copy link
Contributor Author

@Dan-Heath Dan-Heath Nov 12, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah yeah, our Markdown standard is a little wonky. That still renders as numbers 2 and 3. It should be OK in the preview deployment:

image

Set the following to `true` to emit that type of event, and then configure any sinks:
- `audit_enabled` - Specifies if Boundary emits audit events.
- `observations_enabled` - Specifies if Boundary emits observation events.
- `sysevents_enabled` - Specifies if Boundary should emit system events.
- `telemetry_enabled` - Specifies if Boundary should emit telemetry events.
To receive telemetry events, you must also set `observations_enabled` to `true`.
1. Save the file.
stellarsquall marked this conversation as resolved.
Show resolved Hide resolved

The following example includes the contents of the `events` stanza in the `compose/controller.hcl` configuration file:

<CodeBlockConfig hideClipboard>

```hcl
events {
audit_enabled = true
observations_enabled = true
sysevents_enabled = true
telemetry_enabled = true

sink "stderr" {
name = "all-events"
description = "All events sent to stderr"
event_types = ["*"]
format = "cloudevents-json"
}

sink {
name = "controller-audit-sink"
description = "Audit sent to a file"
event_types = ["audit"]
format = "cloudevents-json"

file {
path = "/logs"
file_name = "controller.log"
}

audit_config {
audit_filter_overrides {
secret = "encrypt"
sensitive = "hmac-sha256"
}
}
}
}
```

</CodeBlockConfig>

## More information

Refer to the `events` stanza [Overview](/boundary/docs/configuration/events) for more information about monitoring events for a controller or worker.

Refer to [Telemetry data](/boundary/docs/configuration/events/telemetry-data) for a list of the events and data you can track by enabling telemetry events.
47 changes: 31 additions & 16 deletions website/content/docs/configuration/events/index.mdx
Original file line number Diff line number Diff line change
@@ -1,14 +1,33 @@
---
layout: docs
page_title: Controller/worker - events
description: |-
The events stanza configures events-specific parameters.
description: >-
Learn about using the events stanza to configure events-specific parameters.
---

# `events` stanza

You can log system information in a well-defined, structured format that give you visibility into emitted events.
You configure emitted events and sinks in the configuration file for any [controller](/boundary/docs/configuration/controller) or [worker](/boundary/docs/configuration/worker) server.
The `events` stanza configures Boundary events-specific parameters.

You can specify what types of events Boundary should emit:

- `audit_enabled` - Specifies if Boundary emits audit events.
- `observations_enabled` - Specifies if Boundary emits observation events.
- `sysevents_enabled` - Specifies if Boundary should emit system events.
- `telemetry_enabled` - Specifies if Boundary should emit telemetry events.
To receive telemetry events, you must also set `observations_enabled` to `true`.

Event sinks provide a location for Boundary to write events to.
You can configure sinks to allow or deny specific event types using filter syntax:

- `sink` - Specifies the configuration of an event sink.
Currently, two types of sinks are supported: [file](/boundary/docs/configuration/events/file) and [stderr](/boundary/docs/configuration/events/stderr).

You can repeat the `sink` stanza more than once to send events to multiple sinks, but each file sink must have a unique path and file name.
If no sinks are configured, then all events will be sent to a default [stderr](/boundary/docs/configuration/events/stderr) sink.

Example:

```hcl
Expand All @@ -35,20 +54,6 @@ events {
}
```

- `audit_enabled` - Specifies if audit events should be emitted.

- `observations_enabled` - Specifies if observation events should be emitted.

- `sysevents_enabled` - Specifies if system events should be emitted.

- `telemetry_enabled` - Specifies if telemetry events should be emitted.
To receive telemetry events, you must also set `observations_enabled` to `true`.

- `sink` - Specifies the configuration of an event sink. Currently, two types of
sink are supported: [file](/boundary/docs/configuration/events/file) and [stderr](/boundary/docs/configuration/events/stderr). If no sinks are configured then all
events will be sent to a default [stderr](/boundary/docs/configuration/events/stderr) sink. Events may be sent to multiple
sinks.

## Default events stanza

If no event stanza is specified then the following default is used:
Expand All @@ -66,3 +71,13 @@ events {
}
}
```

## Next steps

Refer to [Configure event logging](/boundary/docs/configuration/events/configure-events) to configure a controller or worker server to emit events.

Refer to [Telemetry data](/boundary/docs/configuration/events/telemetry-data) for a list of the events and data you can track by enabling telemetry events.

## Tutorial

Refer to the [Event filtering and sink configuration](/boundary/tutorials/self-managed-deployment/event-logging) tutorial to learn how to define an event sink and configure logging.
Loading
Loading