Skip to content
Merged
Show file tree
Hide file tree
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
1 change: 1 addition & 0 deletions docs/starlight-docs/astro.config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,7 @@ export default defineConfig({
items: [
{ label: 'Ingest Your First Traces', link: '/get-started/quickstart/first-traces/' },
{ label: 'Create Your First Dashboard', link: '/get-started/quickstart/first-dashboard/' },
{ label: 'OpenTelemetry Demo Application', link: '/get-started/quickstart/otel-demo/' },
],
},
],
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
---
title: Sending Data from the OpenTelemetry Demo to the Observability Stack
description: Run the OpenTelemetry Demo (Astronomy Shop) against Observability Stack and explore its logs, traces, and metrics in OpenSearch Dashboards.
---

The [OpenTelemetry Demo](https://opentelemetry.io/docs/demo/) is a microservices e-commerce app (the Astronomy Shop) that emits logs, traces, and metrics across services written in Go, Python, Java, .NET, Node.js, Ruby, PHP, and C++. Enable it in Observability Stack to explore the stack with realistic telemetry before you instrument your own services.

The demo ships as an opt-in Docker Compose include file. The stack runs the OTel Collector, Data Prepper, OpenSearch, Prometheus, and OpenSearch Dashboards; enabling the demo adds the Astronomy Shop services and points their telemetry at that pipeline.

## Install and enable the demo

Enabling the demo depends on how you install Observability Stack:

- **Docker Compose:** follow the [installation guide](/docs/get-started/installation/#opentelemetry-demo) and uncomment `INCLUDE_COMPOSE_OTEL_DEMO` in `.env`.
- **Kubernetes (Helm):** set `opentelemetry-demo.enabled=true` (for example, `--set opentelemetry-demo.enabled=true`). See [Kubernetes (Helm)](/docs/deploy/kubernetes/).

For Docker Compose, the demo image version is pinned by `DEMO_VERSION` in `.env`. Change that value to run a different release.

## Generate and view telemetry

The demo's load generator drives traffic automatically, so telemetry starts flowing without any manual steps. To browse the app yourself, open the web store at [http://localhost:8080/](http://localhost:8080/). Then open OpenSearch Dashboards to explore the data.

### Service telemetry dashboard

The **Astronomy shop - service telemetry** dashboard is created for you automatically. Open it from **Dashboards**. It correlates logs and metrics across the demo services: request rate by service, instrumentation SDK breakdown, log volume by severity, log throughput over time, and per-service CPU, memory, and thread counts. Filter by service name or SDK language using the controls at the top.

![Astronomy Shop service telemetry dashboard in OpenSearch Dashboards, showing request rate, instrumentation SDK breakdown, log volume, log throughput over time, and CPU, memory, and thread panels.](./images/astronomy-shop-dashboard.png)

### Application performance (APM)

Open **Services** under Application performance to see the trace-derived service catalog: P50/P90/P99 latency, throughput, and failure rate per service, top services and dependency paths by fault rate, and SLO health. From any row, jump to that service's spans, logs, or service map.
See [Application Performance Monitoring](/docs/apm/) for service maps, SLOs, and the rest of the APM workflow.

![APM Services view showing top services and dependency paths by fault rate, SLO health summary, and a service catalog with latency, throughput, and failure rate per service.](./images/astronomy-shop-apm-services.png)
Comment on lines +29 to +34

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

This restructures the single APM subsection into the ordered six-part showcase (Services → Application Map → Logs → Traces → Metrics), with a header + screenshot placeholder for each and accurate UI nav paths and links. Verified against the repo: nav is Observability > Application Monitoring; page links /docs/apm/services/, /docs/apm/service-map/, /docs/investigate/discover-logs/, /docs/investigate/discover-traces/, /docs/investigate/discover-metrics/ all resolve.

Note: the two PromQL queries are inline code because GitHub one-click suggestions can't contain fenced ``` blocks. If you prefer fenced promql blocks in the final file, I left the fenced versions in the review summary.

Suggested change
### Application performance (APM)
Open **Services** under Application performance to see the trace-derived service catalog: P50/P90/P99 latency, throughput, and failure rate per service, top services and dependency paths by fault rate, and SLO health. From any row, jump to that service's spans, logs, or service map.
See [Application Performance Monitoring](/docs/apm/) for service maps, SLOs, and the rest of the APM workflow.
![APM Services view showing top services and dependency paths by fault rate, SLO health summary, and a service catalog with latency, throughput, and failure rate per service.](./images/astronomy-shop-apm-services.png)
### 2. Application performance — Services
In OpenSearch Dashboards, go to **Observability** > **Application Monitoring** > **Services** to see the trace-derived service catalog: P50/P90/P99 latency, throughput, and failure rate per service, top services and dependency paths by fault rate, and SLO health. From any row, jump to that service's spans, logs, or service map.
![APM Services view showing top services and dependency paths by fault rate, SLO health summary, and a service catalog with latency, throughput, and failure rate per service.](./images/astronomy-shop-apm-services.png)
See [Services](/docs/apm/services/) for details.
### 3. Application performance — Application Map
Open **Observability** > **Application Monitoring** > **Application Map** for a live topology of the Astronomy Shop. Each node is a service and each edge a dependency; color reflects fault or error rate, so a failing service stands out immediately. Group nodes by `telemetry.sdk.language` to see the demo's polyglot services at a glance, and click any node for a health and metrics side panel.
![APM Application Map showing the Astronomy Shop service topology, with nodes colored by fault rate and edges representing service dependencies.](./images/astronomy-shop-service-map.png)
See [Application Map](/docs/apm/service-map/) for details.
### 4. Logs
Open the **Logs** page to query the demo's structured logs with Piped Processing Language (PPL). Filter by service, severity, or trace ID, then aggregate results into a visualization. For example, break down error logs by service to find the noisiest component.
![Logs page in OpenSearch Dashboards showing Astronomy Shop log records queried with PPL, filtered by service and severity.](./images/astronomy-shop-logs.png)
See [Discover Logs](/docs/investigate/discover-logs/) for the full PPL workflow.
### 5. Traces — investigating errors
Open the **Traces** page to explore distributed traces. To generate a clear failure signal, use the [feature flag UI](http://localhost:8080/feature) to enable a fault scenario (for example, `paymentFailure` or `cartFailure`), wait a minute for traffic to hit it, then filter the trace table for errored spans. Select a span's timestamp to open the **Trace Details** flyout, walk the span waterfall to the failing service, and jump to the related logs from the same flyout.
![Traces page showing an errored distributed trace for the Astronomy Shop, with the Trace Details flyout open on the failing span.](./images/astronomy-shop-traces.png)
See [Discover Traces](/docs/investigate/discover-traces/) for span details, the trace detail page, and related-logs correlation.
### 6. Metrics
Open the **Metrics** page to query the demo's Prometheus metrics with PromQL. Use **Explore** mode to browse and discover metric names by service, then switch to **Query** mode to author expressions — for example, per-service request rate with `sum by (service_name) (rate(http_server_request_duration_seconds_count[5m]))`, or P99 latency with `histogram_quantile(0.99, sum by (service_name, le) (rate(http_server_request_duration_seconds_bucket[5m])))`. Metric names depend on each service's instrumentation, so use **Explore** mode to confirm what's present in your deployment before querying.
![Metrics page in Query mode showing a PromQL expression and the resulting per-service request-rate visualization for the Astronomy Shop.](./images/astronomy-shop-metrics.png)
See [Discover Metrics](/docs/investigate/discover-metrics/) for Explore and Query modes and the PromQL builder.


## Access points

| URL | What it is |
|-----|------------|
| [http://localhost:8080/](http://localhost:8080/) | Web store (frontend) |
| [http://localhost:8080/loadgen/](http://localhost:8080/loadgen/) | Load generator UI |
| [http://localhost:8080/feature](http://localhost:8080/feature) | Feature flag UI |
| [http://localhost:5601](http://localhost:5601) | OpenSearch Dashboards |

Use the feature flag UI to toggle the demo's built-in failure scenarios (for example, a payment or cart fault) and watch the error rate change in the dashboards and APM views.

## How the data flows

```mermaid
flowchart LR
Demo[Astronomy Shop services] --> Collector[OTel Collector]
Collector --> DataPrepper[Data Prepper]
Collector --> Prometheus[Prometheus]
DataPrepper --> OpenSearch[OpenSearch]
OpenSearch --> Dashboards[OpenSearch Dashboards]
Prometheus --> Dashboards
```

Services export OTLP to the Collector. The Collector sends logs and traces to Data Prepper, which indexes them into OpenSearch, and sends metrics to Prometheus. OpenSearch Dashboards reads from both.

## Troubleshooting

- **Services restart or exit on startup.** Usually the container runtime is short on memory. Raise its limit to at least 8 GB.
- **Dashboards are empty.** Give the load generator a minute to produce data, then widen the dashboard time range. Confirm the demo services are up with `docker compose ps`.

## Next steps

- [Ingest Your First Traces](/docs/get-started/quickstart/first-traces/) — instrument your own application
- [Create Your First Dashboard](/docs/get-started/quickstart/first-dashboard/) — build custom visualizations
- [Send Data](/docs/send-data/) — more instrumentation and ingestion options
Loading