Get started
You create an observability stack from the Amazon OpenSearch Service console. The console prepares an Amazon CloudFormation stack with the template and parameters filled in, and you confirm it in the Amazon CloudFormation console.
Prerequisites
-
Permissions to create Amazon CloudFormation stacks and the resources listed in What an observability stack creates, including IAM roles.
-
The IAM role that you are signed in with becomes the administrator of the stack's OpenSearch UI application and its data.
Creation methods
- Easy create
-
You enter only a name. The stack uses recommended settings: an Amazon OpenSearch Serverless collection for storage and a workspace that is ready to use.
- Standard create
-
You also choose the storage backend. For more information, see Choose a storage backend.
Both methods include the demo workload unless you clear its check box.
The create page lists every resource that will be created, by name, and the settings that will be used, before you create anything.
Choose a storage backend
The storage backend holds the logs and traces of your stack. Easy create uses an Amazon OpenSearch Serverless collection. With Standard create, you choose between a collection and an OpenSearch Service domain. The domain uses the engine that is optimized for log analytics in Amazon Web Services Regions where that engine is available, and the general purpose engine in other Amazon Web Services Regions. You can't change the backend after the stack is created.
The following table compares what the stack creates for each backend.
| Setting | Amazon OpenSearch Serverless collection | OpenSearch Service domain optimized for log analytics | OpenSearch Service domain on the general purpose engine |
|---|---|---|---|
Capacity |
Scales between 0 and 16 OpenSearch Compute Units (OCUs), and scales down when the stack is idle |
One |
One |
Trace index |
|
|
|
Log and trace retention |
30 days by default |
Not set by the stack |
Not set by the stack |
Alert monitors |
Monitors for the demo workload |
A cluster health monitor, and monitors for the demo workload except |
A cluster health monitor, and monitors for the demo workload |
For more information about each backend, see the following topics:
-
Optimized for log analytics, which includes the Amazon Web Services Regions where the engine is available
For the alert monitors, see Alert monitors that a stack creates.
Create a stack
To create an observability stack
-
Open the Amazon OpenSearch Service console at https://console.aws.amazon.com/aos/home
. -
In the navigation pane, under Observability stack, choose Get started, and then choose Create observability stack.
-
Enter a name for the stack. The name must be 3–17 characters, use only lowercase letters, numbers, and hyphens, start with a letter, and end with a letter or number. Resource names are derived from it.
-
Keep Easy create, or choose Standard create and select the backend.
-
Choose Create in CloudFormation. The Amazon CloudFormation console opens in a new tab with the template and parameters filled in.
-
In the Amazon CloudFormation console, acknowledge that Amazon CloudFormation will create IAM resources, and then choose Create stack. Keep the stack name that is filled in, so that the stack appears in your list of observability stacks.
-
Return to the Amazon OpenSearch Service console. The page shows the progress of each resource. Creation typically takes 15–30 minutes, and you can leave the page while it runs.
When the stack is created, open its workspace in OpenSearch UI from the stack's page. You sign in with your Amazon account. If you deployed the demo workload, sample data starts to appear within a few minutes. To find your way around the workspace, see Use and manage your observability stack.
Send data to your observability stack
Each observability stack has one OpenTelemetry Protocol (OTLP) endpoint, provided by its Amazon OpenSearch Ingestion pipeline. The pipeline sends logs and traces to the stack's storage and metrics to its Prometheus workspace. You don't configure the pipeline yourself.
Find the endpoint
The OTLP endpoint is shown on the stack's page in the Amazon OpenSearch Service console, where you
can copy it. It is also the OSISEndpoint output of the Amazon CloudFormation
stack.
The endpoint has the following form:
https://pipeline-endpoint.region.osis.amazonaws.com
The pipeline accepts each signal on its own path. The paths include the name
that you gave the stack, without the obs- prefix that the pipeline's
own name has:
| Signal | Path |
|---|---|
Logs |
|
Traces |
|
Metrics |
|
Permissions
Requests to the endpoint must be signed with Amazon Signature Version 4 for the
osis service. The IAM principal that sends data needs the
osis:Ingest permission on the stack's pipeline. The pipeline's Amazon
Resource Name (ARN) is the OSISPipelineArn output of the Amazon CloudFormation
stack.
The following JSON policy example grants the osis:Ingest permission
on a stack's pipeline. Replace the placeholder values with your own.
{ "Version": "2012-10-17", "Statement": [ { "Effect": "Allow", "Action": "osis:Ingest", "Resource": "arn:aws:osis:region:account-id:pipeline/obs-stack-name-ingest" } ] }
-
region– The Amazon Web Services Region of the stack, for exampleus-east-1. -
account-id– Your Amazon Web Services account ID. -
stack-name– The name that you gave the observability stack.
Send a test request
To check the endpoint and your permissions before you configure a collector, send
one log record. The following example uses awscurl to send an OTLP log record in
JSON. To get awscurl, see awscurl
awscurl --service osis --regionregion\ -X POST \ -H "Content-Type: application/json" \ -d '{"resourceLogs":[{"resource":{"attributes":[{"key":"service.name","value":{"stringValue":"test"}}]},"scopeLogs":[{"logRecords":[{"timeUnixNano":"time-in-nanoseconds","severityText":"INFO","body":{"stringValue":"test log"}}]}]}]}' \otlp-endpoint/stack-name-ingest/v1/logs
You should see a 200 OK response with an empty JSON object:
{}
A 403 response means that the principal doesn't have the
osis:Ingest permission on the pipeline, or that the request wasn't
signed for the osis service.
Configure an OpenTelemetry Collector
The following YAML configuration example shows the parts of an OpenTelemetry
Collector configuration that export to a stack. It uses the
sigv4auth extension and the otlphttp exporter, which are
included in the OpenTelemetry Collector Contrib distribution. Replace the
placeholder values with your own.
extensions: sigv4auth: region: "region" service: "osis" exporters: otlphttp/logs: logs_endpoint:otlp-endpoint/stack-name-ingest/v1/logs auth: { authenticator: sigv4auth } compression: none otlphttp/traces: traces_endpoint:otlp-endpoint/stack-name-ingest/v1/traces auth: { authenticator: sigv4auth } compression: none otlphttp/metrics: metrics_endpoint:otlp-endpoint/stack-name-ingest/v1/metrics auth: { authenticator: sigv4auth } compression: none service: extensions: [sigv4auth] pipelines: logs: { receivers: [otlp], exporters: [otlphttp/logs] } traces: { receivers: [otlp], exporters: [otlphttp/traces] } metrics: { receivers: [otlp], exporters: [otlphttp/metrics] }
-
region– The Amazon Web Services Region of the stack, for exampleus-east-1. -
otlp-endpoint– The stack's OTLP endpoint, includinghttps://. -
stack-name– The name that you gave the observability stack.
A new pipeline can take several minutes after it becomes active before its endpoint accepts data. Keep the exporter's retry enabled so that data sent during that time isn't dropped.
For how to instrument your applications and for other ways to send telemetry, see Ingesting application telemetry. To send traces from AI agents, see AI observability.
Check that data is arriving
Open the stack's workspace in OpenSearch UI and view your logs and traces. For more information, see Discover Logs and Discover Traces. If you deployed the demo workload, its sample data appears alongside yours.
Learn more
Use the following resources to learn more about sending telemetry data: