Files
floci/docs/services/observabilityadmin.md
T
Priamo Germosen 00230a3612 feat(cloudwatch): start, read, update and stop OTel enrichment (#10130)
Add StartOTelEnrichment, GetOTelEnrichment, UpdateOTelEnrichment and
StopOTelEnrichment over Query, JSON 1.0 and CBOR, with one configuration
per account and Region as the user guide scopes it. Floci stores the
configuration; enriching vended metrics comes next.

Resource tag enrichment, the default, needs ObservabilityAdmin's resource
tags for telemetry running in the Region: a start without it is the
modeled ValidationError with the API reference's sentence, as AWS quotes
no message. EnableTagEnrichment false needs nothing. A start while
running changes nothing, an update replaces both filter lists as a pair
and keeps the stored tag setting it omits, and an update while stopped is
AWS's ResourceNotFoundException "OTel enrichment is not enabled for this
account". A stopped enrichment reads as its status alone.

Filters are validated as the model gives them, every violation listed in
AWS's form, then against the 100 selectors allowed across both lists. A
selector naming metrics without a namespace is refused as a null namespace
over Query too, for metric streams as well, rather than read as no selector.
Over JSON, a filter list sent as something else is refused with the
deserializer's SerializationException, and EnableTagEnrichment sent as a
string is read as the boolean it names or refused, so a malformed update
changes nothing.
Over Query, a filter name XML cannot carry is written as U+FFFD, for
metric streams too.

Part of #7030.
2026-12-03 22:58:23 -04:00

46 lines
4.2 KiB
Markdown

# CloudWatch Observability Admin
Floci implements the REST JSON API of CloudWatch Observability Admin for the resource tags for telemetry feature, which CloudWatch's OpenTelemetry enrichment reads resource tags through. Requests are signed for `observabilityadmin` and served at the same endpoint as every other service.
## Supported Actions
<!-- floci:actions:start -->
| Action | Description |
| --- | --- |
| `StartTelemetryEnrichment` | Starts resource tags for telemetry in the Region, creating its Resource Explorer managed view the first time. |
| `StopTelemetryEnrichment` | Stops resource tags for telemetry in the Region. |
| `GetTelemetryEnrichmentStatus` | Returns the feature's status, and its managed view's ARN while it runs. |
<!-- floci:actions:end -->
## Behavior
- The feature is one switch per account and Region. `StartTelemetryEnrichment` answers `202` with `Status` `Running` and the ARN of its Resource Explorer managed view, `StopTelemetryEnrichment` answers `202` with `Status` `Stopped`, and `GetTelemetryEnrichmentStatus` answers the current `Status` with the view's ARN while the feature runs, as the output's documentation gives it "if the feature is enabled".
- Starting the feature has Resource Explorer create "an AWS index and managed view that indexes and discovers resources and tags in your account", as the CloudWatch user guide's "Resource tags for telemetry" says. The index is a `LOCAL` one, created only when the Region has none, and the view includes the `tags` property. `resource-explorer-2` serves the view: `GetManagedView` answers it and `ListManagedViews` lists it.
- AWS documents the view but not its name, so Floci names it `AWSManagedViewForResourceTagsForTelemetry`, in the form of the one managed view the Resource Explorer guide names, `AWSManagedViewForSSM`. Its ARN is `arn:<partition>:resource-explorer-2:<region>:<account>:managed-view/AWSManagedViewForResourceTagsForTelemetry/<uuid>`. Its `TrustedService` is `telemetry-enablement.observabilityadmin.amazonaws.com`, the principal of the service-linked role whose policy (`AWSObservabilityAdminTelemetryEnablementServiceRolePolicy`) grants the feature `resource-explorer-2:CreateManagedView`.
- The view outlives a stop: a feature stopped and started again answers the view its first start created.
- CloudWatch's `StartOTelEnrichment` with resource tag enrichment needs the feature running in the same Region; see [OTel enrichment](cloudwatch.md#otel-enrichment). Stopping the feature leaves CloudWatch enrichment that already runs as it is.
- `GetTelemetryEnrichmentStatus` for a feature never started in the Region answers `ResourceNotFoundException` (404), the operation's modeled answer before the first start. Stopping a feature that is stopped, or was never started, answers `Stopped` and changes nothing, so a feature never started still reads as never started.
- Floci changes the feature's state at once, so it is never caught between `Running` and `Stopped`, is never `Impaired`, and no request answers `ConflictException`.
## IAM
Under IAM enforcement (`floci.services.iam.enforcement-enabled`), each request is checked as its `observabilityadmin:` action, from the routes and request resources generated from botocore and the AWS Service Reference. The three actions act on no resource type and are checked on `*`. A refusal is `AccessDeniedException` with the 400 status the model declares for the service.
## Not implemented
Telemetry rules, telemetry evaluation, centralization rules, telemetry pipelines, S3 table integrations, dataset integrations, third-party telemetry enrichment and resource telemetry listing are not emulated yet. Starting the feature does not grant Resource Explorer streaming access to a service.
## Example
```bash
export AWS_ENDPOINT_URL=http://localhost:4566
aws observabilityadmin start-telemetry-enrichment
aws observabilityadmin get-telemetry-enrichment-status
aws resource-explorer-2 get-managed-view --managed-view-arn "$(aws observabilityadmin \
get-telemetry-enrichment-status --query AwsResourceExplorerManagedViewArn --output text)"
aws observabilityadmin stop-telemetry-enrichment
```
See the [CloudWatch Observability Admin API Reference](https://docs.aws.amazon.com/cloudwatch/latest/observabilityadmin/Welcome.html).