From 7882f45baba11e228d1cc5da095edf8a4f10b85b Mon Sep 17 00:00:00 2001 From: kdhamric Date: Fri, 11 Aug 2023 09:15:46 -0500 Subject: [PATCH] Changed to utilize the embedded Tracetest (#3057) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * Changed to utilize the embedded Tracetest With Tracetest now included in the OpenTelemetry Demo repo, this change utilizes it for the recipe. * Update docs/docs/live-examples/opentelemetry-store/overview.md Co-authored-by: Adnan Rahić * Update docs/docs/live-examples/opentelemetry-store/overview.md Co-authored-by: Adnan Rahić * Update docs/docs/live-examples/opentelemetry-store/overview.md Co-authored-by: Adnan Rahić --------- Co-authored-by: Adnan Rahić --- .../opentelemetry-store/overview.md | 88 ++++++++++++++++--- 1 file changed, 77 insertions(+), 11 deletions(-) diff --git a/docs/docs/live-examples/opentelemetry-store/overview.md b/docs/docs/live-examples/opentelemetry-store/overview.md index 3101ce8c36..395ab756f5 100644 --- a/docs/docs/live-examples/opentelemetry-store/overview.md +++ b/docs/docs/live-examples/opentelemetry-store/overview.md @@ -1,28 +1,94 @@ # OpenTelemetry Astronomy Shop Demo -This system implements an Astronomy shop in a set of microservices in different languages with OpenTelemetry enabled, intended to be used as an example of OpenTelemetry instrumentation and observability. +The OpenTelemetry Demo is an example application published by the OpenTelemtry CNCF project. It implements an Astronomy shop in a set of microservices in different languages with OpenTelemetry enabled, intended to be used as an example of OpenTelemetry instrumentation and observability. The Tracetest team has made several key contributions to this project, including providing a full suite of end to end tests. + +We will provide a full recipe below for running the full demo as well as running the associated Tracetests via Docker. Here are other references you may find useful: - **Source Code**: https://github.com/open-telemetry/opentelemetry-demo -- **Running it Locally**: [Instructions](https://github.com/open-telemetry/opentelemetry-demo/blob/main/docs/docker_deployment.md#run-docker-compose) -- **Running on Kubernetes**: [Instructions](https://github.com/open-telemetry/opentelemetry-demo/blob/main/docs/kubernetes_deployment.md) +- **Running it locally in Docker**: [Instructions](https://opentelemetry.io/docs/demo/docker-deployment/) +- **Running on Kubernetes**: [Instructions](https://opentelemetry.io/docs/demo/kubernetes-deployment/) + +## Running the OpenTelemetry Astronomy Shop Demo in Docker + +### Prerequisites + +- Docker +- Docker Compose v2.0.0+ +- 4 GB of RAM for the application + +### Get and run the demo + +1. Clone the Demo repository: + + ```shell + git clone https://github.com/open-telemetry/opentelemetry-demo.git + ``` + +2. Change to the demo folder: + + ```shell + cd opentelemetry-demo/ + ``` + +3. Run docker compose[^1] to start the demo: + + ```shell + docker compose up --no-build + ``` + + > **Notes:** + > + > - The `--no-build` flag is used to fetch released docker images from + > [ghcr](https://ghcr.io/open-telemetry/demo) instead of building from + > source. Removing the `--no-build` command line option will rebuild all + > images from source. It may take more than 20 minutes to build if the + > flag is omitted. + > - If you're running on Apple Silicon, run `docker compose build`[^1] in + > order to create local images vs. pulling them from the repository. -## Running with Tracetest +## Verify the web store and Telemetry + +Once the images are built and containers are started you can access: + +- Web store: +- Grafana: +- Feature Flags UI: +- Load Generator UI: +- Jaeger UI: + +## Running Tracetests + +The Tracetest tests for the OpenTelemetry Demo can be found in the official repo here: + +- **Instructions to run (also shown below in this recipe)**: [Running Tracetest Tests](https://github.com/open-telemetry/opentelemetry-demo/tree/main/test#testing-services-with-trace-based-tests) +- **Full source of all tests**: [Source](https://github.com/open-telemetry/opentelemetry-demo/tree/main/test/tracetesting) + +To run the entire test suite of trace-based tests, run the command: -To run the this demo locally with Tracetest, first clone OpenTelemetry demo repo in your machine in any folder: ```sh -git clone https://github.com/open-telemetry/opentelemetry-demo.git +make run-tracetesting +#or +docker compose run traceBasedTests ``` -And then, run in that folder: +To run tests for specific services, pass the name of the service as a +parameter (using the folder names located [here](https://github.com/open-telemetry/opentelemetry-demo/tree/main/test/tracetesting): + ```sh -docker compose up --no-build +make run-tracetesting SERVICES_TO_TEST="service-1 service-2 ..." +#or +docker compose run traceBasedTests "service-1 service-2 ..." ``` -After a few minutes, the store should be running normally in your machine, to test it go to a browser and access: [http://localhost:8080](http://localhost:8080) +For instance, if you need to run the tests for `ad-service` and +`payment-service`, you can run them with: + +```sh +make run-tracetesting SERVICES_TO_TEST="ad-service payment-service" +``` -Now, to start Tracetest connected with this demo, download the contents of the [Running Tracetest with OpenTelemetry store demo](https://github.com/kubeshop/tracetest/tree/main/examples/tracetest-open-telemetry-store-demo) in any folder, and then run `docker compose up`. +Tracetest will be started on [http://localhost:11633](http://localhost:11633) as part of running these tests and you can view any of the tests, test suites, prior runs, or create and run your own tests. It is a great testbed to explore Tracetest! -After that, Tracetest will start on [http://localhost:11633](http://localhost:11633) and you can start creating tests. ## Use Cases