# Sending OpenTelemetry Demo data to Last9

> Learn how to connect the OpenTelemetry demo microservices application with Last9 to gain immediate insights through traces, metrics, and logs visualization.

Source: https://last9.io/docs/integrations/observability/sending-opentelemetry-demo-data-to-last9/

The OpenTelemetry Demo is a fully instrumented microservices application that simulates an e-commerce platform. By connecting this demo to Last9, you'll experience how comprehensive observability works across distributed systems without modifying application code. This integration takes approximately 5-10 minutes to complete and requires basic familiarity with command line operations.

## Prerequisites

1. **Last9 Account**: [Create an account](https://app.last9.io/) to access the observability platform
2. **Last9 Cluster**: Set up your monitoring environment by following the [Getting Started guide](/docs/onboard/)
3. **OpenTelemetry Credentials**: Retrieve your unique authorization details from the [Integrations page](https://app.last9.io/integrations?integration=OpenTelemetry) (you'll need these for the collector configuration)

**System Requirements**: Docker (or Kubernetes), 4GB+ available RAM, and Git installed on your local system.

## Steps

1. ### Clone the OpenTelemetry Demo Repository

   First, clone the [OpenTelemetry demo repository](https://github.com/open-telemetry/opentelemetry-demo), which contains a pre-instrumented e-commerce application with 12+ microservices that generate traces, metrics, and logs.

   ```bash
   git clone https://github.com/open-telemetry/opentelemetry-demo.git
   cd opentelemetry-demo
   ```

   This demo simulates a complete shopping application with frontend, product catalog, cart, checkout, shipping, and payment services—all generating realistic telemetry data.

2. ### Configure OpenTelemetry Collector with Last9 Integration

   Now, configure the OpenTelemetry Collector to forward telemetry data to your Last9 account. Create or edit the file `src/otel-collector/otel-config-extras.yml` with the following configuration. Replace `<Endpoint>` and `<Authorization Header>` with the credentials you obtained from the Last9 Integrations page:

   ```yaml
   exporters:
     otlp/last9:
       endpoint: "<Endpoint>"
       headers:
         "Authorization": "Basic <Authorization Header>"

   service:
     pipelines:
       traces:
         exporters: [spanmetrics, otlp/last9]
       metrics:
         exporters: [otlp/last9]
       logs:
         exporters: [otlp/last9]
   ```

   **What this does:** The collector automatically combines this configuration with the default one in `otel-config.yml`. Your configuration adds Last9 as an export destination while preserving the demo's original functionality. The three pipeline sections ensure all telemetry types (traces, metrics, and logs) are sent to Last9.

3. ### Launch the Demo Application

   The demo application runs a complete microservices architecture with a web frontend, multiple backend services, and databases—all pre-instrumented with OpenTelemetry.

   - **Using Docker** (recommended for first-time setup)

     ```bash
     docker compose up --force-recreate --remove-orphans --detach
     ```

     This command starts all services locally. The first run will take 5-10 minutes as it downloads and builds containers. Subsequent starts will be faster.

     Resource usage: This demo runs 15+ containers and requires approximately 4GB of RAM.

   - **Using Kubernetes**: For production-like deployments, refer the [OTel Demo K8s deployment guide](https://opentelemetry.io/docs/demo/kubernetes-deployment/) and follow the configuration in the [Last9 Kubernetes Integration guide](https://app.last9.io/integrations?integration=Last9+Otel+Collector+Setup+for+Kubernetes)

   **How to verify:** After startup completes, you should see all containers running with docker ps. The frontend will be available at `http://localhost:8080`.

4. ### Verify Data Flow in Last9

   - Access the demo application at `http://localhost:8080` to see the frontend
   - Wait approximately 2-3 minutes for the first data to appear in Last9 (the demo's built-in load generator automatically creates traffic)
   - Open [Traces Explorer](https://app.last9.io/traces/) in Last9 and look for:
     - Service names like `frontend`, `productcatalogservice`, and `checkoutservice`
     - Operation names such as `Get /product` or `Cart/AddItem`

   **Troubleshooting:** If no data appears after 5 minutes, check your authorization credentials and verify all containers are running with `docker ps`.

5. ### Explore the Demo in Last9

   Now that your demo is sending data to Last9, explore these key observability features:

   - [Traces Explorer](https://app.last9.io/traces/): View end-to-end request flows across services
     - Try filtering for frontend service to see customer-facing requests
     - Look for traces with errors to see how failures propagate through services
   - [Logs Explorer](https://app.last9.io/logs/): Search and analyze application logs
     - Filter by service name to see logs from specific components
     - Search for "error" to identify issues without browsing traces
   - [Dashboards](https://app.last9.io/dashboards/): Monitor key performance metrics
     - Create a dashboard showing request rates and latencies for critical services
     - Set up alerts for abnormal patterns in error rates or response times
   - [API Catalog](https://app.last9.io/api-catalog/): Track API performance
     - Identify which endpoints experience the highest latency
     - Monitor error rates across different API versions

   **Experiment:** Try adding items to the cart in the demo app, then search for your session in the Traces Explorer to see your actual user journey.

   **Next Steps:** When you're ready to integrate your own applications, refer to the [Last9 OpenTelemetry Integration Docs](/docs/integrations/observability/opentelemetry/) for complete instructions.

---

## Troubleshooting

### Common Issues

- No data appearing in Last9:
  - Verify your Authorization Header is correctly copied from the Integrations page
  - Check that all containers are running with `docker ps | grep otel`
  - Ensure your network allows outbound HTTPS connections to otlp.last9.io
- Demo application not loading:
  - Verify all containers are running with `docker ps`
  - Check container logs with `docker logs otelcol`
  - Ensure you have sufficient system resources (at least 4GB free RAM)
- Partial data appearing:
  - Some services may take longer to initialize and start sending telemetry
  - Wait 5-10 minutes for all services to fully report data

### Getting Help

If you encounter issues not covered above, please contact our support team with:

- The specific error messages you're seeing
- Output from docker ps showing running containers
- The collector logs from docker logs otelcol

Please get in touch with us on [Discord](https://discord.com/invite/Q3p2EEucx9) or [Email](mailto:support@last9.io) if you have any questions.
