### Start OpenTelemetry Demo Source: https://github.com/open-telemetry/opentelemetry-demo/blob/main/src/react-native-app/README.md Navigate to the repository root and use the make command to start the OpenTelemetry demo environment. ```bash cd ../.. make start # or start-minimal ``` -------------------------------- ### Example: Build and Restart Shipping Service Source: https://github.com/open-telemetry/opentelemetry-demo/blob/main/CONTRIBUTING.md Demonstrates building and restarting the 'shipping' service specifically. ```sh make build service=shipping make restart service=shipping ``` -------------------------------- ### Build and Start the Demo Stack Source: https://github.com/open-telemetry/opentelemetry-demo/blob/main/CONTRIBUTING.md Build a specific service and then start the entire demo stack. Use this when changes affect shared configurations or require a full restart. ```sh make build service= make start ``` -------------------------------- ### Start JS Bundle Server for iOS (Xcode) Source: https://github.com/open-telemetry/opentelemetry-demo/blob/main/src/react-native-app/README.md Start a server to provide the JS Bundle required for the iOS app when building manually through Xcode. ```bash npm run start ``` -------------------------------- ### Build and Run on Android Source: https://github.com/open-telemetry/opentelemetry-demo/blob/main/src/react-native-app/README.md Compile the Android app, deploy it to a simulator or device, and start the JS Bundle server. ```bash npm run android ``` -------------------------------- ### Build and Run on iOS Source: https://github.com/open-telemetry/opentelemetry-demo/blob/main/src/react-native-app/README.md Compile the iOS app, deploy it to a simulator, and start the JS Bundle server using npm. ```bash npm run ios ``` -------------------------------- ### Install Chatbot Dependencies Source: https://github.com/open-telemetry/opentelemetry-demo/blob/main/src/chatbot/README.md Installs the Python dependencies required for the chatbot service. Ensure you are in a Python environment. ```sh pip install -r src/chatbot/requirements.txt ``` -------------------------------- ### Run OpenTelemetry Demo with Podman Source: https://github.com/open-telemetry/opentelemetry-demo/blob/main/CONTRIBUTING.md Execute the demo using Podman as the container runtime by setting specific environment variables before running the 'make start' command. ```sh DOCKER_COMPOSE_CMD="podman compose" make start ``` -------------------------------- ### Install Agent Dependencies Source: https://github.com/open-telemetry/opentelemetry-demo/blob/main/src/agent/README.md Installs the necessary Python dependencies for the agent service. Ensure you are in a Python environment. ```shell pip install -r src/agent/requirements.txt ``` -------------------------------- ### Generate Protobuf Files Source: https://github.com/open-telemetry/opentelemetry-demo/blob/main/src/accounting/README.md Run this command from the project root to generate protobuf files. Ensure you have the necessary build tools installed. ```sh make generate-protobuf ``` -------------------------------- ### Install App Dependencies Source: https://github.com/open-telemetry/opentelemetry-demo/blob/main/src/react-native-app/README.md Before building the React Native app, install its dependencies using npm. ```bash cd src/react-native-app npm install ``` -------------------------------- ### Install MCP Dependencies Source: https://github.com/open-telemetry/opentelemetry-demo/blob/main/src/mcp/README.md Installs the necessary Python dependencies for the MCP service. Ensure you are in a Python environment. ```sh pip install -r src/mcp/requirements.txt ``` -------------------------------- ### Install Dependencies with Bundler Source: https://github.com/open-telemetry/opentelemetry-demo/blob/main/src/email/README.md Use bundler to manage dependencies for the Email service. Run this command in the service's directory. ```bash bundle install ``` -------------------------------- ### Run Gradle Tasks for Ad Service Source: https://github.com/open-telemetry/opentelemetry-demo/blob/main/CONTRIBUTING.md Navigate to the 'src/ad/' directory and execute these Gradle commands to install the distribution and update the wrapper. ```sh cd src/ad/ ./gradlew installDist ./gradlew wrapper --gradle-version 7.4.2 ``` -------------------------------- ### Start and Check Podman Socket Source: https://github.com/open-telemetry/opentelemetry-demo/blob/main/CONTRIBUTING.md Ensure the Podman socket is running and active for rootless Podman. Verify the socket path if issues persist. ```sh systemctl --user start podman.socket ``` ```sh systemctl --user status podman.socket ``` ```sh podman info --format '{{.Host.RemoteSocket.Path}}' ``` -------------------------------- ### Troubleshoot iOS Pod Installation Source: https://github.com/open-telemetry/opentelemetry-demo/blob/main/src/react-native-app/README.md Force a clean install of CocoaPods dependencies for iOS by clearing the cache, updating repos, deintegrating, and then installing. ```bash cd src/react-native-app/ios rm Podfile.lock bundle exec pod cache clean --all bundle exec pod repo update --verbose bundle exec pod deintegrate bundle exec pod install --repo-update --verbose ``` -------------------------------- ### Product Catalog Service Output Log Source: https://github.com/open-telemetry/opentelemetry-demo/blob/main/src/product-catalog/README.md Example log output from the Product Catalog service, showing successful parsing and gRPC server startup. ```json {"message":"successfully parsed product catalog json","severity":"info","timestamp":"2022-06-02T23:54:10.191283363Z"} {"message":"starting grpc server at :3550","severity":"info","timestamp":"2022-06-02T23:54:10.191849078Z"} ``` -------------------------------- ### Run Quote Service with Docker Source: https://github.com/open-telemetry/opentelemetry-demo/blob/main/src/quote/README.md Start the quote service using Docker Compose. Ensure the entire opentelemetry-demo is deployed by following the root README. ```sh docker compose up quote ``` -------------------------------- ### Run Currency Service Source: https://github.com/open-telemetry/opentelemetry-demo/blob/main/src/currency/README.md Starts the Currency Service. This command will run the service within a Docker container. ```sh docker compose up currency ``` -------------------------------- ### Build Ad Service Locally Source: https://github.com/open-telemetry/opentelemetry-demo/blob/main/src/ad/README.md Use gradlew to compile, install, and distribute the Ad Service. This command creates an executable script for running the service. ```sh ./gradlew installDist ``` -------------------------------- ### Run Chatbot Service Locally Source: https://github.com/open-telemetry/opentelemetry-demo/blob/main/src/chatbot/README.md Starts the chatbot service. Ensure the agent service is running first. Configure ports and endpoints as needed. ```sh cd src/chatbot CHATBOT_PORT=7860 \ AGENT_ENDPOINT=localhost \ AGENT_PORT=8010 \ python run.py ``` -------------------------------- ### Run OpenTelemetry Demo with Docker Source: https://github.com/open-telemetry/opentelemetry-demo/blob/main/CONTRIBUTING.md Start the OpenTelemetry demo services using the provided Makefile target. This command assumes Docker is the default container runtime. ```sh make start ``` -------------------------------- ### Install Ruby Dependencies for iOS Source: https://github.com/open-telemetry/opentelemetry-demo/blob/main/src/react-native-app/README.md Ensure the correct Ruby version is used and install necessary Ruby dependencies with Bundler before building the iOS app. ```bash bundle install ``` -------------------------------- ### Build Frontend Locally with Docker Compose Source: https://github.com/open-telemetry/opentelemetry-demo/blob/main/src/frontend/README.md Run this command from the project root to build and access the frontend client at http://localhost:8080/. Ensure Docker Compose is installed and configured. ```shell docker compose up ``` -------------------------------- ### Generate iOS Project and Install Pods Source: https://github.com/open-telemetry/opentelemetry-demo/blob/main/src/react-native-app/README.md Manually generate the iOS project files and install CocoaPods dependencies for the React Native app when using Xcode. ```bash npx expo prebuild --platform ios --no-install cd ios && bundle exec pod install && cd .. ``` -------------------------------- ### Build Telemetry-Docs Service Source: https://github.com/open-telemetry/opentelemetry-demo/blob/main/src/telemetry-docs/README.md Builds the telemetry-docs service using Docker Compose. Ensure Docker is installed and running. ```bash docker compose build telemetry-docs ``` -------------------------------- ### Build Android App with Docker Source: https://github.com/open-telemetry/opentelemetry-demo/blob/main/src/react-native-app/README.md Produce an Android APK using Docker without needing local development tools installed. ```bash make build-react-native-android ``` -------------------------------- ### Run Email Service Locally Source: https://github.com/open-telemetry/opentelemetry-demo/blob/main/src/email/README.md Execute the Email service locally using the bundle exec command. Ensure dependencies are installed first. ```bash bundle exec ruby email_server.rb ``` -------------------------------- ### Test Agent Endpoint Source: https://github.com/open-telemetry/opentelemetry-demo/blob/main/src/agent/README.md Sends a POST request to the agent's prompt endpoint to test its functionality. This example sends a message to list products. ```shell curl -X POST http://localhost:8010/prompt \ -H 'Content-Type: application/json' \ -d '{"message":"List products in the shop","history":[]}' ``` -------------------------------- ### Develop Frontend Locally with Docker Compose Source: https://github.com/open-telemetry/opentelemetry-demo/blob/main/src/frontend/README.md Execute this command from the project root to start the frontend in development mode. It mounts local source code into the container and sets the Node environment to development. After execution, run 'npm run dev' inside the container. ```shell docker compose run --service-ports -e NODE_ENV=development --volume $(pwd)/src/frontend:/app --volume $(pwd)/pb:/app/pb --user node --entrypoint sh frontend ``` -------------------------------- ### Run MCP Service with Docker Compose Source: https://github.com/open-telemetry/opentelemetry-demo/blob/main/src/mcp/README.md Starts the MCP service using Docker Compose. This command should be run after building the image. ```sh docker compose up mcp ``` -------------------------------- ### Build and Run Chatbot with Docker Compose Source: https://github.com/open-telemetry/opentelemetry-demo/blob/main/src/chatbot/README.md Builds the chatbot Docker image and starts the service using Docker Compose. This is a convenient way to run the service in an isolated environment. ```sh docker compose build chatbot docker compose up chatbot ``` -------------------------------- ### Configure otelsql for PostgreSQL Source: https://github.com/open-telemetry/opentelemetry-demo/blob/main/src/product-catalog/README.md Example of configuring otelsql to instrument PostgreSQL queries with SQLCommenter enabled. This requires using context-aware methods for queries. ```go db, err = otelsql.Open("postgres", connStr, dbAttrs, otelsql.WithSQLCommenter(true), otelsql.WithSpanOptions(...), ) ``` -------------------------------- ### Run Agent Locally Source: https://github.com/open-telemetry/opentelemetry-demo/blob/main/src/agent/README.md Starts the agent service locally with specified environment variables for port, application endpoint, LLM details, and API key. ```shell cd src/agent AGENT_PORT=8010 \ APPLICATION_ENDPOINT=localhost:8080 \ LLM_BASE_URL= \ LLM_MODEL= \ API_KEY= \ python run.py ``` -------------------------------- ### List Services API Query (Jaeger) Source: https://github.com/open-telemetry/opentelemetry-demo/blob/main/test/telemetry/README.md Use this GET request to list all services instrumented with Jaeger tracing. ```http GET /jaeger/ui/api/services ``` -------------------------------- ### Package Hashes for Reproducible Builds Source: https://github.com/open-telemetry/opentelemetry-demo/blob/main/src/load-generator/requirements.txt These SHA256 hashes ensure that the exact versions of the packages are installed, contributing to reproducible builds. They are generated by pip-compile. ```text --hash=sha256:dabeb6fe1228d411994f300811edc6866fff0cdcbc9cef98a78f05ea0da42e37 --hash=sha256:e0e311f1277468c08fd59a2b41f71b43d25dff639789d364747acd1705c0df6e --hash=sha256:e1bd7d96b4ca5fa311f54c9eac16dce4886b428c1531dbe06067763ccdf123b4 --hash=sha256:e6347b8d8d12c5eca6502450a92be30079b7acfade2c4f693efa0deb8871b06e --hash=sha256:efe234a0fafb4b6b1602e9be9245b97c2bf06d67c07af5a4bc3c0438978b555c --hash=sha256:f0b48ccadaa9839e09ff81e969703cecb3f402c813bfe8b958652e699bea69f5 --hash=sha256:ffaecf013251a89d0de6feb49a46eba48ad8cbbf8a40aeb6045e459e7bec6784 ``` -------------------------------- ### Run MCP Service Locally Source: https://github.com/open-telemetry/opentelemetry-demo/blob/main/src/mcp/README.md Starts the MCP service locally with specified environment variables for port, application endpoint, and OTLP endpoint. The service will be available at http://localhost:8011/mcp. ```sh cd src/mcp MCP_PORT=8011 \ APPLICATION_ENDPOINT=localhost:8080 \ OTEL_EXPORTER_OTLP_ENDPOINT=localhost:4317 \ python run.py ``` -------------------------------- ### Configure Shell Profile for Podman Source: https://github.com/open-telemetry/opentelemetry-demo/blob/main/CONTRIBUTING.md Persist the Podman container runtime settings by exporting environment variables in your shell profile. This ensures 'make start' uses Podman by default. ```sh export DOCKER_CMD=podman export DOCKER_COMPOSE_CMD="podman compose" ``` -------------------------------- ### Find Traces API Query (Jaeger) Source: https://github.com/open-telemetry/opentelemetry-demo/blob/main/test/telemetry/README.md Use this GET request to find traces for a specific service. Limit the results to 1 trace. ```http GET /jaeger/ui/api/traces?service={name}&limit=1 ``` -------------------------------- ### Check Docker Service Status Source: https://github.com/open-telemetry/opentelemetry-demo/blob/main/CONTRIBUTING.md Use this command to check if the Docker daemon is running on Linux. If it's inactive, you can start it using the subsequent command. ```sh systemctl status docker ``` ```sh sudo systemctl start docker ``` -------------------------------- ### Check Service Presence API Query (Prometheus) Source: https://github.com/open-telemetry/opentelemetry-demo/blob/main/test/telemetry/README.md Use this GET request to check if a service is present in Prometheus metrics. Replace {name} with the service name. ```http GET /api/v1/query?query=target_info{service_name="{name}"} ``` -------------------------------- ### Build Service Binary with Go Source: https://github.com/open-telemetry/opentelemetry-demo/blob/main/src/checkout/README.md Use this command to build the service binary locally. Ensure you are in the correct directory. ```sh go build -o /go/bin/checkout/ ``` -------------------------------- ### Build Product Catalog Service Binary Source: https://github.com/open-telemetry/opentelemetry-demo/blob/main/src/product-catalog/README.md Command to build the product catalog service binary locally. Ensure you are in the correct directory. ```sh go build -o /go/bin/product-catalog/ ``` -------------------------------- ### Build Accounting Service Locally Source: https://github.com/open-telemetry/opentelemetry-demo/blob/main/src/accounting/README.md Navigate to the src/accounting directory and execute this command to build the service binary locally. Requires .NET SDK. ```sh dotnet build ``` -------------------------------- ### Build and Push Multi-platform Images Source: https://github.com/open-telemetry/opentelemetry-demo/blob/main/CONTRIBUTING.md To build and push multi-platform images to a registry, first set the IMAGE_NAME in the .env.override file. Then, run this command to build and push the images. ```shell make build-multiplatform-and-push ``` -------------------------------- ### Build Product Catalog Service with Docker Compose Source: https://github.com/open-telemetry/opentelemetry-demo/blob/main/src/product-catalog/README.md Command to build the product catalog service using Docker Compose. Run this from the root directory. ```sh docker compose build product-catalog ``` -------------------------------- ### Build Recommendation Service with Docker Source: https://github.com/open-telemetry/opentelemetry-demo/blob/main/src/recommendation/README.md Build the Docker image for the recommendation service by running this command from the root directory. ```sh docker compose build recommendation ``` -------------------------------- ### Build and Run Quote Service Locally Source: https://github.com/open-telemetry/opentelemetry-demo/blob/main/src/quote/README.md Build the base Docker image for the quote service and run it locally. Mount the current directory as a volume and set the QUOTE_PORT environment variable. ```sh docker build src/quote --target base -t quote cd src/quote docker run --rm -it -v $(pwd):/var/www -e QUOTE_PORT=8999 -p "8999:8999" quote ``` -------------------------------- ### Clone the OpenTelemetry Demo Repository Source: https://github.com/open-telemetry/opentelemetry-demo/blob/main/CONTRIBUTING.md Clone the main repository to your local machine to begin making changes. ```sh git clone https://github.com/open-telemetry/opentelemetry-demo.git ``` -------------------------------- ### Local Build for Fraud Detection Service Source: https://github.com/open-telemetry/opentelemetry-demo/blob/main/src/fraud-detection/README.md Builds the Protocol Buffers and the service binary locally. Requires Gradle. ```sh cp -r ../../pb/ src/main/proto/ ./gradlew shadowJar ``` -------------------------------- ### Build Currency Service Docker Image Source: https://github.com/open-telemetry/opentelemetry-demo/blob/main/src/currency/README.md Builds the Docker image for the Currency Service. Run this command from the root directory of the opentelemetry-demo project. ```sh docker compose build currency ``` -------------------------------- ### Build Payment Service with Docker Source: https://github.com/open-telemetry/opentelemetry-demo/blob/main/src/payment/README.md Use this command to build the payment service using Docker Compose. Ensure you are in the root directory. ```bash docker compose build payment ``` -------------------------------- ### Restart a Service Source: https://github.com/open-telemetry/opentelemetry-demo/blob/main/CONTRIBUTING.md Use this make command to restart a specific service within the demo environment. ```sh make restart service= ``` -------------------------------- ### Create Branch, Commit, and Push Changes Source: https://github.com/open-telemetry/opentelemetry-demo/blob/main/CONTRIBUTING.md Create a new feature branch, stage your modified files, commit them with a message, and push the branch to your fork. ```sh $ git checkout -b feature # change files $ git add my/changed/files $ git commit -m "short description of the change" $ git push fork feature ``` -------------------------------- ### Run Currency Service Client Source: https://github.com/open-telemetry/opentelemetry-demo/blob/main/src/currency/README.md Executes the currencyclient to send requests to the running Currency Service. Replace with the actual container name. The port '7000' is where the currency service listens. ```sh docker exec -it currencyclient 7000 ``` -------------------------------- ### Build Cart Service with Docker Source: https://github.com/open-telemetry/opentelemetry-demo/blob/main/src/cart/README.md Use this command to build the Cart service using Docker. Ensure you are in the root directory of the repository. ```bash docker compose build cart ``` -------------------------------- ### Navigate to Repository Root Source: https://github.com/open-telemetry/opentelemetry-demo/blob/main/CONTRIBUTING.md Change your current directory to the root of the cloned repository. ```sh cd opentelemetry-demo ``` -------------------------------- ### Clone OpenTelemetry Demo Repository Source: https://github.com/open-telemetry/opentelemetry-demo/blob/main/CONTRIBUTING.md Clone the OpenTelemetry demo repository and navigate into the project directory. ```sh git clone https://github.com/open-telemetry/opentelemetry-demo.git cd opentelemetry-demo/ ``` -------------------------------- ### Build Docker Image for Checkout Service Source: https://github.com/open-telemetry/opentelemetry-demo/blob/main/src/checkout/README.md Build the Docker image for the checkout service from the root directory of the project. ```sh docker compose build checkout ``` -------------------------------- ### Send Request to Quote Service Source: https://github.com/open-telemetry/opentelemetry-demo/blob/main/src/quote/README.md Send a curl request to the locally running quote service to get a shipping cost quote. The request body should be in JSON format specifying the number of items. ```sh curl --location 'http://localhost:8999/getquote' \ --header 'Content-Type: application/json' \ --data '{"numberOfItems":3}' ``` -------------------------------- ### Create Multi-platform Builder Source: https://github.com/open-telemetry/opentelemetry-demo/blob/main/CONTRIBUTING.md Use this command to create a multi-platform Docker builder with a parallelism limit of 4. This builder will be set as the active builder. ```shell make create-multiplatform-builder ``` -------------------------------- ### Build and Restart a Specific Service Source: https://github.com/open-telemetry/opentelemetry-demo/blob/main/CONTRIBUTING.md Rebuild and restart a single service to test local changes without affecting the entire demo stack. ```sh make build service= make restart service= ``` -------------------------------- ### Build Multi-platform Images Locally Source: https://github.com/open-telemetry/opentelemetry-demo/blob/main/CONTRIBUTING.md Execute this command to build multi-platform Docker images for linux/amd64 and linux/arm64 architectures and load them locally. ```shell make build-multiplatform ``` -------------------------------- ### Build Email Service Docker Image Source: https://github.com/open-telemetry/opentelemetry-demo/blob/main/src/email/README.md Build a Docker image for the Email service. Navigate to the 'src/email' directory before running this command. ```bash docker build . ``` -------------------------------- ### Build Quote Service with Docker Source: https://github.com/open-telemetry/opentelemetry-demo/blob/main/src/quote/README.md Build the quote service image using Docker Compose. Run this command from the root directory of opentelemetry-demo. ```sh docker compose build quote ``` -------------------------------- ### Build Ad Service Docker Image Source: https://github.com/open-telemetry/opentelemetry-demo/blob/main/src/ad/README.md Build the Docker image for the Ad service from the root of the opentelemetry-demo project using the provided Dockerfile. ```sh docker build --file ./src/ad/Dockerfile ./ ``` -------------------------------- ### Build Android App with Docker (Direct) Source: https://github.com/open-telemetry/opentelemetry-demo/blob/main/src/react-native-app/README.md Build the Android app's APK directly using a Dockerfile in the current directory. ```bash docker build -f android.Dockerfile --platform=linux/amd64 --output=. . ``` -------------------------------- ### Check Running Containers and View Logs Source: https://github.com/open-telemetry/opentelemetry-demo/blob/main/CONTRIBUTING.md List all running containers for Docker or Podman, and view logs for a specific container using its ID. ```sh docker ps # For Docker ``` ```sh podman ps # For Podman ``` ```sh docker logs # For Docker ``` ```sh podman logs # For Podman ``` -------------------------------- ### Build Agent Docker Image Source: https://github.com/open-telemetry/opentelemetry-demo/blob/main/src/agent/README.md Builds the Docker image for the agent service. This command should be run from the repository root. ```shell make build ``` -------------------------------- ### Add Your Fork as a Remote Source: https://github.com/open-telemetry/opentelemetry-demo/blob/main/CONTRIBUTING.md Configure your local repository to push changes to your personal fork on GitHub. ```sh git remote add fork https://github.com/YOUR_GITHUB_USERNAME/opentelemetry-demo.git ``` -------------------------------- ### Build Accounting Service with Docker Source: https://github.com/open-telemetry/opentelemetry-demo/blob/main/src/accounting/README.md Build the Accounting Service Docker image from the project root directory. This command uses Docker Compose for building. ```sh docker compose build accounting ``` -------------------------------- ### Bump Dependencies and Tidy Modules Source: https://github.com/open-telemetry/opentelemetry-demo/blob/main/src/checkout/README.md Update all project dependencies to their latest versions and then tidy the go module dependencies. ```sh go get -u -t ./... ``` ```sh go mod tidy ``` -------------------------------- ### Docker Build for Fraud Detection Service Source: https://github.com/open-telemetry/opentelemetry-demo/blob/main/src/fraud-detection/README.md Builds the Fraud Detection Service using Docker. Assumes a Dockerfile is present. ```sh docker build -f ./src/fraud-detection/Dockerfile . ``` -------------------------------- ### Upgrade Gradle Wrapper Source: https://github.com/open-telemetry/opentelemetry-demo/blob/main/src/ad/README.md Update the Gradle wrapper to a new version by running the wrapper task with the desired --gradle-version. ```sh ./gradlew wrapper --gradle-version ``` -------------------------------- ### Write to File Endpoint (Legacy) Source: https://github.com/open-telemetry/opentelemetry-demo/blob/main/src/flagd-ui/README.md Legacy endpoint to write a new settings file. ```APIDOC ## POST /write-to-file ### Description Legacy endpoint to write a new settings file. This operation overwrites all existing data. ### Method POST ### Endpoint /write-to-file ### Parameters None ### Request Body - **data** (object) - Required - The new configuration object for the feature flags. ### Request Example ```sh curl --header "Content-Type: application/json" \ --request POST \ --data '{"data": {"$schema":"https://flagd.dev/schema/v0/flags.json","flags":{"adFailure":{"defaultVariant":"on","description":"Fail ad service","state":"ENABLED","variants":{"off":false,"on":true}}...' \ http://localhost:8080/write-to-file ``` ### Response #### Success Response (200) - **message** (string) - A confirmation message indicating the write operation was successful. #### Response Example ```json { "message": "Configuration written successfully." } ``` ``` -------------------------------- ### PPL Query for Logs (OpenSearch) Source: https://github.com/open-telemetry/opentelemetry-demo/blob/main/test/telemetry/README.md Use this PPL query to count logs for a specific service name in OpenSearch. Replace {name} with the service name. ```ppl source=otel-logs-* | where resource.service.name = '{name}' | stats count() ``` -------------------------------- ### Build and Run Agent with Docker Compose Source: https://github.com/open-telemetry/opentelemetry-demo/blob/main/src/agent/README.md Builds and runs the agent service using Docker Compose. This is useful for local development and testing in a containerized environment. ```shell docker compose build agent docker compose up agent ``` -------------------------------- ### Regenerate Protobuf Files Source: https://github.com/open-telemetry/opentelemetry-demo/blob/main/src/checkout/README.md Run this command from the root directory to regenerate protobuf files within the Docker environment. ```sh make docker-generate-protobuf ``` -------------------------------- ### Copy MCP Tools Source: https://github.com/open-telemetry/opentelemetry-demo/blob/main/src/mcp/README.md Copies the tools.py file to the correct location for the MCP server to use. This is necessary because the service imports shop tools from the agent source tree. ```sh cp src/shared/tools.py src/mcp/src/mcp_server/tools.py ``` -------------------------------- ### Run Telemetry Tests with Makefile Source: https://github.com/open-telemetry/opentelemetry-demo/blob/main/test/telemetry/README.md Use these Makefile targets to execute telemetry tests with different scopes. Choose the scope that best fits your testing needs, from minimal to full coverage. ```bash make run-telemetry-tests # Full scope (all services) make run-telemetry-tests-minimal # Minimal scope make run-telemetry-tests-agentic # Agentic scope (agent, mcp, chatbot) ``` -------------------------------- ### Run Ad Service Locally Source: https://github.com/open-telemetry/opentelemetry-demo/blob/main/src/ad/README.md Set the AD_PORT and FEATURE_FLAG_GRPC_SERVICE_ADDR environment variables before running the Ad Service executable. Ensure the correct path to the executable is used. ```sh export AD_PORT=8080 export FEATURE_FLAG_GRPC_SERVICE_ADDR=featureflagservice:50053 ./build/install/opentelemetry-demo-ad/bin/Ad ``` -------------------------------- ### Build Shipping Service Source: https://github.com/open-telemetry/opentelemetry-demo/blob/main/src/shipping/README.md Builds the shipping service using Docker Compose. Ensure you are in the parent directory (../../). ```sh docker compose build shipping ``` -------------------------------- ### Troubleshoot Android Build Issues Source: https://github.com/open-telemetry/opentelemetry-demo/blob/main/src/react-native-app/README.md Stop Gradle daemons and clear Gradle caches to resolve Android build problems. ```bash cd src/react-native-app/android ./gradlew --stop # stop daemons rm -rf ~/.gradle/caches/ ``` -------------------------------- ### Agent MCP Configuration Source: https://github.com/open-telemetry/opentelemetry-demo/blob/main/src/mcp/README.md These environment variables enable and configure the MCP service for the agent. Set MCP_ENABLED to True to activate MCP usage. ```text MCP_ENABLED=True MCP_ENDPOINT=mcp MCP_PORT=8011 ``` -------------------------------- ### Generate Load Generator Requirements Source: https://github.com/open-telemetry/opentelemetry-demo/blob/main/src/load-generator/requirements.txt This command uses pip-compile to generate the requirements.txt file for the load generator. It allows unsafe packages, generates hashes for security, and strips extra dependencies. ```bash pip-compile --allow-unsafe --generate-hashes --no-emit-index-url --output-file=src/load-generator/requirements.txt --strip-extras src/load-generator/requirements.in ``` -------------------------------- ### Troubleshoot Node Modules Source: https://github.com/open-telemetry/opentelemetry-demo/blob/main/src/react-native-app/README.md If experiencing JS bundle build issues, try removing the node_modules folder and reinstalling dependencies. ```bash cd src/react-native-app/node_modules/ rm -rf * npm install ``` -------------------------------- ### Build MCP Service with Docker Compose Source: https://github.com/open-telemetry/opentelemetry-demo/blob/main/src/mcp/README.md Builds the MCP service image using Docker Compose. This is an alternative to the 'make build' command. ```sh docker compose build mcp ``` -------------------------------- ### Run Single Telemetry Edge Test Source: https://github.com/open-telemetry/opentelemetry-demo/blob/main/test/telemetry/README.md Use this command to run a specific test for a service edge. Specify the test file and the edge to test using the -k flag. ```bash pytest test_traces_edges.py -k "frontend->cart" -v ``` -------------------------------- ### Read File Endpoint (Legacy) Source: https://github.com/open-telemetry/opentelemetry-demo/blob/main/src/flagd-ui/README.md Legacy endpoint to read the feature flags configuration file. ```APIDOC ## GET /read-file ### Description Legacy endpoint to read the feature flags configuration file. ### Method GET ### Endpoint /read-file ### Parameters None ### Request Example None ### Response #### Success Response (200) - **flags** (object) - An object containing all the feature flags and their configurations. #### Response Example ```json { "flags": { "adFailure": { "defaultVariant": "off", "description": "Fail ad service", "state": "ENABLED", "variants": { "off": false, "on": true } }, ... } } ``` ``` -------------------------------- ### geventhttpclient Package with Hashes Source: https://github.com/open-telemetry/opentelemetry-demo/blob/main/src/load-generator/requirements.txt Specifies the geventhttpclient package version and its associated SHA256 hashes. These hashes ensure the integrity and security of the downloaded package. ```text geventhttpclient==2.3.9 \ --hash=sha256:02e06a2f78a225b70e616b493317073f3e2fddd4e51ddfc44569d188f368bd8d \ --hash=sha256:04b8feec69fd662eb46b4f81013206f5a23d179b195cbaf590d4a59f641ed0fc \ --hash=sha256:0658266fa594931e5260f17c6f52f867597e5cb257e85f73990b2f61bad58ec7 \ --hash=sha256:06df5597edf65d4c691052fce3e37620cbc037879a3b872bc16a7b2a0941d59a \ --hash=sha256:08f0df30086a0ce05d75180753095b913a5e676c83ff92f8f9779bd064536d3c \ --hash=sha256:09b82815247a1044c648bac1cee1e766e03e762950cae49cf61efffaeff667c4 \ --hash=sha256:0f66a33c95e4d6d343fc6ace458b13c613684bf7cfd6832b61cc9c42eaf394f3 \ --hash=sha256:0ff40ca5b848f96c6390bd8cc3a4c4598c119be08125cf1c30103201adc00940 \ --hash=sha256:14daf2f0361f19b0221f900d7e9d563c184bb7186676e61fe848495b1f2483d3 \ --hash=sha256:14eaa836bde26a70952e95ca462018f3a47c1c92642327315aa6502e54141016 \ --hash=sha256:16807578dc4a175e8d97e6e39d65a10b04b5237a8c55f7a5ef39044e869baeb8 \ --hash=sha256:1d0c2af2aff5b802cdec4b6b216348a32a2452f4e5f5f2e19fc5f84d77443649 \ --hash=sha256:1dac4df42a954e19d3e737c4c4351332cf27e415c0e7b8850070fd8056237a04 \ --hash=sha256:1e82a219e9f3d644832c8ed18dd0bc615f21ed18659e1d26e187b29f81dff9e1 \ --hash=sha256:1ed08b02b7c275397a528028d526d28f056bce3dc5cd285a7a9d7d78b0975f5a \ --hash=sha256:224e4a959ece6673f4c57113013fc20ed020e661d6de3c820aa3afe2f1cf2e99 \ --hash=sha256:25c03073a1136c2b93189488bb1bfc0868d90aa106dd49f15ac964d2454296c6 \ --hash=sha256:269e861e7fc38994b315b50469c8e629e3a78321a049598c4f4a0f21053e5503 \ --hash=sha256:2b244adcbf5814a29d5cea8b2fc079f9242d92765191faa4dc5eccc0421840ae \ --hash=sha256:2b91fb31523725ddc777c14b444ccedaf2043dcb9af0ede29056a9b8146c79a7 \ --hash=sha256:2c71796fda35bfe5b4ae93cdca62fd4932ee95c2b36812ce65878183ca7da517 ``` -------------------------------- ### Test Shipping Service Source: https://github.com/open-telemetry/opentelemetry-demo/blob/main/src/shipping/README.md Runs tests for the shipping service using Cargo. This command should be executed from the shipping service directory. ```sh cargo test ``` -------------------------------- ### Submit Prompt to Agent Source: https://github.com/open-telemetry/opentelemetry-demo/blob/main/src/agent/README.md Submits a user prompt to the AI agent. The agent processes the prompt using LangGraph and available tools, returning a response. ```APIDOC ## POST /prompt ### Description Submits a prompt to the agent. The agent will process the prompt using LangGraph and available tools. ### Method POST ### Endpoint /prompt ### Request Body - **message** (string) - Required - The user's prompt message. - **history** (array) - Optional - The conversation history. ### Request Example ```json { "message": "List available products", "history": [] } ``` ### Response #### Success Response (200) - **response** (object) - Contains the agent's response, including messages. - **messages** (array) - The list of messages from the agent. #### Response Example ```json { "response": { "messages": [] } } ``` ``` -------------------------------- ### Write Feature Flags Configuration Source: https://github.com/open-telemetry/opentelemetry-demo/blob/main/src/flagd-ui/README.md Writes a new settings file by sending a new configuration in the request body. This operation overwrites all existing data. ```APIDOC ## POST /feature/api/write ### Description Writes a new settings file. This operation overwrites all existing data. ### Method POST ### Endpoint /feature/api/write ### Parameters None ### Request Body - **data** (object) - Required - The new configuration object for the feature flags. ### Request Example ```sh curl --header "Content-Type: application/json" \ --request POST \ --data '{"data": {"$schema":"https://flagd.dev/schema/v0/flags.json","flags":{"adFailure":{"defaultVariant":"on","description":"Fail ad service","state":"ENABLED","variants":{"off":false,"on":true}}...}}' \ http://localhost:8080/feature/api/write ``` ### Response #### Success Response (200) - **message** (string) - A confirmation message indicating the write operation was successful. #### Response Example ```json { "message": "Configuration written successfully." } ``` ``` -------------------------------- ### MCP Tool Mode Endpoint Source: https://github.com/open-telemetry/opentelemetry-demo/blob/main/src/agent/README.md Specifies the endpoint the agent connects to when MCP_ENABLED is True for dynamic tool loading. ```text http://${MCP_ENDPOINT}:${MCP_PORT}/mcp ``` -------------------------------- ### Run Single Telemetry Test Source: https://github.com/open-telemetry/opentelemetry-demo/blob/main/test/telemetry/README.md Use this command to run a single test case within a specific test file. Specify the test file and the test name using the -k flag. ```bash pytest test_traces.py -k "checkout" -v ``` -------------------------------- ### Agent Built-in Tools Source: https://github.com/open-telemetry/opentelemetry-demo/blob/main/src/agent/README.md Lists the available built-in Python tools used by the agent when MCP_ENABLED is False. These tools interact with the frontend API. ```python # Built-in tools from src/shared/tools.py # get_ads(category) # list_products() # get_product(product_id) # add_to_cart(user_id, product_id, quantity) # get_cart(user_id) # empty_cart(user_id) # checkout(checkout_person) # get_supported_currencies() # get_recommendations(product_id) # get_shipping_quote(items, currency_code, address) ``` -------------------------------- ### Update Accounting Project Dependencies Source: https://github.com/open-telemetry/opentelemetry-demo/blob/main/src/accounting/README.md Use this Package Manager command to update all dependencies for the Accounting project. This is typically run from the Package Manager Console in Visual Studio. ```powershell Update-Package -ProjectName Accounting ``` -------------------------------- ### Clear Container Build Cache Source: https://github.com/open-telemetry/opentelemetry-demo/blob/main/CONTRIBUTING.md Use these commands to remove all unused container data, including images, containers, volumes, and networks. Exercise caution as this is a destructive operation. ```sh docker system prune -a # For Docker ``` ```sh podman system prune -a # For Podman ``` -------------------------------- ### Read Feature Flags Configuration Source: https://github.com/open-telemetry/opentelemetry-demo/blob/main/src/flagd-ui/README.md Retrieves the current configuration of feature flags from the flagd service. ```APIDOC ## GET /feature/api/read ### Description Retrieves the current configuration of feature flags. ### Method GET ### Endpoint /feature/api/read ### Parameters None ### Request Example None ### Response #### Success Response (200) - **flags** (object) - An object containing all the feature flags and their configurations. #### Response Example ```json { "flags": { "adFailure": { "defaultVariant": "off", "description": "Fail ad service", "state": "ENABLED", "variants": { "off": false, "on": true } }, "adHighCpu": { "defaultVariant": "off", "description": "Triggers high cpu load in the ad service", "state": "ENABLED", "variants": { "off": false, "on": true } }, "adManualGc": { "defaultVariant": "off", "description": "Triggers full manual garbage collections in the ad service", "state": "ENABLED", "variants": { "off": false, "on": true } }, ... } } ``` ``` -------------------------------- ### Agent Docker Compose Configuration Snippet Source: https://github.com/open-telemetry/opentelemetry-demo/blob/main/src/agent/README.md Configuration for the agent service in docker-compose.yml, including image, container name, Dockerfile, memory limit, restart policy, exposed port, and dependencies. It also shows settings for enabling and configuring MCP. ```yaml services: agent: build: context: . dockerfile: ${AGENT_DOCKERFILE} image: ${IMAGE_NAME}:${DEMO_VERSION}-agent container_name: agent ports: - "${AGENT_PORT}:${AGENT_PORT}" depends_on: - jaeger - otel-collector - product-catalog mem_limit: 500M restart: unless-stopped environment: - MCP_ENABLED=True - MCP_ENDPOINT=mcp - MCP_PORT=8011 ``` -------------------------------- ### Telemetry Flow Diagram Source: https://github.com/open-telemetry/opentelemetry-demo/blob/main/test/telemetry/README.md Visual representation of the telemetry data flow from services to backends via the OTel Collector, and how the telemetry-tests query these backends. ```mermaid graph TD A[Services] -->|OTLP| B[OTel Collector] B --> C[Jaeger - traces] B --> D[Prometheus - metrics] B --> E[OpenSearch - logs] F[telemetry-tests] -->|query| C F -->|query| D F -->|query| E ``` -------------------------------- ### Read Feature Flags Configuration Source: https://github.com/open-telemetry/opentelemetry-demo/blob/main/src/flagd-ui/README.md Use this curl command to retrieve the current feature flag configuration from the flagd-ui service. The output is formatted using jq for readability. ```bash $ curl localhost:8080/feature/api/read | jq ``` -------------------------------- ### Disclose AI Assistance in Commit Messages Source: https://github.com/open-telemetry/opentelemetry-demo/blob/main/AGENTS.md When a significant part of a commit is taken from an AI tool without changes, disclose its use using the 'Assisted-by:' trailer in the commit message. Do not use 'Co-authored-by:'. ```markdown Assisted-by: ChatGPT 5.5 ``` ```markdown Assisted-by: Claude Sonnet 4.6 ``` -------------------------------- ### OpenSearch Logs API Source: https://github.com/open-telemetry/opentelemetry-demo/blob/main/test/telemetry/README.md API for querying log data from OpenSearch using PPL. ```APIDOC ## PPL Query for Logs ### Description Executes a PPL (Prometheus Query Language) query against OpenSearch to retrieve and aggregate log data for a specific service. ### Method N/A (This is a query language example, not a direct HTTP endpoint) ### Endpoint N/A ### Parameters #### PPL Query Example - **query** (string) - The PPL query to execute. - Example: `source=otel-logs-* | where resource.service.name = '{name}' | stats count()` - This query counts the number of log entries for a given service name. ``` -------------------------------- ### Telemetry Tests File Structure Source: https://github.com/open-telemetry/opentelemetry-demo/blob/main/test/telemetry/README.md Directory structure for the telemetry sanity tests, showing the location of configuration, test files, and supporting scripts. ```text test/telemetry/ |-- Dockerfile |-- requirements.txt |-- conftest.py |-- services.py |-- test_collector.py |-- test_agentic.py |-- test_traces.py |-- test_traces_edges.py |-- test_metrics.py +-- test_logs.py ``` -------------------------------- ### Verify Directed Inter-Service Edges (Jaeger) Source: https://github.com/open-telemetry/opentelemetry-demo/blob/main/test/telemetry/README.md Walk traces returned from the API to match parent spans to their direct children. This method is preferred over /api/dependencies due to Jaeger's in-memory backend rotation. ```http GET /jaeger/ui/api/traces?service={parent}&limit=20 ```