├── src ├── accounting │ ├── .gitignore │ ├── .dockerignore │ ├── Directory.Build.props │ ├── Log.cs │ ├── README.md │ ├── Program.cs │ ├── Helpers.cs │ └── Accounting.sln ├── ad │ ├── .java-version │ ├── settings.gradle │ ├── gradle │ │ └── wrapper │ │ │ ├── gradle-wrapper.jar │ │ │ └── gradle-wrapper.properties │ ├── src │ │ └── main │ │ │ └── resources │ │ │ └── log4j2.xml │ ├── README.md │ └── Dockerfile ├── email │ ├── .ruby-version │ ├── .dockerignore │ ├── README.md │ ├── Gemfile │ └── Dockerfile ├── fraud-detection │ ├── .dockerignore │ ├── gradle.properties │ ├── settings.gradle.kts │ ├── gradle │ │ └── wrapper │ │ │ ├── gradle-wrapper.jar │ │ │ └── gradle-wrapper.properties │ ├── README.md │ ├── src │ │ └── main │ │ │ └── resources │ │ │ └── log4j2.xml │ └── Dockerfile ├── react-native-app │ ├── .ruby-version │ ├── .prettierignore │ ├── ios │ │ ├── reactnativeapp │ │ │ ├── noop-file.swift │ │ │ ├── Images.xcassets │ │ │ │ ├── Contents.json │ │ │ │ ├── SplashScreen.imageset │ │ │ │ │ ├── image.png │ │ │ │ │ └── Contents.json │ │ │ │ ├── SplashScreenBackground.imageset │ │ │ │ │ ├── image.png │ │ │ │ │ └── Contents.json │ │ │ │ └── AppIcon.appiconset │ │ │ │ │ ├── App-Icon-1024x1024@1x.png │ │ │ │ │ └── Contents.json │ │ │ ├── reactnativeapp-Bridging-Header.h │ │ │ ├── reactnativeapp.entitlements │ │ │ ├── main.m │ │ │ ├── AppDelegate.h │ │ │ └── Supporting │ │ │ │ └── Expo.plist │ │ ├── Podfile.properties.json │ │ ├── reactnativeapp.xcworkspace │ │ │ ├── contents.xcworkspacedata │ │ │ └── xcshareddata │ │ │ │ └── IDEWorkspaceChecks.plist │ │ ├── .gitignore │ │ └── .xcode.env │ ├── android │ │ ├── app │ │ │ ├── src │ │ │ │ ├── main │ │ │ │ │ ├── res │ │ │ │ │ │ ├── values-night │ │ │ │ │ │ │ └── colors.xml │ │ │ │ │ │ ├── values │ │ │ │ │ │ │ ├── ic_launcher_background.xml │ │ │ │ │ │ │ ├── colors.xml │ │ │ │ │ │ │ ├── strings.xml │ │ │ │ │ │ │ └── styles.xml │ │ │ │ │ │ ├── mipmap-hdpi │ │ │ │ │ │ │ ├── ic_launcher.png │ │ │ │ │ │ │ ├── ic_launcher_round.png │ │ │ │ │ │ │ └── ic_launcher_foreground.png │ │ │ │ │ │ ├── mipmap-mdpi │ │ │ │ │ │ │ ├── ic_launcher.png │ │ │ │ │ │ │ ├── ic_launcher_round.png │ │ │ │ │ │ │ └── ic_launcher_foreground.png │ │ │ │ │ │ ├── mipmap-xhdpi │ │ │ │ │ │ │ ├── ic_launcher.png │ │ │ │ │ │ │ ├── ic_launcher_round.png │ │ │ │ │ │ │ └── ic_launcher_foreground.png │ │ │ │ │ │ ├── drawable │ │ │ │ │ │ │ └── splashscreen.xml │ │ │ │ │ │ ├── mipmap-xxhdpi │ │ │ │ │ │ │ ├── ic_launcher.png │ │ │ │ │ │ │ ├── ic_launcher_round.png │ │ │ │ │ │ │ └── ic_launcher_foreground.png │ │ │ │ │ │ ├── mipmap-xxxhdpi │ │ │ │ │ │ │ ├── ic_launcher.png │ │ │ │ │ │ │ ├── ic_launcher_round.png │ │ │ │ │ │ │ └── ic_launcher_foreground.png │ │ │ │ │ │ ├── drawable-hdpi │ │ │ │ │ │ │ └── splashscreen_image.png │ │ │ │ │ │ ├── drawable-mdpi │ │ │ │ │ │ │ └── splashscreen_image.png │ │ │ │ │ │ ├── drawable-xhdpi │ │ │ │ │ │ │ └── splashscreen_image.png │ │ │ │ │ │ ├── drawable-xxhdpi │ │ │ │ │ │ │ └── splashscreen_image.png │ │ │ │ │ │ ├── drawable-xxxhdpi │ │ │ │ │ │ │ └── splashscreen_image.png │ │ │ │ │ │ └── mipmap-anydpi-v26 │ │ │ │ │ │ │ ├── ic_launcher.xml │ │ │ │ │ │ │ └── ic_launcher_round.xml │ │ │ │ │ └── ic_launcher-playstore.png │ │ │ │ └── debug │ │ │ │ │ └── AndroidManifest.xml │ │ │ ├── debug.keystore │ │ │ └── proguard-rules.pro │ │ ├── gradle │ │ │ └── wrapper │ │ │ │ ├── gradle-wrapper.jar │ │ │ │ └── gradle-wrapper.properties │ │ ├── .gitignore │ │ └── settings.gradle │ ├── Gemfile │ ├── .dockerignore │ ├── .env │ ├── assets │ │ ├── images │ │ │ ├── icon.png │ │ │ ├── favicon.png │ │ │ ├── splash.png │ │ │ └── adaptive-icon.png │ │ └── fonts │ │ │ └── SpaceMono-Regular.ttf │ ├── components │ │ ├── EmptyCart │ │ │ ├── index.ts │ │ │ └── EmptyCart.tsx │ │ ├── ProductCard │ │ │ └── index.ts │ │ ├── ProductList │ │ │ └── index.ts │ │ ├── CheckoutForm │ │ │ └── index.ts │ │ ├── navigation │ │ │ └── TabBarIcon.tsx │ │ ├── ThemedView.tsx │ │ ├── ThemedScrollView.tsx │ │ └── Field.tsx │ ├── hooks │ │ ├── useColorScheme.ts │ │ ├── useColorScheme.web.ts │ │ └── useThemeColor.ts │ ├── babel.config.js │ ├── .eslintrc.js │ ├── tsconfig.json │ ├── .gitignore │ ├── utils │ │ ├── Localhost.ts │ │ ├── Settings.ts │ │ ├── SessionIdProcessor.ts │ │ └── Request.ts │ ├── metro.config.js │ ├── types │ │ └── Cart.ts │ ├── android.Dockerfile │ ├── constants │ │ └── Colors.ts │ └── app.json ├── frontend │ ├── .dockerignore │ ├── .prettierignore │ ├── public │ │ ├── favicon.ico │ │ └── icons │ │ │ └── Check.svg │ ├── components │ │ ├── Ad │ │ │ ├── index.ts │ │ │ ├── Ad.tsx │ │ │ └── Ad.styled.ts │ │ ├── Header │ │ │ ├── index.ts │ │ │ └── Header.tsx │ │ ├── Input │ │ │ ├── index.ts │ │ │ └── Input.tsx │ │ ├── Layout │ │ │ ├── index.ts │ │ │ └── Layout.tsx │ │ ├── Banner │ │ │ ├── index.ts │ │ │ └── Banner.tsx │ │ ├── Button │ │ │ ├── index.ts │ │ │ └── Button.tsx │ │ ├── Footer │ │ │ ├── index.ts │ │ │ ├── Footer.styled.ts │ │ │ └── Footer.tsx │ │ ├── Select │ │ │ ├── index.ts │ │ │ ├── Select.tsx │ │ │ └── Select.styled.ts │ │ ├── CartIcon │ │ │ ├── index.ts │ │ │ ├── CartIcon.tsx │ │ │ └── CartIcon.styled.ts │ │ ├── CartItems │ │ │ ├── index.ts │ │ │ └── CartItem.tsx │ │ ├── CartDropdown │ │ │ └── index.ts │ │ ├── CheckoutForm │ │ │ └── index.ts │ │ ├── CheckoutItem │ │ │ └── index.ts │ │ ├── PlatformFlag │ │ │ ├── index.ts │ │ │ ├── PlatformFlag.tsx │ │ │ └── PlatformFlag.styled.ts │ │ ├── ProductCard │ │ │ ├── index.ts │ │ │ └── ProductCard.styled.ts │ │ ├── ProductList │ │ │ ├── index.ts │ │ │ ├── ProductList.styled.ts │ │ │ └── ProductList.tsx │ │ ├── ProductPrice │ │ │ ├── index.ts │ │ │ └── ProductPrice.tsx │ │ ├── ProductReviews │ │ │ └── index.ts │ │ ├── Recommendations │ │ │ ├── index.ts │ │ │ ├── Recommendations.tsx │ │ │ └── Recommendations.styled.ts │ │ ├── CurrencySwitcher │ │ │ └── index.ts │ │ └── Cart │ │ │ └── EmptyCart.tsx │ ├── Dockerfile.cypress │ ├── utils │ │ ├── enums │ │ │ ├── AttributeNames.ts │ │ │ └── CypressFields.ts │ │ ├── Cypress.ts │ │ ├── Request.ts │ │ ├── telemetry │ │ │ └── SessionIdProcessor.ts │ │ └── imageLoader.js │ ├── .prettierrc │ ├── genproto │ │ └── Dockerfile │ ├── types │ │ └── Cart.ts │ ├── gateways │ │ ├── rpc │ │ │ ├── Ad.gateway.ts │ │ │ ├── Checkout.gateway.ts │ │ │ ├── Recommendations.gateway.ts │ │ │ ├── ProductCatalog.gateway.ts │ │ │ ├── Currency.gateway.ts │ │ │ └── Cart.gateway.ts │ │ └── Session.gateway.ts │ ├── tsconfig.json │ ├── .eslintrc │ ├── cypress.config.ts │ ├── pages │ │ ├── api │ │ │ ├── currency.ts │ │ │ ├── data.ts │ │ │ ├── products │ │ │ │ ├── index.ts │ │ │ │ └── [productId] │ │ │ │ │ └── index.ts │ │ │ ├── product-reviews │ │ │ │ └── [productId] │ │ │ │ │ └── index.ts │ │ │ ├── product-reviews-avg-score │ │ │ │ └── [productId] │ │ │ │ │ └── index.ts │ │ │ ├── product-ask-ai-assistant │ │ │ │ └── [productId] │ │ │ │ │ └── index.ts │ │ │ └── shipping.ts │ │ └── cart │ │ │ └── index.tsx │ ├── services │ │ └── ProductReview.service.ts │ ├── README.md │ └── styles │ │ ├── style.d.ts │ │ ├── Theme.ts │ │ ├── globals.css │ │ └── Home.styled.ts ├── shipping │ ├── .dockerignore │ ├── src │ │ └── shipping_service │ │ │ └── tracking.rs │ ├── README.md │ └── Cargo.toml ├── currency │ ├── .dockerignore │ ├── CMakeLists.txt │ ├── README.md │ └── genproto │ │ └── Dockerfile ├── quote │ ├── .dockerignore │ ├── .gitignore │ ├── src │ │ └── Application │ │ │ └── Settings │ │ │ ├── SettingsInterface.php │ │ │ └── Settings.php │ ├── Dockerfile │ ├── app │ │ ├── settings.php │ │ └── dependencies.php │ ├── composer.json │ └── README.md ├── cart │ ├── src │ │ ├── .dockerignore │ │ ├── appsettings.json │ │ └── cartstore │ │ │ └── ICartStore.cs │ ├── NuGet.config │ ├── README.md │ ├── Directory.Build.props │ └── tests │ │ └── cart.tests.csproj ├── flagd-ui │ ├── rel │ │ └── overlays │ │ │ └── bin │ │ │ ├── server.bat │ │ │ └── server │ ├── test │ │ ├── test_helper.exs │ │ ├── flagd_ui_web │ │ │ └── controllers │ │ │ │ ├── page_controller_test.exs │ │ │ │ ├── error_json_test.exs │ │ │ │ └── error_html_test.exs │ │ └── flagd_ui │ │ │ └── storage_test.exs │ ├── priv │ │ ├── static │ │ │ ├── favicon.ico │ │ │ └── robots.txt │ │ └── gettext │ │ │ ├── en │ │ │ └── LC_MESSAGES │ │ │ │ └── errors.po │ │ │ └── errors.pot │ ├── lib │ │ ├── flagd_ui │ │ │ └── mailer.ex │ │ ├── flagd_ui.ex │ │ └── flagd_ui_web │ │ │ ├── controllers │ │ │ ├── page_html.ex │ │ │ ├── feature_controller.ex │ │ │ ├── error_json.ex │ │ │ └── error_html.ex │ │ │ └── gettext.ex │ ├── .formatter.exs │ ├── config │ │ ├── prod.exs │ │ └── test.exs │ └── .gitignore ├── payment │ ├── .dockerignore │ ├── README.md │ ├── Dockerfile │ └── logger.js ├── llm │ ├── requirements.txt │ ├── product-review-summaries │ │ └── inaccurate-product-review-summaries.json │ └── Dockerfile ├── image-provider │ ├── static │ │ ├── Banner.png │ │ ├── products │ │ │ ├── SolarFilter.jpg │ │ │ ├── TheCometBook.jpg │ │ │ ├── LensCleaningKit.jpg │ │ │ ├── RedFlashlight.jpg │ │ │ ├── RoofBinoculars.jpg │ │ │ ├── StarsenseExplorer.jpg │ │ │ ├── OpticalTubeAssembly.jpg │ │ │ ├── SolarSystemColorImager.jpg │ │ │ ├── EclipsmartTravelRefractorTelescope.jpg │ │ │ └── NationalParkFoundationExplorascope.jpg │ │ └── opentelemetry-demo-logo.png │ ├── Dockerfile │ └── nginx.conf.template ├── jaeger │ ├── ui │ │ └── static │ │ │ ├── favicon-BxcVf0am.ico │ │ │ └── monitor-BYreg9RK.png │ ├── Dockerfile │ └── nginx.conf.template ├── postgres │ └── Dockerfile ├── product-reviews │ ├── genproto │ │ └── Dockerfile │ ├── requirements.txt │ ├── metrics.py │ ├── Dockerfile │ └── README.md ├── recommendation │ ├── genproto │ │ └── Dockerfile │ ├── requirements.txt │ ├── README.md │ ├── metrics.py │ └── Dockerfile ├── kafka │ ├── README.md │ └── Dockerfile ├── checkout │ ├── genproto │ │ └── Dockerfile │ ├── README.md │ └── Dockerfile ├── frontend-proxy │ ├── README.md │ └── Dockerfile ├── product-catalog │ ├── genproto │ │ └── Dockerfile │ ├── Dockerfile │ └── README.md ├── grafana │ └── provisioning │ │ ├── datasources │ │ ├── victorialogs.yaml │ │ ├── victoriametrics.yaml │ │ ├── victoriametrics-prom.yaml │ │ └── victoriatraces.yaml │ │ └── dashboards │ │ └── demo.yaml ├── load-generator │ ├── README.md │ ├── requirements.txt │ └── Dockerfile └── otel-collector │ └── otelcol-config-extras.yml ├── .env.arm64 ├── .yamlignore ├── .gitattributes ├── internal └── tools │ ├── go.mod │ ├── go.sum │ └── tools.go ├── test ├── tracetesting │ ├── cli-config.yml │ ├── ad │ │ ├── all.yaml │ │ └── get.yaml │ ├── email │ │ └── all.yaml │ ├── recommendation │ │ ├── all.yaml │ │ └── list.yaml │ ├── currency │ │ ├── all.yaml │ │ ├── supported.yaml │ │ └── convert.yaml │ ├── checkout │ │ ├── all.yaml │ │ └── add-item-to-cart.yaml │ ├── shipping │ │ └── all.yaml │ ├── product-catalog │ │ ├── all.yaml │ │ ├── list.yaml │ │ └── search.yaml │ ├── product-reviews │ │ ├── all.yaml │ │ ├── reviews.yaml │ │ └── summary.yaml │ ├── otelcol-config-tracetest.yml │ ├── payment │ │ └── all.yaml │ ├── cart │ │ ├── all.yaml │ │ ├── empty-cart.yaml │ │ ├── check-if-cart-is-empty.yaml │ │ └── check-if-cart-is-populated.yaml │ ├── frontend │ │ ├── all.yaml │ │ └── 05-view-cart.yaml │ ├── Dockerfile │ ├── tracetest-config.yaml │ └── tracetest-provision.yaml └── README.md ├── package.json ├── .markdownlint.yaml ├── .linkspector.yml ├── .env.override ├── .dockerignore ├── .yamllint ├── .github └── ISSUE_TEMPLATE │ └── question.md ├── docker-compose-tests_include-override.yml └── .gitignore /src/accounting/.gitignore: -------------------------------------------------------------------------------- 1 | proto -------------------------------------------------------------------------------- /src/ad/.java-version: -------------------------------------------------------------------------------- 1 | 21.0 2 | -------------------------------------------------------------------------------- /src/email/.ruby-version: -------------------------------------------------------------------------------- 1 | 3.4.7 2 | -------------------------------------------------------------------------------- /src/email/.dockerignore: -------------------------------------------------------------------------------- 1 | README.md 2 | -------------------------------------------------------------------------------- /.env.arm64: -------------------------------------------------------------------------------- 1 | _JAVA_OPTIONS=-XX:UseSVE=0 2 | -------------------------------------------------------------------------------- /src/fraud-detection/.dockerignore: -------------------------------------------------------------------------------- 1 | Dockerfile -------------------------------------------------------------------------------- /src/react-native-app/.ruby-version: -------------------------------------------------------------------------------- 1 | 2.7.6 2 | -------------------------------------------------------------------------------- /.yamlignore: -------------------------------------------------------------------------------- 1 | kubernetes/opentelemetry-demo.yaml 2 | -------------------------------------------------------------------------------- /src/accounting/.dockerignore: -------------------------------------------------------------------------------- 1 | bin 2 | obj 3 | build -------------------------------------------------------------------------------- /src/frontend/.dockerignore: -------------------------------------------------------------------------------- 1 | node_modules 2 | .next 3 | -------------------------------------------------------------------------------- /src/shipping/.dockerignore: -------------------------------------------------------------------------------- 1 | target/ 2 | Dockerfile 3 | -------------------------------------------------------------------------------- /src/react-native-app/.prettierignore: -------------------------------------------------------------------------------- 1 | expo-env.d.ts 2 | -------------------------------------------------------------------------------- /src/react-native-app/ios/reactnativeapp/noop-file.swift: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /src/currency/.dockerignore: -------------------------------------------------------------------------------- 1 | client.js 2 | node_modules/ 3 | out/ 4 | -------------------------------------------------------------------------------- /src/fraud-detection/gradle.properties: -------------------------------------------------------------------------------- 1 | kotlin.code.style=official 2 | -------------------------------------------------------------------------------- /.gitattributes: -------------------------------------------------------------------------------- 1 | 2 | 3 | * text=auto 4 | 5 | gradlew text eol=lf 6 | -------------------------------------------------------------------------------- /src/ad/settings.gradle: -------------------------------------------------------------------------------- 1 | 2 | rootProject.name = 'opentelemetry-demo-ad' 3 | -------------------------------------------------------------------------------- /src/quote/.dockerignore: -------------------------------------------------------------------------------- 1 | .dockerignore 2 | .idea 3 | Dockerfile 4 | vendor 5 | -------------------------------------------------------------------------------- /src/react-native-app/android/app/src/main/res/values-night/colors.xml: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /src/fraud-detection/settings.gradle.kts: -------------------------------------------------------------------------------- 1 | 2 | rootProject.name = "fraud-detection" 3 | 4 | -------------------------------------------------------------------------------- /src/react-native-app/Gemfile: -------------------------------------------------------------------------------- 1 | source 'https://rubygems.org' 2 | gem 'cocoapods', '1.16.2' 3 | -------------------------------------------------------------------------------- /src/cart/src/.dockerignore: -------------------------------------------------------------------------------- 1 | **/*.sh 2 | **/*.bat 3 | **/bin/ 4 | **/obj/ 5 | **/out/ 6 | Dockerfile* -------------------------------------------------------------------------------- /src/flagd-ui/rel/overlays/bin/server.bat: -------------------------------------------------------------------------------- 1 | set PHX_SERVER=true 2 | call "%~dp0\flagd_ui" start 3 | -------------------------------------------------------------------------------- /src/frontend/.prettierignore: -------------------------------------------------------------------------------- 1 | .idea 2 | .git 3 | build 4 | dist 5 | .husky 6 | node_modules 7 | protos/ 8 | -------------------------------------------------------------------------------- /src/react-native-app/.dockerignore: -------------------------------------------------------------------------------- 1 | node_modules/ 2 | .expo/ 3 | dist/ 4 | android/build/ 5 | ios/build/ 6 | ios/Pods/ 7 | -------------------------------------------------------------------------------- /src/payment/.dockerignore: -------------------------------------------------------------------------------- 1 | node_modules/ 2 | .dockerignore 3 | Dockerfile 4 | package.json 5 | package-lock.json 6 | README.md -------------------------------------------------------------------------------- /src/quote/.gitignore: -------------------------------------------------------------------------------- 1 | .idea/ 2 | .vscode/ 3 | /coverage/ 4 | /vendor/ 5 | /logs/* 6 | !/logs/README.md 7 | .phpunit.result.cache 8 | -------------------------------------------------------------------------------- /src/react-native-app/.env: -------------------------------------------------------------------------------- 1 | # https://docs.expo.dev/guides/environment-variables/ 2 | 3 | EXPO_PUBLIC_FRONTEND_PROXY_PORT=8080 4 | -------------------------------------------------------------------------------- /src/llm/requirements.txt: -------------------------------------------------------------------------------- 1 | python-dotenv==1.2.1 2 | python-json-logger==4.0.0 3 | flask==3.1.2 4 | openfeature-provider-flagd==0.2.3 5 | -------------------------------------------------------------------------------- /src/flagd-ui/rel/overlays/bin/server: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | set -eu 3 | 4 | cd -P -- "$(dirname -- "$0")" 5 | PHX_SERVER=true exec ./flagd_ui start 6 | -------------------------------------------------------------------------------- /src/flagd-ui/test/test_helper.exs: -------------------------------------------------------------------------------- 1 | # Copyright The OpenTelemetry Authors 2 | # SPDX-License-Identifier: Apache-2.0 3 | 4 | ExUnit.start() 5 | -------------------------------------------------------------------------------- /src/frontend/public/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/VictoriaMetrics-Community/opentelemetry-demo/HEAD/src/frontend/public/favicon.ico -------------------------------------------------------------------------------- /src/react-native-app/ios/Podfile.properties.json: -------------------------------------------------------------------------------- 1 | { 2 | "expo.jsEngine": "hermes", 3 | "EX_DEV_CLIENT_NETWORK_INSPECTOR": "true" 4 | } 5 | -------------------------------------------------------------------------------- /src/flagd-ui/priv/static/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/VictoriaMetrics-Community/opentelemetry-demo/HEAD/src/flagd-ui/priv/static/favicon.ico -------------------------------------------------------------------------------- /src/image-provider/static/Banner.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/VictoriaMetrics-Community/opentelemetry-demo/HEAD/src/image-provider/static/Banner.png -------------------------------------------------------------------------------- /src/react-native-app/ios/reactnativeapp/Images.xcassets/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "info" : { 3 | "version" : 1, 4 | "author" : "expo" 5 | } 6 | } 7 | -------------------------------------------------------------------------------- /src/ad/gradle/wrapper/gradle-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/VictoriaMetrics-Community/opentelemetry-demo/HEAD/src/ad/gradle/wrapper/gradle-wrapper.jar -------------------------------------------------------------------------------- /src/frontend/components/Ad/index.ts: -------------------------------------------------------------------------------- 1 | // Copyright The OpenTelemetry Authors 2 | // SPDX-License-Identifier: Apache-2.0 3 | 4 | export { default } from './Ad'; 5 | -------------------------------------------------------------------------------- /src/jaeger/ui/static/favicon-BxcVf0am.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/VictoriaMetrics-Community/opentelemetry-demo/HEAD/src/jaeger/ui/static/favicon-BxcVf0am.ico -------------------------------------------------------------------------------- /src/jaeger/ui/static/monitor-BYreg9RK.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/VictoriaMetrics-Community/opentelemetry-demo/HEAD/src/jaeger/ui/static/monitor-BYreg9RK.png -------------------------------------------------------------------------------- /src/frontend/components/Header/index.ts: -------------------------------------------------------------------------------- 1 | // Copyright The OpenTelemetry Authors 2 | // SPDX-License-Identifier: Apache-2.0 3 | 4 | export {default} from './Header'; 5 | -------------------------------------------------------------------------------- /src/frontend/components/Input/index.ts: -------------------------------------------------------------------------------- 1 | // Copyright The OpenTelemetry Authors 2 | // SPDX-License-Identifier: Apache-2.0 3 | 4 | export {default} from './Input'; 5 | -------------------------------------------------------------------------------- /src/frontend/components/Layout/index.ts: -------------------------------------------------------------------------------- 1 | // Copyright The OpenTelemetry Authors 2 | // SPDX-License-Identifier: Apache-2.0 3 | 4 | export {default} from './Layout'; 5 | -------------------------------------------------------------------------------- /src/react-native-app/assets/images/icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/VictoriaMetrics-Community/opentelemetry-demo/HEAD/src/react-native-app/assets/images/icon.png -------------------------------------------------------------------------------- /internal/tools/go.mod: -------------------------------------------------------------------------------- 1 | module github.com/open-telemetry/opentelemetry-specification/internal/tools 2 | 3 | go 1.12 4 | 5 | require github.com/client9/misspell v0.3.4 6 | -------------------------------------------------------------------------------- /src/frontend/components/Banner/index.ts: -------------------------------------------------------------------------------- 1 | // Copyright The OpenTelemetry Authors 2 | // SPDX-License-Identifier: Apache-2.0 3 | 4 | export { default } from './Banner'; 5 | -------------------------------------------------------------------------------- /src/frontend/components/Button/index.ts: -------------------------------------------------------------------------------- 1 | // Copyright The OpenTelemetry Authors 2 | // SPDX-License-Identifier: Apache-2.0 3 | 4 | export { default } from './Button'; 5 | -------------------------------------------------------------------------------- /src/frontend/components/Footer/index.ts: -------------------------------------------------------------------------------- 1 | // Copyright The OpenTelemetry Authors 2 | // SPDX-License-Identifier: Apache-2.0 3 | 4 | export { default } from './Footer'; 5 | -------------------------------------------------------------------------------- /src/frontend/components/Select/index.ts: -------------------------------------------------------------------------------- 1 | // Copyright The OpenTelemetry Authors 2 | // SPDX-License-Identifier: Apache-2.0 3 | 4 | export { default } from './Select'; 5 | -------------------------------------------------------------------------------- /src/react-native-app/assets/images/favicon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/VictoriaMetrics-Community/opentelemetry-demo/HEAD/src/react-native-app/assets/images/favicon.png -------------------------------------------------------------------------------- /src/react-native-app/assets/images/splash.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/VictoriaMetrics-Community/opentelemetry-demo/HEAD/src/react-native-app/assets/images/splash.png -------------------------------------------------------------------------------- /src/frontend/components/CartIcon/index.ts: -------------------------------------------------------------------------------- 1 | // Copyright The OpenTelemetry Authors 2 | // SPDX-License-Identifier: Apache-2.0 3 | 4 | export { default } from './CartIcon'; 5 | -------------------------------------------------------------------------------- /src/frontend/components/CartItems/index.ts: -------------------------------------------------------------------------------- 1 | // Copyright The OpenTelemetry Authors 2 | // SPDX-License-Identifier: Apache-2.0 3 | 4 | export { default } from './CartItems'; 5 | -------------------------------------------------------------------------------- /src/react-native-app/android/app/debug.keystore: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/VictoriaMetrics-Community/opentelemetry-demo/HEAD/src/react-native-app/android/app/debug.keystore -------------------------------------------------------------------------------- /src/frontend/components/CartDropdown/index.ts: -------------------------------------------------------------------------------- 1 | // Copyright The OpenTelemetry Authors 2 | // SPDX-License-Identifier: Apache-2.0 3 | 4 | export { default } from './CartDropdown'; 5 | -------------------------------------------------------------------------------- /src/frontend/components/CheckoutForm/index.ts: -------------------------------------------------------------------------------- 1 | // Copyright The OpenTelemetry Authors 2 | // SPDX-License-Identifier: Apache-2.0 3 | 4 | export { default } from './CheckoutForm'; 5 | -------------------------------------------------------------------------------- /src/frontend/components/CheckoutItem/index.ts: -------------------------------------------------------------------------------- 1 | // Copyright The OpenTelemetry Authors 2 | // SPDX-License-Identifier: Apache-2.0 3 | 4 | export { default } from './CheckoutItem'; 5 | -------------------------------------------------------------------------------- /src/frontend/components/PlatformFlag/index.ts: -------------------------------------------------------------------------------- 1 | // Copyright The OpenTelemetry Authors 2 | // SPDX-License-Identifier: Apache-2.0 3 | 4 | export { default } from './PlatformFlag'; 5 | -------------------------------------------------------------------------------- /src/frontend/components/ProductCard/index.ts: -------------------------------------------------------------------------------- 1 | // Copyright The OpenTelemetry Authors 2 | // SPDX-License-Identifier: Apache-2.0 3 | 4 | export { default } from './ProductCard'; 5 | -------------------------------------------------------------------------------- /src/frontend/components/ProductList/index.ts: -------------------------------------------------------------------------------- 1 | // Copyright The OpenTelemetry Authors 2 | // SPDX-License-Identifier: Apache-2.0 3 | 4 | export { default } from './ProductList'; 5 | -------------------------------------------------------------------------------- /src/frontend/components/ProductPrice/index.ts: -------------------------------------------------------------------------------- 1 | // Copyright The OpenTelemetry Authors 2 | // SPDX-License-Identifier: Apache-2.0 3 | 4 | export { default } from './ProductPrice'; 5 | -------------------------------------------------------------------------------- /src/image-provider/static/products/SolarFilter.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/VictoriaMetrics-Community/opentelemetry-demo/HEAD/src/image-provider/static/products/SolarFilter.jpg -------------------------------------------------------------------------------- /src/image-provider/static/products/TheCometBook.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/VictoriaMetrics-Community/opentelemetry-demo/HEAD/src/image-provider/static/products/TheCometBook.jpg -------------------------------------------------------------------------------- /src/react-native-app/components/EmptyCart/index.ts: -------------------------------------------------------------------------------- 1 | // Copyright The OpenTelemetry Authors 2 | // SPDX-License-Identifier: Apache-2.0 3 | export { default } from "./EmptyCart"; 4 | -------------------------------------------------------------------------------- /src/react-native-app/components/ProductCard/index.ts: -------------------------------------------------------------------------------- 1 | // Copyright The OpenTelemetry Authors 2 | // SPDX-License-Identifier: Apache-2.0 3 | export { default } from "./ProductCard"; 4 | -------------------------------------------------------------------------------- /src/react-native-app/components/ProductList/index.ts: -------------------------------------------------------------------------------- 1 | // Copyright The OpenTelemetry Authors 2 | // SPDX-License-Identifier: Apache-2.0 3 | export { default } from "./ProductList"; 4 | -------------------------------------------------------------------------------- /src/react-native-app/hooks/useColorScheme.ts: -------------------------------------------------------------------------------- 1 | // Copyright The OpenTelemetry Authors 2 | // SPDX-License-Identifier: Apache-2.0 3 | export { useColorScheme } from "react-native"; 4 | -------------------------------------------------------------------------------- /src/fraud-detection/gradle/wrapper/gradle-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/VictoriaMetrics-Community/opentelemetry-demo/HEAD/src/fraud-detection/gradle/wrapper/gradle-wrapper.jar -------------------------------------------------------------------------------- /src/frontend/components/ProductReviews/index.ts: -------------------------------------------------------------------------------- 1 | // Copyright The OpenTelemetry Authors 2 | // SPDX-License-Identifier: Apache-2.0 3 | 4 | export { default } from './ProductReviews'; 5 | -------------------------------------------------------------------------------- /src/frontend/components/Recommendations/index.ts: -------------------------------------------------------------------------------- 1 | // Copyright The OpenTelemetry Authors 2 | // SPDX-License-Identifier: Apache-2.0 3 | 4 | export { default } from './Recommendations'; 5 | -------------------------------------------------------------------------------- /src/image-provider/static/opentelemetry-demo-logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/VictoriaMetrics-Community/opentelemetry-demo/HEAD/src/image-provider/static/opentelemetry-demo-logo.png -------------------------------------------------------------------------------- /src/image-provider/static/products/LensCleaningKit.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/VictoriaMetrics-Community/opentelemetry-demo/HEAD/src/image-provider/static/products/LensCleaningKit.jpg -------------------------------------------------------------------------------- /src/image-provider/static/products/RedFlashlight.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/VictoriaMetrics-Community/opentelemetry-demo/HEAD/src/image-provider/static/products/RedFlashlight.jpg -------------------------------------------------------------------------------- /src/image-provider/static/products/RoofBinoculars.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/VictoriaMetrics-Community/opentelemetry-demo/HEAD/src/image-provider/static/products/RoofBinoculars.jpg -------------------------------------------------------------------------------- /src/react-native-app/assets/images/adaptive-icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/VictoriaMetrics-Community/opentelemetry-demo/HEAD/src/react-native-app/assets/images/adaptive-icon.png -------------------------------------------------------------------------------- /src/react-native-app/components/CheckoutForm/index.ts: -------------------------------------------------------------------------------- 1 | // Copyright The OpenTelemetry Authors 2 | // SPDX-License-Identifier: Apache-2.0 3 | export { default } from "./CheckoutForm"; 4 | -------------------------------------------------------------------------------- /src/frontend/components/CurrencySwitcher/index.ts: -------------------------------------------------------------------------------- 1 | // Copyright The OpenTelemetry Authors 2 | // SPDX-License-Identifier: Apache-2.0 3 | 4 | export { default } from './CurrencySwitcher'; 5 | -------------------------------------------------------------------------------- /src/image-provider/static/products/StarsenseExplorer.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/VictoriaMetrics-Community/opentelemetry-demo/HEAD/src/image-provider/static/products/StarsenseExplorer.jpg -------------------------------------------------------------------------------- /src/react-native-app/assets/fonts/SpaceMono-Regular.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/VictoriaMetrics-Community/opentelemetry-demo/HEAD/src/react-native-app/assets/fonts/SpaceMono-Regular.ttf -------------------------------------------------------------------------------- /src/frontend/Dockerfile.cypress: -------------------------------------------------------------------------------- 1 | FROM cypress/included:14.5.0 2 | 3 | WORKDIR /app 4 | 5 | COPY ./src/frontend . 6 | 7 | RUN npm clean-install 8 | 9 | ENTRYPOINT ["cypress", "run"] 10 | -------------------------------------------------------------------------------- /src/image-provider/static/products/OpticalTubeAssembly.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/VictoriaMetrics-Community/opentelemetry-demo/HEAD/src/image-provider/static/products/OpticalTubeAssembly.jpg -------------------------------------------------------------------------------- /internal/tools/go.sum: -------------------------------------------------------------------------------- 1 | github.com/client9/misspell v0.3.4 h1:ta993UF76GwbvJcIo3Y68y/M3WxlpEHPWIGDkJYwzJI= 2 | github.com/client9/misspell v0.3.4/go.mod h1:qj6jICC3Q7zFZvVWo7KLAzC3yx5G7kyvSDkc90ppPyw= 3 | -------------------------------------------------------------------------------- /src/image-provider/static/products/SolarSystemColorImager.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/VictoriaMetrics-Community/opentelemetry-demo/HEAD/src/image-provider/static/products/SolarSystemColorImager.jpg -------------------------------------------------------------------------------- /test/tracetesting/cli-config.yml: -------------------------------------------------------------------------------- 1 | # Copyright The OpenTelemetry Authors 2 | # SPDX-License-Identifier: Apache-2.0 3 | 4 | scheme: http 5 | endpoint: tracetest-server:11633 6 | analyticsEnabled: false 7 | -------------------------------------------------------------------------------- /src/flagd-ui/lib/flagd_ui/mailer.ex: -------------------------------------------------------------------------------- 1 | # Copyright The OpenTelemetry Authors 2 | # SPDX-License-Identifier: Apache-2.0 3 | 4 | defmodule FlagdUi.Mailer do 5 | use Swoosh.Mailer, otp_app: :flagd_ui 6 | end 7 | -------------------------------------------------------------------------------- /src/frontend/utils/enums/AttributeNames.ts: -------------------------------------------------------------------------------- 1 | // Copyright The OpenTelemetry Authors 2 | // SPDX-License-Identifier: Apache-2.0 3 | 4 | export enum AttributeNames { 5 | SESSION_ID = 'session.id' 6 | } 7 | -------------------------------------------------------------------------------- /src/react-native-app/android/gradle/wrapper/gradle-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/VictoriaMetrics-Community/opentelemetry-demo/HEAD/src/react-native-app/android/gradle/wrapper/gradle-wrapper.jar -------------------------------------------------------------------------------- /src/react-native-app/android/app/src/main/ic_launcher-playstore.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/VictoriaMetrics-Community/opentelemetry-demo/HEAD/src/react-native-app/android/app/src/main/ic_launcher-playstore.png -------------------------------------------------------------------------------- /src/react-native-app/android/app/src/main/res/values/ic_launcher_background.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | #FFFFFF 4 | 5 | -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "devDependencies": { 3 | "markdown-toc": "^1.2.0", 4 | "markdownlint-cli": "0.46.0", 5 | "@kt3k/license-checker": "^3.2.2", 6 | "@umbrelladocs/linkspector": "^0.4.7" 7 | } 8 | } 9 | -------------------------------------------------------------------------------- /src/image-provider/static/products/EclipsmartTravelRefractorTelescope.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/VictoriaMetrics-Community/opentelemetry-demo/HEAD/src/image-provider/static/products/EclipsmartTravelRefractorTelescope.jpg -------------------------------------------------------------------------------- /src/image-provider/static/products/NationalParkFoundationExplorascope.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/VictoriaMetrics-Community/opentelemetry-demo/HEAD/src/image-provider/static/products/NationalParkFoundationExplorascope.jpg -------------------------------------------------------------------------------- /src/react-native-app/android/app/src/main/res/mipmap-hdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/VictoriaMetrics-Community/opentelemetry-demo/HEAD/src/react-native-app/android/app/src/main/res/mipmap-hdpi/ic_launcher.png -------------------------------------------------------------------------------- /src/react-native-app/android/app/src/main/res/mipmap-mdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/VictoriaMetrics-Community/opentelemetry-demo/HEAD/src/react-native-app/android/app/src/main/res/mipmap-mdpi/ic_launcher.png -------------------------------------------------------------------------------- /src/react-native-app/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/VictoriaMetrics-Community/opentelemetry-demo/HEAD/src/react-native-app/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png -------------------------------------------------------------------------------- /src/react-native-app/android/app/src/main/res/drawable/splashscreen.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | -------------------------------------------------------------------------------- /src/react-native-app/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/VictoriaMetrics-Community/opentelemetry-demo/HEAD/src/react-native-app/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png -------------------------------------------------------------------------------- /src/react-native-app/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/VictoriaMetrics-Community/opentelemetry-demo/HEAD/src/react-native-app/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png -------------------------------------------------------------------------------- /src/react-native-app/android/app/src/main/res/mipmap-hdpi/ic_launcher_round.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/VictoriaMetrics-Community/opentelemetry-demo/HEAD/src/react-native-app/android/app/src/main/res/mipmap-hdpi/ic_launcher_round.png -------------------------------------------------------------------------------- /src/react-native-app/android/app/src/main/res/mipmap-mdpi/ic_launcher_round.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/VictoriaMetrics-Community/opentelemetry-demo/HEAD/src/react-native-app/android/app/src/main/res/mipmap-mdpi/ic_launcher_round.png -------------------------------------------------------------------------------- /src/postgres/Dockerfile: -------------------------------------------------------------------------------- 1 | # Copyright The OpenTelemetry Authors 2 | # SPDX-License-Identifier: Apache-2.0 3 | 4 | FROM postgres:17.6 5 | 6 | COPY ./src/postgres/init.sql /docker-entrypoint-initdb.d/init.sql 7 | 8 | EXPOSE ${POSTGRES_PORT} 9 | -------------------------------------------------------------------------------- /src/product-reviews/genproto/Dockerfile: -------------------------------------------------------------------------------- 1 | # Copyright The OpenTelemetry Authors 2 | # SPDX-License-Identifier: Apache-2.0 3 | 4 | FROM python:3.12-slim-bookworm 5 | 6 | WORKDIR /build 7 | 8 | RUN python -m pip install grpcio-tools==1.59.2 9 | -------------------------------------------------------------------------------- /src/react-native-app/android/app/src/main/res/mipmap-xhdpi/ic_launcher_round.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/VictoriaMetrics-Community/opentelemetry-demo/HEAD/src/react-native-app/android/app/src/main/res/mipmap-xhdpi/ic_launcher_round.png -------------------------------------------------------------------------------- /src/react-native-app/android/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/VictoriaMetrics-Community/opentelemetry-demo/HEAD/src/react-native-app/android/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png -------------------------------------------------------------------------------- /src/recommendation/genproto/Dockerfile: -------------------------------------------------------------------------------- 1 | # Copyright The OpenTelemetry Authors 2 | # SPDX-License-Identifier: Apache-2.0 3 | 4 | FROM python:3.12-slim-bookworm 5 | 6 | WORKDIR /build 7 | 8 | RUN python -m pip install grpcio-tools==1.59.2 9 | -------------------------------------------------------------------------------- /src/react-native-app/android/app/src/main/res/drawable-hdpi/splashscreen_image.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/VictoriaMetrics-Community/opentelemetry-demo/HEAD/src/react-native-app/android/app/src/main/res/drawable-hdpi/splashscreen_image.png -------------------------------------------------------------------------------- /src/react-native-app/android/app/src/main/res/drawable-mdpi/splashscreen_image.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/VictoriaMetrics-Community/opentelemetry-demo/HEAD/src/react-native-app/android/app/src/main/res/drawable-mdpi/splashscreen_image.png -------------------------------------------------------------------------------- /src/react-native-app/android/app/src/main/res/drawable-xhdpi/splashscreen_image.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/VictoriaMetrics-Community/opentelemetry-demo/HEAD/src/react-native-app/android/app/src/main/res/drawable-xhdpi/splashscreen_image.png -------------------------------------------------------------------------------- /src/react-native-app/android/app/src/main/res/drawable-xxhdpi/splashscreen_image.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/VictoriaMetrics-Community/opentelemetry-demo/HEAD/src/react-native-app/android/app/src/main/res/drawable-xxhdpi/splashscreen_image.png -------------------------------------------------------------------------------- /src/react-native-app/android/app/src/main/res/mipmap-hdpi/ic_launcher_foreground.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/VictoriaMetrics-Community/opentelemetry-demo/HEAD/src/react-native-app/android/app/src/main/res/mipmap-hdpi/ic_launcher_foreground.png -------------------------------------------------------------------------------- /src/react-native-app/android/app/src/main/res/mipmap-mdpi/ic_launcher_foreground.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/VictoriaMetrics-Community/opentelemetry-demo/HEAD/src/react-native-app/android/app/src/main/res/mipmap-mdpi/ic_launcher_foreground.png -------------------------------------------------------------------------------- /src/react-native-app/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/VictoriaMetrics-Community/opentelemetry-demo/HEAD/src/react-native-app/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png -------------------------------------------------------------------------------- /src/react-native-app/android/.gitignore: -------------------------------------------------------------------------------- 1 | # OSX 2 | # 3 | .DS_Store 4 | 5 | # Android/IntelliJ 6 | # 7 | build/ 8 | .idea 9 | .gradle 10 | local.properties 11 | *.iml 12 | *.hprof 13 | .cxx/ 14 | 15 | # Bundle artifacts 16 | *.jsbundle 17 | -------------------------------------------------------------------------------- /src/react-native-app/android/app/src/main/res/drawable-xxxhdpi/splashscreen_image.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/VictoriaMetrics-Community/opentelemetry-demo/HEAD/src/react-native-app/android/app/src/main/res/drawable-xxxhdpi/splashscreen_image.png -------------------------------------------------------------------------------- /src/react-native-app/android/app/src/main/res/mipmap-xhdpi/ic_launcher_foreground.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/VictoriaMetrics-Community/opentelemetry-demo/HEAD/src/react-native-app/android/app/src/main/res/mipmap-xhdpi/ic_launcher_foreground.png -------------------------------------------------------------------------------- /src/react-native-app/android/app/src/main/res/mipmap-xxhdpi/ic_launcher_foreground.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/VictoriaMetrics-Community/opentelemetry-demo/HEAD/src/react-native-app/android/app/src/main/res/mipmap-xxhdpi/ic_launcher_foreground.png -------------------------------------------------------------------------------- /src/flagd-ui/priv/static/robots.txt: -------------------------------------------------------------------------------- 1 | # See https://www.robotstxt.org/robotstxt.html for documentation on how to use the robots.txt file 2 | # 3 | # To ban all spiders from the entire site uncomment the next two lines: 4 | # User-agent: * 5 | # Disallow: / 6 | -------------------------------------------------------------------------------- /src/react-native-app/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher_foreground.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/VictoriaMetrics-Community/opentelemetry-demo/HEAD/src/react-native-app/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher_foreground.png -------------------------------------------------------------------------------- /src/react-native-app/babel.config.js: -------------------------------------------------------------------------------- 1 | // Copyright The OpenTelemetry Authors 2 | // SPDX-License-Identifier: Apache-2.0 3 | module.exports = function (api) { 4 | api.cache(true); 5 | return { 6 | presets: ["babel-preset-expo"], 7 | }; 8 | }; 9 | -------------------------------------------------------------------------------- /src/react-native-app/ios/reactnativeapp/Images.xcassets/SplashScreen.imageset/image.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/VictoriaMetrics-Community/opentelemetry-demo/HEAD/src/react-native-app/ios/reactnativeapp/Images.xcassets/SplashScreen.imageset/image.png -------------------------------------------------------------------------------- /src/kafka/README.md: -------------------------------------------------------------------------------- 1 | # Kafka 2 | 3 | This is used as a message queue service to connect the checkout service with 4 | the accounting and fraud detection services. 5 | 6 | Kafka is run in KRaft mode. Environment variables are substituted at 7 | deploy-time. 8 | -------------------------------------------------------------------------------- /src/react-native-app/ios/reactnativeapp/reactnativeapp-Bridging-Header.h: -------------------------------------------------------------------------------- 1 | // Copyright The OpenTelemetry Authors 2 | // SPDX-License-Identifier: Apache-2.0 3 | // 4 | // Use this file to import your target's public headers that you would like to expose to Swift. 5 | // 6 | -------------------------------------------------------------------------------- /src/cart/NuGet.config: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /src/react-native-app/ios/reactnativeapp/Images.xcassets/SplashScreenBackground.imageset/image.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/VictoriaMetrics-Community/opentelemetry-demo/HEAD/src/react-native-app/ios/reactnativeapp/Images.xcassets/SplashScreenBackground.imageset/image.png -------------------------------------------------------------------------------- /src/react-native-app/ios/reactnativeapp/reactnativeapp.entitlements: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | -------------------------------------------------------------------------------- /.markdownlint.yaml: -------------------------------------------------------------------------------- 1 | # Copyright The OpenTelemetry Authors 2 | # SPDX-License-Identifier: Apache-2.0 3 | 4 | # Default state for all rules 5 | default: true 6 | 7 | # allow long lines for tables and code blocks 8 | MD013: 9 | code_blocks: false 10 | tables: false 11 | -------------------------------------------------------------------------------- /src/flagd-ui/.formatter.exs: -------------------------------------------------------------------------------- 1 | # Copyright The OpenTelemetry Authors 2 | # SPDX-License-Identifier: Apache-2.0 3 | 4 | [ 5 | import_deps: [:phoenix], 6 | plugins: [Phoenix.LiveView.HTMLFormatter], 7 | inputs: ["*.{heex,ex,exs}", "{config,lib,test}/**/*.{heex,ex,exs}"] 8 | ] 9 | -------------------------------------------------------------------------------- /src/react-native-app/ios/reactnativeapp/Images.xcassets/AppIcon.appiconset/App-Icon-1024x1024@1x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/VictoriaMetrics-Community/opentelemetry-demo/HEAD/src/react-native-app/ios/reactnativeapp/Images.xcassets/AppIcon.appiconset/App-Icon-1024x1024@1x.png -------------------------------------------------------------------------------- /src/shipping/src/shipping_service/tracking.rs: -------------------------------------------------------------------------------- 1 | // Copyright The OpenTelemetry Authors 2 | // SPDX-License-Identifier: Apache-2.0 3 | 4 | use uuid::Uuid; 5 | 6 | /// returns a tracking ID 7 | pub fn create_tracking_id() -> String { 8 | Uuid::new_v4().to_string() 9 | } 10 | -------------------------------------------------------------------------------- /src/react-native-app/ios/reactnativeapp/main.m: -------------------------------------------------------------------------------- 1 | #import 2 | 3 | #import "AppDelegate.h" 4 | 5 | int main(int argc, char * argv[]) { 6 | @autoreleasepool { 7 | return UIApplicationMain(argc, argv, nil, NSStringFromClass([AppDelegate class])); 8 | } 9 | } 10 | 11 | -------------------------------------------------------------------------------- /test/tracetesting/ad/all.yaml: -------------------------------------------------------------------------------- 1 | # Copyright The OpenTelemetry Authors 2 | # SPDX-License-Identifier: Apache-2.0 3 | 4 | type: TestSuite 5 | spec: 6 | id: ad-all 7 | name: 'Ad Service' 8 | description: Run all Ad Service tests enabled in sequence 9 | steps: 10 | - ./get.yaml 11 | -------------------------------------------------------------------------------- /src/react-native-app/ios/reactnativeapp/AppDelegate.h: -------------------------------------------------------------------------------- 1 | // Copyright The OpenTelemetry Authors 2 | // SPDX-License-Identifier: Apache-2.0 3 | #import 4 | #import 5 | #import 6 | 7 | @interface AppDelegate : EXAppDelegateWrapper 8 | 9 | @end 10 | -------------------------------------------------------------------------------- /test/tracetesting/email/all.yaml: -------------------------------------------------------------------------------- 1 | # Copyright The OpenTelemetry Authors 2 | # SPDX-License-Identifier: Apache-2.0 3 | 4 | type: TestSuite 5 | spec: 6 | id: email-all 7 | name: 'Email' 8 | description: Run all Email tests enabled in sequence 9 | steps: 10 | - ./confirmation.yaml 11 | -------------------------------------------------------------------------------- /src/react-native-app/android/app/src/main/res/values/colors.xml: -------------------------------------------------------------------------------- 1 | 2 | #ffffff 3 | #ffffff 4 | #023c69 5 | #ffffff 6 | 7 | -------------------------------------------------------------------------------- /src/cart/README.md: -------------------------------------------------------------------------------- 1 | # Cart Service 2 | 3 | This service stores user shopping carts in Valkey. 4 | 5 | ## Local Build 6 | 7 | Run `dotnet restore` and `dotnet build`. 8 | 9 | ## Docker Build 10 | 11 | From the root directory of this repository, run: 12 | 13 | ```sh 14 | docker compose build cart 15 | ``` 16 | -------------------------------------------------------------------------------- /src/ad/gradle/wrapper/gradle-wrapper.properties: -------------------------------------------------------------------------------- 1 | distributionBase=GRADLE_USER_HOME 2 | distributionPath=wrapper/dists 3 | distributionUrl=https\://services.gradle.org/distributions/gradle-8.12.1-bin.zip 4 | networkTimeout=10000 5 | validateDistributionUrl=true 6 | zipStoreBase=GRADLE_USER_HOME 7 | zipStorePath=wrapper/dists 8 | -------------------------------------------------------------------------------- /src/react-native-app/.eslintrc.js: -------------------------------------------------------------------------------- 1 | // Copyright The OpenTelemetry Authors 2 | // SPDX-License-Identifier: Apache-2.0 3 | // https://docs.expo.dev/guides/using-eslint/ 4 | module.exports = { 5 | extends: ["expo", "prettier"], 6 | plugins: ["prettier"], 7 | rules: { 8 | "prettier/prettier": "error", 9 | }, 10 | }; 11 | -------------------------------------------------------------------------------- /src/checkout/genproto/Dockerfile: -------------------------------------------------------------------------------- 1 | # Copyright The OpenTelemetry Authors 2 | # SPDX-License-Identifier: Apache-2.0 3 | 4 | FROM golang:1.24-alpine 5 | 6 | WORKDIR /build 7 | 8 | RUN apk add --no-cache protobuf-dev 9 | 10 | COPY ./src/checkout/go.mod go.mod 11 | COPY ./src/checkout/go.sum go.sum 12 | 13 | RUN go install tool 14 | -------------------------------------------------------------------------------- /src/fraud-detection/gradle/wrapper/gradle-wrapper.properties: -------------------------------------------------------------------------------- 1 | distributionBase=GRADLE_USER_HOME 2 | distributionPath=wrapper/dists 3 | distributionUrl=https\://services.gradle.org/distributions/gradle-8.12.1-bin.zip 4 | networkTimeout=10000 5 | validateDistributionUrl=true 6 | zipStoreBase=GRADLE_USER_HOME 7 | zipStorePath=wrapper/dists 8 | -------------------------------------------------------------------------------- /src/frontend-proxy/README.md: -------------------------------------------------------------------------------- 1 | # Frontend Proxy Service 2 | 3 | This service acts as a reverse proxy for the various user-facing web interfaces. 4 | 5 | ## Modifying the Envoy Configuration 6 | 7 | The envoy configuration is generated from the `envoy.tmpl.yaml` file in this 8 | directory. Environment variables are substituted at deploy-time. 9 | -------------------------------------------------------------------------------- /src/react-native-app/android/gradle/wrapper/gradle-wrapper.properties: -------------------------------------------------------------------------------- 1 | distributionBase=GRADLE_USER_HOME 2 | distributionPath=wrapper/dists 3 | distributionUrl=https\://services.gradle.org/distributions/gradle-8.6-all.zip 4 | networkTimeout=10000 5 | validateDistributionUrl=true 6 | zipStoreBase=GRADLE_USER_HOME 7 | zipStorePath=wrapper/dists 8 | -------------------------------------------------------------------------------- /test/tracetesting/recommendation/all.yaml: -------------------------------------------------------------------------------- 1 | # Copyright The OpenTelemetry Authors 2 | # SPDX-License-Identifier: Apache-2.0 3 | 4 | type: TestSuite 5 | spec: 6 | id: recommendation-all 7 | name: 'Recommendation Service' 8 | description: Run all Recommendation Service tests enabled in sequence 9 | steps: 10 | - ./list.yaml 11 | -------------------------------------------------------------------------------- /test/tracetesting/currency/all.yaml: -------------------------------------------------------------------------------- 1 | # Copyright The OpenTelemetry Authors 2 | # SPDX-License-Identifier: Apache-2.0 3 | 4 | type: TestSuite 5 | spec: 6 | id: currency-all 7 | name: 'Currency Service' 8 | description: Run all Currency Service tests enabled in sequence 9 | steps: 10 | - ./convert.yaml 11 | - ./supported.yaml 12 | -------------------------------------------------------------------------------- /src/cart/src/appsettings.json: -------------------------------------------------------------------------------- 1 | { 2 | "Logging": { 3 | "LogLevel": { 4 | "Default": "Information", 5 | "Microsoft": "Warning", 6 | "Microsoft.Hosting.Lifetime": "Information" 7 | } 8 | }, 9 | "AllowedHosts": "*", 10 | "Kestrel": { 11 | "EndpointDefaults": { 12 | "Protocols": "Http2" 13 | } 14 | } 15 | } -------------------------------------------------------------------------------- /src/product-catalog/genproto/Dockerfile: -------------------------------------------------------------------------------- 1 | # Copyright The OpenTelemetry Authors 2 | # SPDX-License-Identifier: Apache-2.0 3 | 4 | FROM golang:1.24-alpine 5 | 6 | WORKDIR /build 7 | 8 | RUN apk add --no-cache protobuf-dev 9 | 10 | COPY ./src/product-catalog/go.mod go.mod 11 | COPY ./src/product-catalog/go.sum go.sum 12 | 13 | RUN go install tool 14 | -------------------------------------------------------------------------------- /src/react-native-app/ios/reactnativeapp.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /src/react-native-app/ios/reactnativeapp.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | IDEDidComputeMac32BitWarning 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /src/react-native-app/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "expo/tsconfig.base", 3 | "compilerOptions": { 4 | "strict": true, 5 | "paths": { 6 | "@/*": [ 7 | "./*" 8 | ] 9 | } 10 | }, 11 | "include": [ 12 | "**/*.ts", 13 | "**/*.tsx", 14 | ".expo/types/**/*.ts", 15 | "expo-env.d.ts" 16 | ] 17 | } 18 | -------------------------------------------------------------------------------- /test/tracetesting/checkout/all.yaml: -------------------------------------------------------------------------------- 1 | # Copyright The OpenTelemetry Authors 2 | # SPDX-License-Identifier: Apache-2.0 3 | 4 | type: TestSuite 5 | spec: 6 | id: checkout-all 7 | name: 'Checkout Service' 8 | description: Run all Checkout Service tests enabled in sequence 9 | steps: 10 | - ./add-item-to-cart.yaml 11 | - ./place-order.yaml 12 | -------------------------------------------------------------------------------- /src/frontend/utils/Cypress.ts: -------------------------------------------------------------------------------- 1 | // Copyright The OpenTelemetry Authors 2 | // SPDX-License-Identifier: Apache-2.0 3 | 4 | import { CypressFields } from './enums/CypressFields'; 5 | 6 | export { CypressFields }; 7 | 8 | export const getElementByField = (field: CypressFields, context: Cypress.Chainable = cy) => 9 | context.get(`[data-cy="${field}"]`); 10 | -------------------------------------------------------------------------------- /src/react-native-app/android/app/src/main/res/mipmap-anydpi-v26/ic_launcher.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /src/react-native-app/android/app/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /test/tracetesting/shipping/all.yaml: -------------------------------------------------------------------------------- 1 | # Copyright The OpenTelemetry Authors 2 | # SPDX-License-Identifier: Apache-2.0 3 | 4 | type: TestSuite 5 | spec: 6 | id: shipping-all 7 | name: 'Shipping Service' 8 | description: Run all Shipping Service tests enabled in sequence 9 | steps: 10 | - ./quote.yaml 11 | - ./empty-quote.yaml 12 | - ./order.yaml 13 | -------------------------------------------------------------------------------- /src/react-native-app/ios/reactnativeapp/Images.xcassets/AppIcon.appiconset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images": [ 3 | { 4 | "filename": "App-Icon-1024x1024@1x.png", 5 | "idiom": "universal", 6 | "platform": "ios", 7 | "size": "1024x1024" 8 | } 9 | ], 10 | "info": { 11 | "version": 1, 12 | "author": "expo" 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /test/tracetesting/product-catalog/all.yaml: -------------------------------------------------------------------------------- 1 | # Copyright The OpenTelemetry Authors 2 | # SPDX-License-Identifier: Apache-2.0 3 | 4 | type: TestSuite 5 | spec: 6 | id: product-catalog-all 7 | name: 'Product Catalog' 8 | description: Run all Product Catalog tests enabled in sequence 9 | steps: 10 | - ./list.yaml 11 | - ./get.yaml 12 | - ./search.yaml 13 | -------------------------------------------------------------------------------- /src/payment/README.md: -------------------------------------------------------------------------------- 1 | # Payment Service 2 | 3 | This service is responsible for processing and validating payments through the 4 | application. 5 | 6 | ## Local Build 7 | 8 | Copy the `demo.proto` file to this directory and run `npm ci` 9 | 10 | ## Docker Build 11 | 12 | From the root directory, run: 13 | 14 | ```sh 15 | docker compose build payment 16 | ``` 17 | -------------------------------------------------------------------------------- /test/tracetesting/product-reviews/all.yaml: -------------------------------------------------------------------------------- 1 | # Copyright The OpenTelemetry Authors 2 | # SPDX-License-Identifier: Apache-2.0 3 | 4 | type: TestSuite 5 | spec: 6 | id: product-reviews-all 7 | name: 'Product Review Service' 8 | description: Run all Product Review Service tests enabled in sequence 9 | steps: 10 | - ./reviews.yaml 11 | - ./summary.yaml 12 | -------------------------------------------------------------------------------- /src/flagd-ui/test/flagd_ui_web/controllers/page_controller_test.exs: -------------------------------------------------------------------------------- 1 | # Copyright The OpenTelemetry Authors 2 | # SPDX-License-Identifier: Apache-2.0 3 | 4 | defmodule FlagdUiWeb.PageControllerTest do 5 | use FlagdUiWeb.ConnCase 6 | 7 | test "GET /", %{conn: conn} do 8 | conn = get(conn, ~p"/") 9 | assert html_response(conn, 200) =~ "Flagd Configurator" 10 | end 11 | end 12 | -------------------------------------------------------------------------------- /src/grafana/provisioning/datasources/victorialogs.yaml: -------------------------------------------------------------------------------- 1 | # Copyright The OpenTelemetry Authors 2 | # SPDX-License-Identifier: Apache-2.0 3 | 4 | apiVersion: 1 5 | 6 | datasources: 7 | - name: VictoriaLogs 8 | uid: webstore-logs 9 | type: victoriametrics-logs-datasource 10 | url: http://victorialogs:9428/ 11 | access: proxy 12 | editable: true 13 | isDefault: false 14 | -------------------------------------------------------------------------------- /test/tracetesting/otelcol-config-tracetest.yml: -------------------------------------------------------------------------------- 1 | # Copyright The OpenTelemetry Authors 2 | # SPDX-License-Identifier: Apache-2.0 3 | 4 | exporters: 5 | otlp/tracetest: 6 | endpoint: http://tracetest-server:4317 7 | tls: 8 | insecure: true 9 | 10 | service: 11 | pipelines: 12 | traces: 13 | processors: [] 14 | exporters: [debug, spanmetrics, otlp/tracetest] 15 | -------------------------------------------------------------------------------- /src/flagd-ui/lib/flagd_ui.ex: -------------------------------------------------------------------------------- 1 | # Copyright The OpenTelemetry Authors 2 | # SPDX-License-Identifier: Apache-2.0 3 | 4 | defmodule FlagdUi do 5 | @moduledoc """ 6 | FlagdUi keeps the contexts that define your domain 7 | and business logic. 8 | 9 | Contexts are also responsible for managing your data, regardless 10 | if it comes from the database, an external API or others. 11 | """ 12 | end 13 | -------------------------------------------------------------------------------- /src/react-native-app/.gitignore: -------------------------------------------------------------------------------- 1 | node_modules/ 2 | .expo/ 3 | dist/ 4 | npm-debug.* 5 | *.jks 6 | *.p8 7 | *.p12 8 | *.key 9 | *.mobileprovision 10 | *.orig.* 11 | web-build/ 12 | pb/demo.proto 13 | 14 | # macOS 15 | .DS_Store 16 | 17 | # @generated expo-cli sync-2b81b286409207a5da26e14c78851eb30d8ccbdb 18 | # The following patterns were generated by expo-cli 19 | 20 | expo-env.d.ts 21 | # @end expo-cli 22 | 23 | -------------------------------------------------------------------------------- /src/recommendation/requirements.txt: -------------------------------------------------------------------------------- 1 | grpcio-health-checking==1.71.0 2 | openfeature-hooks-opentelemetry==0.2.0 3 | openfeature-provider-flagd==0.2.3 4 | opentelemetry-distro==0.60b0 5 | opentelemetry-exporter-otlp-proto-grpc==1.39.0 6 | psutil==7.0.0 # Importing this will also import opentelemetry-instrumentation-system-metrics when running opentelemetry-bootstrap 7 | python-dotenv==1.2.1 8 | python-json-logger==4.0.0 9 | -------------------------------------------------------------------------------- /.linkspector.yml: -------------------------------------------------------------------------------- 1 | # Copyright The OpenTelemetry Authors 2 | # SPDX-License-Identifier: Apache-2.0 3 | 4 | dirs: 5 | - . 6 | 7 | excludedFiles: 8 | - ./CHANGELOG.md 9 | 10 | ignorePatterns: 11 | - pattern: "^http://localhost:8080" 12 | - pattern: "^https://calendar.google.com/calendar" 13 | 14 | aliveStatusCodes: 15 | - 200 16 | - 429 17 | 18 | useGitIgnore: true 19 | 20 | modifiedFilesOnly: false 21 | -------------------------------------------------------------------------------- /src/flagd-ui/lib/flagd_ui_web/controllers/page_html.ex: -------------------------------------------------------------------------------- 1 | # Copyright The OpenTelemetry Authors 2 | # SPDX-License-Identifier: Apache-2.0 3 | 4 | defmodule FlagdUiWeb.PageHTML do 5 | @moduledoc """ 6 | This module contains pages rendered by PageController. 7 | 8 | See the `page_html` directory for all templates available. 9 | """ 10 | use FlagdUiWeb, :html 11 | 12 | embed_templates "page_html/*" 13 | end 14 | -------------------------------------------------------------------------------- /src/frontend/.prettierrc: -------------------------------------------------------------------------------- 1 | { 2 | "importOrderSeparation": true, 3 | "importOrderSortSpecifiers": true, 4 | "singleQuote": true, 5 | "arrowParens": "avoid", 6 | "bracketSpacing": true, 7 | "semi": true, 8 | "trailingComma": "es5", 9 | "printWidth": 120, 10 | "jsxBracketSameLine": false, 11 | "proseWrap": "always", 12 | "quoteProps": "as-needed", 13 | "tabWidth": 2, 14 | "useTabs": false 15 | } 16 | -------------------------------------------------------------------------------- /test/tracetesting/payment/all.yaml: -------------------------------------------------------------------------------- 1 | # Copyright The OpenTelemetry Authors 2 | # SPDX-License-Identifier: Apache-2.0 3 | 4 | type: TestSuite 5 | spec: 6 | id: payment-all 7 | name: 'Payment' 8 | description: Run all Payment tests enabled in sequence 9 | steps: 10 | - ./valid-credit-card.yaml 11 | - ./invalid-credit-card.yaml 12 | - ./amex-credit-card-not-allowed.yaml 13 | - ./expired-credit-card.yaml 14 | -------------------------------------------------------------------------------- /src/grafana/provisioning/dashboards/demo.yaml: -------------------------------------------------------------------------------- 1 | # Copyright The OpenTelemetry Authors 2 | # SPDX-License-Identifier: Apache-2.0 3 | 4 | 5 | apiVersion: 1 6 | providers: 7 | - name: 'OpenTelemetry Demo' 8 | orgId: 1 9 | folder: 'Demo' 10 | folderUid: 'demo' 11 | type: file 12 | disableDeletion: false 13 | editable: true 14 | options: 15 | path: /etc/grafana/provisioning/dashboards/demo 16 | -------------------------------------------------------------------------------- /src/quote/src/Application/Settings/SettingsInterface.php: -------------------------------------------------------------------------------- 1 | 2 | Astronomy Shop App 3 | contain 4 | false 5 | automatic 6 | 7 | -------------------------------------------------------------------------------- /src/frontend/components/ProductList/ProductList.styled.ts: -------------------------------------------------------------------------------- 1 | // Copyright The OpenTelemetry Authors 2 | // SPDX-License-Identifier: Apache-2.0 3 | 4 | import styled from 'styled-components'; 5 | 6 | export const ProductList = styled.div` 7 | display: grid; 8 | grid-template-columns: 1fr; 9 | gap: 24px; 10 | 11 | ${({ theme }) => theme.breakpoints.desktop} { 12 | grid-template-columns: repeat(3, auto); 13 | } 14 | `; 15 | -------------------------------------------------------------------------------- /test/tracetesting/cart/all.yaml: -------------------------------------------------------------------------------- 1 | # Copyright The OpenTelemetry Authors 2 | # SPDX-License-Identifier: Apache-2.0 3 | 4 | type: TestSuite 5 | spec: 6 | id: cart-all 7 | name: 'Cart Service' 8 | description: Run all Cart tests enabled in sequence 9 | steps: 10 | - ./empty-cart.yaml 11 | - ./add-item-to-cart.yaml 12 | - ./check-if-cart-is-populated.yaml 13 | - ./empty-cart.yaml 14 | - ./check-if-cart-is-empty.yaml 15 | -------------------------------------------------------------------------------- /src/flagd-ui/priv/gettext/errors.pot: -------------------------------------------------------------------------------- 1 | ## This is a PO Template file. 2 | ## 3 | ## `msgid`s here are often extracted from source code. 4 | ## Add new translations manually only if they're dynamic 5 | ## translations that can't be statically extracted. 6 | ## 7 | ## Run `mix gettext.extract` to bring this file up to 8 | ## date. Leave `msgstr`s empty as changing them here has no 9 | ## effect: edit them in PO (`.po`) files instead. 10 | 11 | -------------------------------------------------------------------------------- /src/recommendation/README.md: -------------------------------------------------------------------------------- 1 | # Recommendation Service 2 | 3 | This service provides recommendations for other products based on the currently 4 | selected product. 5 | 6 | ## Local Build 7 | 8 | To build the protos, run from the root directory: 9 | 10 | ```sh 11 | make docker-generate-protobuf 12 | ``` 13 | 14 | ## Docker Build 15 | 16 | From the root directory, run: 17 | 18 | ```sh 19 | docker compose build recommendation 20 | ``` 21 | -------------------------------------------------------------------------------- /.env.override: -------------------------------------------------------------------------------- 1 | # DO NOT PUSH CHANGES OF THIS FILE TO opentelemetry/opentelemetry-demo 2 | # PLACE YOUR .env ENVIRONMENT VARIABLES OVERRIDES IN THIS FILE 3 | 4 | 5 | # To use a real OpenAI API-compatible LLM, 6 | # set the appropriate values for the target LLM 7 | # Required permissions: 8 | # [Models and Model capabilities] 9 | 10 | #LLM_BASE_URL=https://api.openai.com/v1 11 | #LLM_MODEL=gpt-4o-mini 12 | #OPENAI_API_KEY= 13 | -------------------------------------------------------------------------------- /src/load-generator/README.md: -------------------------------------------------------------------------------- 1 | # Load Generator 2 | 3 | The load generator creates simulated traffic to the demo. 4 | 5 | ## Accessing the Load Generator 6 | 7 | You can access the web interface to Locust at `http://localhost:8080/loadgen/`. 8 | 9 | ## Modifying the Load Generator 10 | 11 | Please see the [Locust 12 | documentation](https://docs.locust.io/en/2.16.0/writing-a-locustfile.html) to 13 | learn more about modifying the locustfile. 14 | -------------------------------------------------------------------------------- /src/react-native-app/android/app/src/debug/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 3 | 4 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /src/cart/Directory.Build.props: -------------------------------------------------------------------------------- 1 | 2 | 3 | true 4 | all 5 | low 6 | 7 | 8 | 9 | Minimum 10 | true 11 | 12 | 13 | -------------------------------------------------------------------------------- /src/accounting/Directory.Build.props: -------------------------------------------------------------------------------- 1 | 2 | 3 | true 4 | all 5 | low 6 | 7 | 8 | 9 | Minimum 10 | true 11 | 12 | 13 | -------------------------------------------------------------------------------- /internal/tools/tools.go: -------------------------------------------------------------------------------- 1 | // 2 | 3 | //go:build tools 4 | // +build tools 5 | 6 | package tools 7 | 8 | // This file follows the recommendation at 9 | // https://go.dev/wiki/Modules#how-can-i-track-tool-dependencies-for-a-module 10 | // on how to pin tooling dependencies to a go.mod file. 11 | // This ensures that all systems use the same version of tools in addition to regular dependencies. 12 | 13 | import ( 14 | _ "github.com/client9/misspell/cmd/misspell" 15 | ) 16 | -------------------------------------------------------------------------------- /src/react-native-app/ios/reactnativeapp/Images.xcassets/SplashScreen.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images": [ 3 | { 4 | "idiom": "universal", 5 | "filename": "image.png", 6 | "scale": "1x" 7 | }, 8 | { 9 | "idiom": "universal", 10 | "scale": "2x" 11 | }, 12 | { 13 | "idiom": "universal", 14 | "scale": "3x" 15 | } 16 | ], 17 | "info": { 18 | "version": 1, 19 | "author": "expo" 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /src/react-native-app/ios/reactnativeapp/Supporting/Expo.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | EXUpdatesCheckOnLaunch 6 | ALWAYS 7 | EXUpdatesEnabled 8 | 9 | EXUpdatesLaunchWaitMs 10 | 0 11 | 12 | 13 | -------------------------------------------------------------------------------- /src/cart/src/cartstore/ICartStore.cs: -------------------------------------------------------------------------------- 1 | // Copyright The OpenTelemetry Authors 2 | // SPDX-License-Identifier: Apache-2.0 3 | using System.Threading.Tasks; 4 | 5 | namespace cart.cartstore; 6 | 7 | public interface ICartStore 8 | { 9 | void Initialize(); 10 | 11 | Task AddItemAsync(string userId, string productId, int quantity); 12 | Task EmptyCartAsync(string userId); 13 | 14 | Task GetCartAsync(string userId); 15 | 16 | bool Ping(); 17 | } 18 | -------------------------------------------------------------------------------- /src/react-native-app/ios/reactnativeapp/Images.xcassets/SplashScreenBackground.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images": [ 3 | { 4 | "idiom": "universal", 5 | "filename": "image.png", 6 | "scale": "1x" 7 | }, 8 | { 9 | "idiom": "universal", 10 | "scale": "2x" 11 | }, 12 | { 13 | "idiom": "universal", 14 | "scale": "3x" 15 | } 16 | ], 17 | "info": { 18 | "version": 1, 19 | "author": "expo" 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /src/frontend/components/PlatformFlag/PlatformFlag.tsx: -------------------------------------------------------------------------------- 1 | // Copyright The OpenTelemetry Authors 2 | // SPDX-License-Identifier: Apache-2.0 3 | 4 | import * as S from './PlatformFlag.styled'; 5 | 6 | const { NEXT_PUBLIC_PLATFORM = 'local' } = typeof window !== 'undefined' ? window.ENV : {}; 7 | 8 | const platform = NEXT_PUBLIC_PLATFORM; 9 | 10 | const PlatformFlag = () => { 11 | return ( 12 | {platform} 13 | ); 14 | }; 15 | 16 | export default PlatformFlag; 17 | -------------------------------------------------------------------------------- /src/frontend/components/Layout/Layout.tsx: -------------------------------------------------------------------------------- 1 | // Copyright The OpenTelemetry Authors 2 | // SPDX-License-Identifier: Apache-2.0 3 | 4 | import Header from '../Header'; 5 | import Footer from '../Footer'; 6 | 7 | interface IProps { 8 | children: React.ReactNode; 9 | } 10 | 11 | const Layout = ({ children }: IProps) => { 12 | return ( 13 | <> 14 | 15 | {children} 16 | 17 | > 18 | ); 19 | }; 20 | 21 | export default Layout; 22 | -------------------------------------------------------------------------------- /src/product-reviews/requirements.txt: -------------------------------------------------------------------------------- 1 | grpcio-health-checking==1.71.0 2 | openfeature-hooks-opentelemetry==0.2.0 3 | openfeature-provider-flagd==0.2.3 4 | opentelemetry-distro==0.60b0 5 | opentelemetry-exporter-otlp-proto-grpc==1.39.0 6 | psutil==7.0.0 # Importing this will also import opentelemetry-instrumentation-system-metrics when running opentelemetry-bootstrap 7 | python-dotenv==1.2.1 8 | python-json-logger==4.0.0 9 | psycopg2-binary==2.9.11 10 | openai==2.9.0 11 | simplejson==3.20.2 12 | -------------------------------------------------------------------------------- /src/react-native-app/ios/.gitignore: -------------------------------------------------------------------------------- 1 | # OSX 2 | # 3 | .DS_Store 4 | 5 | # Xcode 6 | # 7 | build/ 8 | *.pbxuser 9 | !default.pbxuser 10 | *.mode1v3 11 | !default.mode1v3 12 | *.mode2v3 13 | !default.mode2v3 14 | *.perspectivev3 15 | !default.perspectivev3 16 | xcuserdata 17 | *.xccheckout 18 | *.moved-aside 19 | DerivedData 20 | *.hmap 21 | *.ipa 22 | *.xcuserstate 23 | project.xcworkspace 24 | .xcode.env.local 25 | 26 | # Bundle artifacts 27 | *.jsbundle 28 | 29 | # CocoaPods 30 | /Pods/ 31 | -------------------------------------------------------------------------------- /.dockerignore: -------------------------------------------------------------------------------- 1 | 2 | 3 | .github 4 | docs 5 | internal 6 | src/*/README.md 7 | src/*/Dockerfile 8 | src/*/*/Dockerfile 9 | 10 | ################################### 11 | # currency 12 | ./src/currency/client.js 13 | ./src/currency/node_modules/ 14 | ################################### 15 | 16 | ################################### 17 | # frontend 18 | ./src/frontend/node_modules/ 19 | 20 | ################################### 21 | # shipping 22 | ./src/shipping/target 23 | ################################### 24 | 25 | -------------------------------------------------------------------------------- /src/accounting/Log.cs: -------------------------------------------------------------------------------- 1 | // Copyright The OpenTelemetry Authors 2 | // SPDX-License-Identifier: Apache-2.0 3 | 4 | using Microsoft.Extensions.Logging; 5 | using Oteldemo; 6 | 7 | namespace Accounting 8 | { 9 | internal static partial class Log 10 | { 11 | [LoggerMessage( 12 | Level = LogLevel.Information, 13 | Message = "Order details: {@OrderResult}.")] 14 | public static partial void OrderReceivedMessage(ILogger logger, OrderResult orderResult); 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /src/fraud-detection/README.md: -------------------------------------------------------------------------------- 1 | # Fraud Detection Service 2 | 3 | This service receives new orders by a Kafka topic and returns cases which are 4 | suspected of fraud. 5 | 6 | ## Local Build 7 | 8 | To build the protos and the service binary, run from the repo root: 9 | 10 | ```sh 11 | cp -r ../../pb/ src/main/proto/ 12 | ./gradlew shadowJar 13 | ``` 14 | 15 | ## Docker Build 16 | 17 | To build using Docker run from the repo root: 18 | 19 | ```sh 20 | docker build -f ./src/fraud-detection/Dockerfile . 21 | ``` 22 | -------------------------------------------------------------------------------- /src/shipping/README.md: -------------------------------------------------------------------------------- 1 | # Shipping Service 2 | 3 | The Shipping service queries `quote` for price quote, provides tracking IDs, 4 | and the impression of order fulfillment & shipping processes. 5 | 6 | ## Local 7 | 8 | This repo assumes you have rust 1.82 installed. You may use docker, or 9 | [install rust](https://www.rust-lang.org/tools/install). 10 | 11 | ## Build 12 | 13 | From `../../`, run: 14 | 15 | ```sh 16 | docker compose build shipping 17 | ``` 18 | 19 | ## Test 20 | 21 | ```sh 22 | cargo test 23 | ``` 24 | -------------------------------------------------------------------------------- /src/frontend/components/Footer/Footer.styled.ts: -------------------------------------------------------------------------------- 1 | // Copyright The OpenTelemetry Authors 2 | // SPDX-License-Identifier: Apache-2.0 3 | 4 | import styled from 'styled-components'; 5 | 6 | export const Footer = styled.footer` 7 | position: relative; 8 | padding: 65px 9%; 9 | background-color: ${({ theme }) => theme.colors.otelGray}; 10 | 11 | * { 12 | color: ${({ theme }) => theme.colors.white}; 13 | font-size: ${({ theme }) => theme.sizes.dSmall}; 14 | font-weight: ${({ theme }) => theme.fonts.regular}; 15 | } 16 | `; 17 | -------------------------------------------------------------------------------- /src/flagd-ui/test/flagd_ui_web/controllers/error_json_test.exs: -------------------------------------------------------------------------------- 1 | # Copyright The OpenTelemetry Authors 2 | # SPDX-License-Identifier: Apache-2.0 3 | 4 | defmodule FlagdUiWeb.ErrorJSONTest do 5 | use FlagdUiWeb.ConnCase, async: true 6 | 7 | test "renders 404" do 8 | assert FlagdUiWeb.ErrorJSON.render("404.json", %{}) == %{errors: %{detail: "Not Found"}} 9 | end 10 | 11 | test "renders 500" do 12 | assert FlagdUiWeb.ErrorJSON.render("500.json", %{}) == 13 | %{errors: %{detail: "Internal Server Error"}} 14 | end 15 | end 16 | -------------------------------------------------------------------------------- /src/react-native-app/ios/.xcode.env: -------------------------------------------------------------------------------- 1 | # This `.xcode.env` file is versioned and is used to source the environment 2 | # used when running script phases inside Xcode. 3 | # To customize your local environment, you can create an `.xcode.env.local` 4 | # file that is not versioned. 5 | 6 | # NODE_BINARY variable contains the PATH to the node executable. 7 | # 8 | # Customize the NODE_BINARY variable here. 9 | # For example, to use nvm with brew, add the following line 10 | # . "$(brew --prefix nvm)/nvm.sh" --no-use 11 | export NODE_BINARY=$(command -v node) 12 | -------------------------------------------------------------------------------- /src/grafana/provisioning/datasources/victoriametrics.yaml: -------------------------------------------------------------------------------- 1 | # Copyright The OpenTelemetry Authors 2 | # SPDX-License-Identifier: Apache-2.0 3 | 4 | 5 | apiVersion: 1 6 | 7 | datasources: 8 | - name: VictoriaMetrics 9 | uid: webstore-metrics 10 | type: victoriametrics-metrics-datasource 11 | url: http://victoriametrics:8428 12 | editable: true 13 | isDefault: true 14 | jsonData: 15 | # Align Prometheus data source time interval with the OTel SDKs' export interval (see OTEL_METRIC_EXPORT_INTERVAL) 16 | timeInterval: "60s" 17 | -------------------------------------------------------------------------------- /test/tracetesting/frontend/all.yaml: -------------------------------------------------------------------------------- 1 | # Copyright The OpenTelemetry Authors 2 | # SPDX-License-Identifier: Apache-2.0 3 | 4 | type: TestSuite 5 | spec: 6 | id: frontend-all 7 | name: 'Frontend Service' 8 | description: Run all Frontend tests enabled in sequence, simulating a process of a user purchasing products on Astronomy store 9 | steps: 10 | - ./01-see-ads.yaml 11 | - ./02-get-product-recommendation.yaml 12 | - ./03-browse-product.yaml 13 | - ./04-add-product-to-cart.yaml 14 | - ./05-view-cart.yaml 15 | - ./06-checking-out-cart.yaml 16 | -------------------------------------------------------------------------------- /src/recommendation/metrics.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/python 2 | 3 | # Copyright The OpenTelemetry Authors 4 | # SPDX-License-Identifier: Apache-2.0 5 | 6 | def init_metrics(meter): 7 | 8 | # Recommendations counter 9 | app_recommendations_counter = meter.create_counter( 10 | 'app_recommendations_counter', unit='recommendations', description="Counts the total number of given recommendations" 11 | ) 12 | 13 | rec_svc_metrics = { 14 | "app_recommendations_counter": app_recommendations_counter, 15 | } 16 | 17 | return rec_svc_metrics 18 | -------------------------------------------------------------------------------- /src/grafana/provisioning/datasources/victoriametrics-prom.yaml: -------------------------------------------------------------------------------- 1 | # Copyright The OpenTelemetry Authors 2 | # SPDX-License-Identifier: Apache-2.0 3 | 4 | 5 | apiVersion: 1 6 | 7 | datasources: 8 | - name: VictoriaMetrics (Prometheus plugin) 9 | uid: webstore-metrics-prom 10 | type: prometheus 11 | url: http://victoriametrics:8428 12 | editable: true 13 | isDefault: false 14 | jsonData: 15 | # Align Prometheus data source time interval with the OTel SDKs' export interval (see OTEL_METRIC_EXPORT_INTERVAL) 16 | timeInterval: "60s" 17 | -------------------------------------------------------------------------------- /src/flagd-ui/lib/flagd_ui_web/controllers/feature_controller.ex: -------------------------------------------------------------------------------- 1 | # Copyright The OpenTelemetry Authors 2 | # SPDX-License-Identifier: Apache-2.0 3 | 4 | defmodule FlagdUiWeb.FeatureController do 5 | use FlagdUiWeb, :controller 6 | 7 | def read(conn, _params) do 8 | %{"flags" => flags} = GenServer.call(Storage, :read) 9 | 10 | json(conn, %{"flags" => flags}) 11 | end 12 | 13 | def write(conn, %{"data" => data}) do 14 | payload = Jason.encode!(data) 15 | GenServer.cast(Storage, {:replace, payload}) 16 | 17 | json(conn, %{}) 18 | end 19 | end 20 | -------------------------------------------------------------------------------- /src/frontend-proxy/Dockerfile: -------------------------------------------------------------------------------- 1 | # Copyright The OpenTelemetry Authors 2 | # SPDX-License-Identifier: Apache-2.0 3 | 4 | FROM envoyproxy/envoy:v1.34-latest 5 | 6 | RUN apt-get update && \ 7 | apt-get install -y gettext-base && \ 8 | apt-get clean && \ 9 | rm -rf /var/lib/apt/lists/* 10 | 11 | USER envoy 12 | 13 | WORKDIR /home/envoy 14 | 15 | COPY ./src/frontend-proxy/envoy.tmpl.yaml envoy.tmpl.yaml 16 | 17 | EXPOSE ${ENVOY_PORT} 18 | EXPOSE ${ENVOY_ADMIN_PORT} 19 | ENTRYPOINT ["/bin/sh", "-c", "envsubst < envoy.tmpl.yaml > envoy.yaml && envoy -c envoy.yaml;"] 20 | -------------------------------------------------------------------------------- /test/tracetesting/Dockerfile: -------------------------------------------------------------------------------- 1 | # Copyright The OpenTelemetry Authors 2 | # SPDX-License-Identifier: Apache-2.0 3 | 4 | 5 | FROM alpine 6 | 7 | WORKDIR /app 8 | 9 | # The build-images workflow action does not set a build-arg so we need to specify a default value here 10 | ARG TRACETEST_IMAGE_VERSION 11 | 12 | RUN apk --update add bash jq curl 13 | RUN curl -L https://raw.githubusercontent.com/kubeshop/tracetest/main/install-cli.sh | bash -s -- $TRACETEST_IMAGE_VERSION 14 | 15 | WORKDIR /app/test/tracetesting 16 | 17 | ENTRYPOINT ["/bin/bash", "/app/test/tracetesting/run.bash"] 18 | -------------------------------------------------------------------------------- /src/llm/product-review-summaries/inaccurate-product-review-summaries.json: -------------------------------------------------------------------------------- 1 | { 2 | "product-review-summaries": [ 3 | { 4 | "product_id": "L9ECAV7KIM", 5 | "average_score": 1.8, 6 | "product_review_summary": "Customers are largely disappointed with this cleaning kit, citing its ineffectiveness on most optical surfaces. Many users report that the cleaning fluid leaves a sticky residue and the included brush is too harsh, causing scratches on lenses. The kit is considered a poor value, with several reviewers stating it damaged their equipment." 7 | } 8 | ] 9 | } 10 | -------------------------------------------------------------------------------- /test/tracetesting/tracetest-config.yaml: -------------------------------------------------------------------------------- 1 | # Copyright The OpenTelemetry Authors 2 | # SPDX-License-Identifier: Apache-2.0 3 | 4 | postgres: 5 | host: tracetest-postgres 6 | user: postgres 7 | password: postgres 8 | port: 5432 9 | dbname: postgres 10 | params: sslmode=disable 11 | 12 | telemetry: 13 | exporters: 14 | collector: 15 | serviceName: tracetest 16 | sampling: 100 17 | exporter: 18 | type: collector 19 | collector: 20 | endpoint: otel-collector:4317 21 | 22 | server: 23 | telemetry: 24 | exporter: collector 25 | -------------------------------------------------------------------------------- /src/frontend/components/Select/Select.tsx: -------------------------------------------------------------------------------- 1 | // Copyright The OpenTelemetry Authors 2 | // SPDX-License-Identifier: Apache-2.0 3 | 4 | import { InputHTMLAttributes } from 'react'; 5 | import * as S from './Select.styled'; 6 | 7 | interface IProps extends InputHTMLAttributes { 8 | children: React.ReactNode; 9 | } 10 | 11 | const Select = ({ children, ...props }: IProps) => { 12 | return ( 13 | 14 | {children} 15 | 16 | 17 | ); 18 | }; 19 | 20 | export default Select; 21 | -------------------------------------------------------------------------------- /src/load-generator/requirements.txt: -------------------------------------------------------------------------------- 1 | Flask==3.1.2 2 | locust-plugins[playwright]==5.0.0 3 | python-json-logger==4.0.0 4 | openfeature-provider-ofrep==0.2.0 5 | openfeature-hooks-opentelemetry==0.2.0 6 | opentelemetry-api==1.39.0 7 | opentelemetry-exporter-otlp-proto-grpc==1.39.0 8 | opentelemetry-instrumentation-jinja2==0.60b0 9 | opentelemetry-instrumentation-requests==0.60b0 10 | opentelemetry-instrumentation-system-metrics==0.60b0 11 | opentelemetry-instrumentation-urllib3==0.60b0 12 | opentelemetry-sdk==1.39.0 13 | opentelemetry-semantic-conventions==0.60b0 14 | opentelemetry-instrumentation-logging==0.60b0 15 | -------------------------------------------------------------------------------- /src/email/README.md: -------------------------------------------------------------------------------- 1 | # Email Service 2 | 3 | The Email service "sends" an email to the customer with their order details by 4 | rendering it as a log message. It expects a JSON payload like: 5 | 6 | ```json 7 | { 8 | "email": "some.address@website.com", 9 | "order": "" 10 | } 11 | ``` 12 | 13 | ## Local Build 14 | 15 | We use `bundler` to manage dependencies. To get started, simply `bundle install`. 16 | 17 | ## Running locally 18 | 19 | You may run this service locally with `bundle exec ruby email_server.rb`. 20 | 21 | ## Docker Build 22 | 23 | From `src/email`, run `docker build .` 24 | -------------------------------------------------------------------------------- /src/react-native-app/utils/Localhost.ts: -------------------------------------------------------------------------------- 1 | // Copyright The OpenTelemetry Authors 2 | // SPDX-License-Identifier: Apache-2.0 3 | import DeviceInfo from "react-native-device-info"; 4 | import { Platform } from "react-native"; 5 | 6 | const getLocalhost = async (): Promise => { 7 | const isEmulator = await DeviceInfo.isEmulator(); 8 | 9 | // The Android emulator has a special loopback for localhost 10 | // https://developer.android.com/studio/run/emulator-networking#networkaddresses 11 | return Platform.OS === "android" && isEmulator ? "10.0.2.2" : "localhost"; 12 | }; 13 | 14 | export default getLocalhost; 15 | -------------------------------------------------------------------------------- /.yamllint: -------------------------------------------------------------------------------- 1 | # Copyright The OpenTelemetry Authors 2 | # SPDX-License-Identifier: Apache-2.0 3 | extends: default 4 | 5 | ignore-from-file: [.gitignore, .yamlignore] 6 | 7 | rules: 8 | document-start: disable 9 | octal-values: enable 10 | truthy: 11 | allowed-values: ['true', 'false', 'on'] # 'on' for GH action trigger 12 | line-length: 13 | max: 200 14 | indentation: 15 | check-multi-line-strings: false 16 | indent-sequences: consistent 17 | brackets: 18 | max-spaces-inside: 1 19 | max-spaces-inside-empty: 0 20 | braces: 21 | max-spaces-inside: 1 22 | max-spaces-inside-empty: 0 23 | -------------------------------------------------------------------------------- /src/react-native-app/hooks/useColorScheme.web.ts: -------------------------------------------------------------------------------- 1 | // Copyright The OpenTelemetry Authors 2 | // SPDX-License-Identifier: Apache-2.0 3 | // NOTE: The default React Native styling doesn't support server rendering. 4 | // Server rendered styles should not change between the first render of the HTML 5 | // and the first render on the client. Typically, web developers will use CSS media queries 6 | // to render different styles on the client and server, these aren't directly supported in React Native 7 | // but can be achieved using a styling library like Nativewind. 8 | export function useColorScheme() { 9 | return "light"; 10 | } 11 | -------------------------------------------------------------------------------- /src/image-provider/Dockerfile: -------------------------------------------------------------------------------- 1 | # Copyright The OpenTelemetry Authors 2 | # SPDX-License-Identifier: Apache-2.0 3 | 4 | FROM nginxinc/nginx-unprivileged:1.29.0-alpine3.22-otel 5 | 6 | USER 101 7 | 8 | COPY src/image-provider/static/ /static/ 9 | COPY src/image-provider/nginx.conf.template /nginx.conf.template 10 | 11 | EXPOSE ${IMAGE_PROVIDER_PORT} 12 | 13 | STOPSIGNAL SIGQUIT 14 | 15 | # Start nginx 16 | CMD ["/bin/sh" , "-c" , "envsubst '$OTEL_COLLECTOR_HOST $IMAGE_PROVIDER_PORT $OTEL_COLLECTOR_PORT_GRPC $OTEL_SERVICE_NAME' < /nginx.conf.template > /etc/nginx/nginx.conf && cat /etc/nginx/nginx.conf && exec nginx -g 'daemon off;'"] 17 | -------------------------------------------------------------------------------- /src/react-native-app/components/navigation/TabBarIcon.tsx: -------------------------------------------------------------------------------- 1 | // Copyright The OpenTelemetry Authors 2 | // SPDX-License-Identifier: Apache-2.0 3 | // You can explore the built-in icon families and icons on the web at https://icons.expo.fyi/ 4 | 5 | import Ionicons from "@expo/vector-icons/Ionicons"; 6 | import { type IconProps } from "@expo/vector-icons/build/createIconSet"; 7 | import { type ComponentProps } from "react"; 8 | 9 | export function TabBarIcon({ 10 | style, 11 | ...rest 12 | }: IconProps["name"]>) { 13 | return ; 14 | } 15 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/question.md: -------------------------------------------------------------------------------- 1 | --- 2 | name: Question 3 | about: Create a question to help us improve our knowledge base and documentation 4 | labels: question 5 | --- 6 | 7 | # Question 8 | 9 | Use [Github Discussions](https://github.com/open-telemetry/opentelemetry-demo/discussions/). 10 | 11 | **Tip**: [React](https://github.blog/news-insights/product-news/add-reactions-to-pull-requests-issues-and-comments/) with 👍 to help prioritize this issue. Please use comments to provide useful context, avoiding `+1` or `me too`, to help us triage it. Learn more [here](https://opentelemetry.io/community/end-user/issue-participation/). 12 | -------------------------------------------------------------------------------- /src/flagd-ui/test/flagd_ui_web/controllers/error_html_test.exs: -------------------------------------------------------------------------------- 1 | # Copyright The OpenTelemetry Authors 2 | # SPDX-License-Identifier: Apache-2.0 3 | 4 | defmodule FlagdUiWeb.ErrorHTMLTest do 5 | use FlagdUiWeb.ConnCase, async: true 6 | 7 | # Bring render_to_string/4 for testing custom views 8 | import Phoenix.Template, only: [render_to_string: 4] 9 | 10 | test "renders 404.html" do 11 | assert render_to_string(FlagdUiWeb.ErrorHTML, "404", "html", []) == "Not Found" 12 | end 13 | 14 | test "renders 500.html" do 15 | assert render_to_string(FlagdUiWeb.ErrorHTML, "500", "html", []) == "Internal Server Error" 16 | end 17 | end 18 | -------------------------------------------------------------------------------- /src/ad/src/main/resources/log4j2.xml: -------------------------------------------------------------------------------- 1 | 2 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | -------------------------------------------------------------------------------- /src/otel-collector/otelcol-config-extras.yml: -------------------------------------------------------------------------------- 1 | # Copyright The OpenTelemetry Authors 2 | # SPDX-License-Identifier: Apache-2.0 3 | 4 | # extra settings to be merged into OpenTelemetry Collector configuration 5 | # do not delete this file 6 | 7 | ## Example configuration for sending data to your own OTLP HTTP backend 8 | ## Note: the spanmetrics exporter must be included in the exporters array 9 | ## if overriding the traces pipeline. 10 | ## 11 | # exporters: 12 | # otlphttp/example: 13 | # endpoint: 14 | # 15 | # service: 16 | # pipelines: 17 | # traces: 18 | # exporters: [spanmetrics, otlphttp/example] 19 | -------------------------------------------------------------------------------- /src/quote/src/Application/Settings/Settings.php: -------------------------------------------------------------------------------- 1 | settings = $settings; 18 | } 19 | 20 | /** 21 | * @return mixed 22 | */ 23 | public function get(string $key = '') 24 | { 25 | return (empty($key)) ? $this->settings : $this->settings[$key]; 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /src/checkout/README.md: -------------------------------------------------------------------------------- 1 | # Checkout Service 2 | 3 | This service provides checkout services for the application. 4 | 5 | ## Local Build 6 | 7 | To build the service binary, run: 8 | 9 | ```sh 10 | go build -o /go/bin/checkout/ 11 | ``` 12 | 13 | ## Docker Build 14 | 15 | From the root directory, run: 16 | 17 | ```sh 18 | docker compose build checkout 19 | ``` 20 | 21 | ## Regenerate protos 22 | 23 | To build the protos, run from the root directory: 24 | 25 | ```sh 26 | make docker-generate-protobuf 27 | ``` 28 | 29 | ## Bump dependencies 30 | 31 | To bump all dependencies run: 32 | 33 | ```sh 34 | go get -u -t ./... 35 | go mod tidy 36 | ``` 37 | -------------------------------------------------------------------------------- /src/fraud-detection/src/main/resources/log4j2.xml: -------------------------------------------------------------------------------- 1 | 2 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | -------------------------------------------------------------------------------- /src/frontend/components/Banner/Banner.tsx: -------------------------------------------------------------------------------- 1 | // Copyright The OpenTelemetry Authors 2 | // SPDX-License-Identifier: Apache-2.0 3 | 4 | import Link from 'next/link'; 5 | import * as S from './Banner.styled'; 6 | 7 | const Banner = () => { 8 | return ( 9 | 10 | 11 | 12 | 13 | 14 | The best telescopes to see the world closer 15 | Go Shopping 16 | 17 | 18 | ); 19 | }; 20 | 21 | export default Banner; 22 | -------------------------------------------------------------------------------- /docker-compose-tests_include-override.yml: -------------------------------------------------------------------------------- 1 | # Copyright The OpenTelemetry Authors 2 | # SPDX-License-Identifier: Apache-2.0 3 | 4 | services: 5 | 6 | otel-collector: 7 | command: [ "--config=/etc/otelcol-config.yml", "--config=/etc/otelcol-config-tracetest.yml" ] 8 | environment: 9 | - ENVOY_PORT 10 | - OTEL_COLLECTOR_HOST 11 | - OTEL_COLLECTOR_PORT_GRPC 12 | - OTEL_COLLECTOR_PORT_HTTP 13 | volumes: 14 | - ${DOCKER_SOCK}:/var/run/docker.sock:ro 15 | - ${OTEL_COLLECTOR_CONFIG}:/etc/otelcol-config.yml 16 | - ./test/tracetesting/otelcol-config-tracetest.yml:/etc/otelcol-config-tracetest.yml 17 | depends_on: [] 18 | -------------------------------------------------------------------------------- /src/accounting/README.md: -------------------------------------------------------------------------------- 1 | # Accounting Service 2 | 3 | This service consumes new orders from a Kafka topic. 4 | 5 | ## Local Build 6 | 7 | To build the service binary, navigate to the root directory of the project and run: 8 | 9 | ```sh 10 | make generate-protobuf 11 | ``` 12 | 13 | Navigate back to `src/accounting` and execute: 14 | 15 | ```sh 16 | dotnet build 17 | ``` 18 | 19 | ## Docker Build 20 | 21 | From the root directory, run: 22 | 23 | ```sh 24 | docker compose build accounting 25 | ``` 26 | 27 | ## Bump dependencies 28 | 29 | To bump all dependencies run in Package manager: 30 | 31 | ```sh 32 | Update-Package -ProjectName Accounting 33 | ``` 34 | -------------------------------------------------------------------------------- /src/frontend/types/Cart.ts: -------------------------------------------------------------------------------- 1 | // Copyright The OpenTelemetry Authors 2 | // SPDX-License-Identifier: Apache-2.0 3 | 4 | import {Address, Cart, OrderItem, OrderResult, Product} from '../protos/demo'; 5 | 6 | export interface IProductCartItem { 7 | productId: string; 8 | quantity: number; 9 | product: Product; 10 | } 11 | 12 | export interface IProductCheckoutItem extends OrderItem { 13 | item: IProductCartItem; 14 | } 15 | 16 | export interface IProductCheckout extends OrderResult { 17 | items: IProductCheckoutItem[]; 18 | shippingAddress: Address; 19 | } 20 | 21 | export interface IProductCart extends Cart { 22 | items: IProductCartItem[]; 23 | } 24 | -------------------------------------------------------------------------------- /src/react-native-app/android/app/proguard-rules.pro: -------------------------------------------------------------------------------- 1 | # Add project specific ProGuard rules here. 2 | # By default, the flags in this file are appended to flags specified 3 | # in /usr/local/Cellar/android-sdk/24.3.3/tools/proguard/proguard-android.txt 4 | # You can edit the include path and order by changing the proguardFiles 5 | # directive in build.gradle. 6 | # 7 | # For more details, see 8 | # http://developer.android.com/guide/developing/tools/proguard.html 9 | 10 | # react-native-reanimated 11 | -keep class com.swmansion.reanimated.** { *; } 12 | -keep class com.facebook.react.turbomodule.** { *; } 13 | 14 | # Add any project specific keep options here: 15 | -------------------------------------------------------------------------------- /src/frontend/components/Ad/Ad.tsx: -------------------------------------------------------------------------------- 1 | // Copyright The OpenTelemetry Authors 2 | // SPDX-License-Identifier: Apache-2.0 3 | 4 | import { CypressFields } from '../../utils/enums/CypressFields'; 5 | import { useAd } from '../../providers/Ad.provider'; 6 | import * as S from './Ad.styled'; 7 | 8 | const Ad = () => { 9 | const { adList } = useAd(); 10 | const { text, redirectUrl } = adList[Math.floor(Math.random() * adList.length)] || { text: '', redirectUrl: '' }; 11 | 12 | return ( 13 | 14 | 15 | {text} 16 | 17 | 18 | ); 19 | }; 20 | 21 | export default Ad; 22 | -------------------------------------------------------------------------------- /src/react-native-app/metro.config.js: -------------------------------------------------------------------------------- 1 | // Copyright The OpenTelemetry Authors 2 | // SPDX-License-Identifier: Apache-2.0 3 | 4 | // Learn more https://docs.expo.io/guides/customizing-metro 5 | /* eslint-env node */ 6 | 7 | const { getDefaultConfig } = require("expo/metro-config"); 8 | 9 | /** @type {import('expo/metro-config').MetroConfig} */ 10 | const config = getDefaultConfig(__dirname); 11 | 12 | // Needed so that we can make use of the alternative @opentelemetry/semantic-conventions/incubating export 13 | // See: https://reactnative.dev/blog/2023/06/21/package-exports-support 14 | config.resolver.unstable_enablePackageExports = true; 15 | 16 | module.exports = config; 17 | -------------------------------------------------------------------------------- /src/accounting/Program.cs: -------------------------------------------------------------------------------- 1 | // Copyright The OpenTelemetry Authors 2 | // SPDX-License-Identifier: Apache-2.0 3 | 4 | using Accounting; 5 | using Microsoft.Extensions.DependencyInjection; 6 | using Microsoft.Extensions.Hosting; 7 | 8 | Console.WriteLine("Accounting service started"); 9 | 10 | Environment.GetEnvironmentVariables() 11 | .FilterRelevant() 12 | .OutputInOrder(); 13 | 14 | var host = Host.CreateDefaultBuilder(args) 15 | .ConfigureServices(services => 16 | { 17 | services.AddSingleton(); 18 | }) 19 | .Build(); 20 | 21 | var consumer = host.Services.GetRequiredService(); 22 | consumer.StartListening(); 23 | 24 | host.Run(); 25 | -------------------------------------------------------------------------------- /src/frontend/components/Ad/Ad.styled.ts: -------------------------------------------------------------------------------- 1 | // Copyright The OpenTelemetry Authors 2 | // SPDX-License-Identifier: Apache-2.0 3 | 4 | import styled from 'styled-components'; 5 | import RouterLink from 'next/link'; 6 | 7 | export const Ad = styled.section` 8 | position: relative; 9 | background-color: ${({ theme }) => theme.colors.otelYellow}; 10 | font-size: ${({ theme }) => theme.sizes.dMedium}; 11 | text-align: center; 12 | padding: 48px; 13 | 14 | * { 15 | color: ${({ theme }) => theme.colors.white}; 16 | margin: 0; 17 | cursor: pointer; 18 | } 19 | `; 20 | 21 | export const Link = styled(RouterLink)` 22 | color: black; 23 | text-decoration: none; 24 | `; 25 | -------------------------------------------------------------------------------- /src/currency/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required(VERSION 3.26) 2 | project(currency) 3 | 4 | find_package(Protobuf REQUIRED) 5 | find_package(gRPC CONFIG REQUIRED) 6 | find_package(opentelemetry-cpp CONFIG REQUIRED) 7 | 8 | set(GENERATED_PROTOBUF_PATH "${CMAKE_BINARY_DIR}/generated/proto") 9 | 10 | add_subdirectory(genproto) 11 | 12 | include_directories("${GENERATED_PROTOBUF_PATH}" "${OPENTELEMETRY_CPP_INCLUDE_DIRS}") 13 | 14 | add_executable(currency src/server.cpp) 15 | add_dependencies(currency demo-proto) 16 | target_link_libraries( 17 | currency demo-proto protobuf::libprotobuf 18 | ${OPENTELEMETRY_CPP_LIBRARIES} gRPC::grpc++) 19 | 20 | install(TARGETS currency DESTINATION bin) 21 | -------------------------------------------------------------------------------- /src/frontend/gateways/rpc/Ad.gateway.ts: -------------------------------------------------------------------------------- 1 | // Copyright The OpenTelemetry Authors 2 | // SPDX-License-Identifier: Apache-2.0 3 | 4 | import { ChannelCredentials } from '@grpc/grpc-js'; 5 | import { AdResponse, AdServiceClient } from '../../protos/demo'; 6 | 7 | const { AD_ADDR = '' } = process.env; 8 | 9 | const client = new AdServiceClient(AD_ADDR, ChannelCredentials.createInsecure()); 10 | 11 | const AdGateway = () => ({ 12 | listAds(contextKeys: string[]) { 13 | return new Promise((resolve, reject) => 14 | client.getAds({ contextKeys: contextKeys }, (error, response) => (error ? reject(error) : resolve(response))) 15 | ); 16 | }, 17 | }); 18 | 19 | export default AdGateway(); 20 | -------------------------------------------------------------------------------- /src/grafana/provisioning/datasources/victoriatraces.yaml: -------------------------------------------------------------------------------- 1 | # Copyright The OpenTelemetry Authors 2 | # SPDX-License-Identifier: Apache-2.0 3 | 4 | 5 | apiVersion: 1 6 | 7 | datasources: 8 | - name: VictoriaTraces 9 | uid: webstore-traces 10 | type: jaeger 11 | url: http://victoriatraces:10428/select/jaeger 12 | editable: true 13 | isDefault: false 14 | jsonData: 15 | tracesToLogsV2: 16 | datasourceUid: webstore-logs 17 | spanStartTimeShift: "-20m" 18 | spanEndTimeShift: "20m" 19 | filterByTraceID: true 20 | filterBySpanID: true 21 | customQuery: true 22 | query: traceId:"$${__trace.traceId}" AND spanId:"$${__span.spanId}" 23 | -------------------------------------------------------------------------------- /src/react-native-app/components/ThemedView.tsx: -------------------------------------------------------------------------------- 1 | // Copyright The OpenTelemetry Authors 2 | // SPDX-License-Identifier: Apache-2.0 3 | import { View, type ViewProps } from "react-native"; 4 | 5 | import { useThemeColor } from "@/hooks/useThemeColor"; 6 | 7 | export type ThemedViewProps = ViewProps & { 8 | lightColor?: string; 9 | darkColor?: string; 10 | }; 11 | 12 | export function ThemedView({ 13 | style, 14 | lightColor, 15 | darkColor, 16 | ...otherProps 17 | }: ThemedViewProps) { 18 | const backgroundColor = useThemeColor( 19 | { light: lightColor, dark: darkColor }, 20 | "background", 21 | ); 22 | 23 | return ; 24 | } 25 | -------------------------------------------------------------------------------- /src/flagd-ui/test/flagd_ui/storage_test.exs: -------------------------------------------------------------------------------- 1 | # Copyright The OpenTelemetry Authors 2 | # SPDX-License-Identifier: Apache-2.0 3 | 4 | defmodule FlagdUi.StorageTest do 5 | use ExUnit.Case 6 | 7 | alias FlagdUi.Storage 8 | 9 | describe "Storage server" do 10 | test "start_link/3" do 11 | {:ok, _} = start_supervised({Storage, [name: TestedStorage]}) 12 | 13 | stop_supervised(TestedStorage) 14 | end 15 | 16 | test "start_link/3 but already running" do 17 | {:ok, _} = start_supervised({Storage, [name: TestedStorage]}) 18 | {:error, {:already_started, _}} = start_supervised({Storage, [name: TestedStorage]}) 19 | 20 | stop_supervised(TestedStorage) 21 | end 22 | end 23 | end 24 | -------------------------------------------------------------------------------- /src/frontend/components/Header/Header.tsx: -------------------------------------------------------------------------------- 1 | // Copyright The OpenTelemetry Authors 2 | // SPDX-License-Identifier: Apache-2.0 3 | 4 | import CartIcon from '../CartIcon'; 5 | import CurrencySwitcher from '../CurrencySwitcher'; 6 | import * as S from './Header.styled'; 7 | 8 | const Header = () => { 9 | return ( 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | ); 24 | }; 25 | 26 | export default Header; 27 | -------------------------------------------------------------------------------- /src/frontend/components/Cart/EmptyCart.tsx: -------------------------------------------------------------------------------- 1 | // Copyright The OpenTelemetry Authors 2 | // SPDX-License-Identifier: Apache-2.0 3 | 4 | import Link from 'next/link'; 5 | import Button from '../Button'; 6 | import * as S from '../../styles/Cart.styled'; 7 | 8 | const EmptyCart = () => { 9 | return ( 10 | 11 | Your shopping cart is empty! 12 | Items you add to your shopping cart will appear here. 13 | 14 | 15 | 16 | Continue Shopping 17 | 18 | 19 | 20 | ); 21 | }; 22 | 23 | export default EmptyCart; 24 | -------------------------------------------------------------------------------- /src/frontend/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "target": "ES2015", 4 | "lib": [ 5 | "dom", 6 | "dom.iterable", 7 | "esnext" 8 | ], 9 | "allowJs": true, 10 | "skipLibCheck": true, 11 | "strict": true, 12 | "forceConsistentCasingInFileNames": true, 13 | "noEmit": true, 14 | "esModuleInterop": true, 15 | "module": "esnext", 16 | "moduleResolution": "node", 17 | "resolveJsonModule": true, 18 | "isolatedModules": true, 19 | "jsx": "react-jsx", 20 | "incremental": true 21 | }, 22 | "include": [ 23 | "next-env.d.ts", 24 | "**/*.ts", 25 | "**/*.tsx", 26 | "protos/**/*.ts" 27 | ], 28 | "exclude": [ 29 | "node_modules" 30 | ] 31 | } 32 | -------------------------------------------------------------------------------- /src/react-native-app/components/ThemedScrollView.tsx: -------------------------------------------------------------------------------- 1 | // Copyright The OpenTelemetry Authors 2 | // SPDX-License-Identifier: Apache-2.0 3 | import { ScrollView, type ScrollViewProps } from "react-native"; 4 | import { useThemeColor } from "@/hooks/useThemeColor"; 5 | 6 | export type ThemedViewProps = ScrollViewProps & { 7 | lightColor?: string; 8 | darkColor?: string; 9 | }; 10 | 11 | export function ThemedScrollView({ 12 | style, 13 | lightColor, 14 | darkColor, 15 | ...otherProps 16 | }: ThemedViewProps) { 17 | const backgroundColor = useThemeColor( 18 | { light: lightColor, dark: darkColor }, 19 | "background", 20 | ); 21 | 22 | return ; 23 | } 24 | -------------------------------------------------------------------------------- /src/frontend/components/ProductList/ProductList.tsx: -------------------------------------------------------------------------------- 1 | // Copyright The OpenTelemetry Authors 2 | // SPDX-License-Identifier: Apache-2.0 3 | 4 | import { CypressFields } from '../../utils/enums/CypressFields'; 5 | import { Product } from '../../protos/demo'; 6 | import ProductCard from '../ProductCard'; 7 | import * as S from './ProductList.styled'; 8 | 9 | interface IProps { 10 | productList: Product[]; 11 | } 12 | 13 | const ProductList = ({ productList }: IProps) => { 14 | return ( 15 | 16 | {productList.map(product => ( 17 | 18 | ))} 19 | 20 | ); 21 | }; 22 | 23 | export default ProductList; 24 | -------------------------------------------------------------------------------- /src/react-native-app/hooks/useThemeColor.ts: -------------------------------------------------------------------------------- 1 | // Copyright The OpenTelemetry Authors 2 | // SPDX-License-Identifier: Apache-2.0 3 | /** 4 | * Learn more about light and dark modes: 5 | * https://docs.expo.dev/guides/color-schemes/ 6 | */ 7 | 8 | import { useColorScheme } from "react-native"; 9 | 10 | import { Colors } from "@/constants/Colors"; 11 | 12 | export function useThemeColor( 13 | props: { light?: string; dark?: string }, 14 | colorName: keyof typeof Colors.light & keyof typeof Colors.dark, 15 | ) { 16 | const theme = useColorScheme() ?? "light"; 17 | const colorFromProps = props[theme]; 18 | 19 | if (colorFromProps) { 20 | return colorFromProps; 21 | } else { 22 | return Colors[theme][colorName]; 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /src/react-native-app/types/Cart.ts: -------------------------------------------------------------------------------- 1 | // Copyright The OpenTelemetry Authors 2 | // SPDX-License-Identifier: Apache-2.0 3 | /** 4 | * Copied with modification from src/frontend/types/Cart.ts 5 | */ 6 | import { Address, Cart, OrderItem, OrderResult, Product } from "@/protos/demo"; 7 | 8 | export interface IProductCartItem { 9 | productId: string; 10 | quantity: number; 11 | product: Product; 12 | } 13 | 14 | export interface IProductCheckoutItem extends OrderItem { 15 | item: IProductCartItem; 16 | } 17 | 18 | export interface IProductCheckout extends OrderResult { 19 | items: IProductCheckoutItem[]; 20 | shippingAddress: Address; 21 | } 22 | 23 | export interface IProductCart extends Cart { 24 | items: IProductCartItem[]; 25 | } 26 | -------------------------------------------------------------------------------- /src/load-generator/Dockerfile: -------------------------------------------------------------------------------- 1 | # Copyright The OpenTelemetry Authors 2 | # SPDX-License-Identifier: Apache-2.0 3 | 4 | 5 | FROM python:3.12-slim-bookworm AS base 6 | 7 | FROM base AS builder 8 | RUN apt-get -qq update \ 9 | && apt-get install -y --no-install-recommends g++ \ 10 | && rm -rf /var/lib/apt/lists/* 11 | 12 | COPY ./src/load-generator/requirements.txt . 13 | RUN pip install --prefix="/reqs" -r requirements.txt 14 | 15 | FROM base 16 | WORKDIR /usr/src/app/ 17 | COPY --from=builder /reqs /usr/local 18 | ENV PLAYWRIGHT_BROWSERS_PATH=/opt/pw-browsers 19 | RUN playwright install --with-deps chromium 20 | COPY ./src/load-generator/locustfile.py . 21 | COPY ./src/load-generator/people.json . 22 | ENTRYPOINT ["locust", "--skip-log-setup"] 23 | -------------------------------------------------------------------------------- /src/frontend/gateways/rpc/Checkout.gateway.ts: -------------------------------------------------------------------------------- 1 | // Copyright The OpenTelemetry Authors 2 | // SPDX-License-Identifier: Apache-2.0 3 | 4 | import { ChannelCredentials } from '@grpc/grpc-js'; 5 | import { CheckoutServiceClient, PlaceOrderRequest, PlaceOrderResponse } from '../../protos/demo'; 6 | 7 | const { CHECKOUT_ADDR = '' } = process.env; 8 | 9 | const client = new CheckoutServiceClient(CHECKOUT_ADDR, ChannelCredentials.createInsecure()); 10 | 11 | const CheckoutGateway = () => ({ 12 | placeOrder(order: PlaceOrderRequest) { 13 | return new Promise((resolve, reject) => 14 | client.placeOrder(order, (error, response) => (error ? reject(error) : resolve(response))) 15 | ); 16 | }, 17 | }); 18 | 19 | export default CheckoutGateway(); 20 | -------------------------------------------------------------------------------- /src/react-native-app/android.Dockerfile: -------------------------------------------------------------------------------- 1 | # syntax=docker/dockerfile:1 2 | 3 | # Copyright The OpenTelemetry Authors 4 | # SPDX-License-Identifier: Apache-2.0 5 | 6 | # https://github.com/react-native-community/docker-android 7 | # Choosing a tag where the Android build tools match what we have in android/build.gradle to avoid the 8 | # container having to download them 9 | FROM reactnativecommunity/react-native-android:v13.2.1 AS builder 10 | 11 | WORKDIR /reactnativesrc/ 12 | COPY . . 13 | 14 | RUN npm install 15 | WORKDIR android/ 16 | RUN chmod +x gradlew 17 | RUN ./gradlew assembleRelease 18 | 19 | FROM scratch 20 | COPY --from=builder /reactnativesrc/android/app/build/outputs/apk/release/app-release.apk /reactnativeapp.apk 21 | ENTRYPOINT ["/reactnativeapp.apk"] 22 | -------------------------------------------------------------------------------- /test/tracetesting/tracetest-provision.yaml: -------------------------------------------------------------------------------- 1 | # Copyright The OpenTelemetry Authors 2 | # SPDX-License-Identifier: Apache-2.0 3 | 4 | --- 5 | type: PollingProfile 6 | spec: 7 | name: Default 8 | strategy: periodic 9 | default: true 10 | periodic: 11 | retryDelay: 5s 12 | timeout: 3m 13 | 14 | --- 15 | type: Demo 16 | spec: 17 | name: "OpenTelemetry Shop" 18 | enabled: true 19 | type: otelstore 20 | opentelemetryStore: 21 | frontendEndpoint: http://frontend:8080 22 | 23 | --- 24 | type: DataStore 25 | spec: 26 | name: Opentelemetry Collector pipeline 27 | type: otlp 28 | default: true 29 | 30 | --- 31 | type: TestRunner 32 | spec: 33 | id: current 34 | name: default 35 | requiredGates: 36 | - analyzer-score 37 | - test-specs 38 | -------------------------------------------------------------------------------- /src/checkout/Dockerfile: -------------------------------------------------------------------------------- 1 | # Copyright The OpenTelemetry Authors 2 | # SPDX-License-Identifier: Apache-2.0 3 | 4 | 5 | FROM golang:1.24-bookworm AS builder 6 | 7 | WORKDIR /usr/src/app/ 8 | 9 | COPY ./src/checkout/go.mod go.mod 10 | COPY ./src/checkout/go.sum go.sum 11 | 12 | RUN go mod download 13 | 14 | COPY ./src/checkout/genproto/oteldemo/ genproto/oteldemo/ 15 | COPY ./src/checkout/kafka/ kafka/ 16 | COPY ./src/checkout/money/ money/ 17 | COPY ./src/checkout/main.go main.go 18 | 19 | RUN CGO_ENABLED=0 GOOS=linux go build -ldflags "-s -w" -o checkout main.go 20 | 21 | FROM gcr.io/distroless/static-debian12:nonroot 22 | 23 | WORKDIR /usr/src/app/ 24 | 25 | COPY --from=builder /usr/src/app/checkout/ ./ 26 | 27 | EXPOSE ${CHECKOUT_PORT} 28 | ENTRYPOINT [ "./checkout" ] 29 | -------------------------------------------------------------------------------- /src/currency/README.md: -------------------------------------------------------------------------------- 1 | # Currency Service 2 | 3 | The Currency Service does the conversion from one currency to another. 4 | It is a C++ based service. 5 | 6 | ## Building docker image 7 | 8 | To build the currency service, run the following from root directory 9 | of opentelemetry-demo 10 | 11 | ```sh 12 | docker compose build currency 13 | ``` 14 | 15 | ## Run the service 16 | 17 | Execute the below command to run the service. 18 | 19 | ```sh 20 | docker compose up currency 21 | ``` 22 | 23 | ## Run the client 24 | 25 | currencyclient is a sample client which sends some request to currency 26 | service. To run the client, execute the below command. 27 | 28 | ```sh 29 | docker exec -it currencyclient 7000 30 | ``` 31 | 32 | `7000` is port where currency listens to. 33 | -------------------------------------------------------------------------------- /src/frontend/components/Select/Select.styled.ts: -------------------------------------------------------------------------------- 1 | // Copyright The OpenTelemetry Authors 2 | // SPDX-License-Identifier: Apache-2.0 3 | 4 | import styled from 'styled-components'; 5 | 6 | export const Select = styled.select` 7 | width: 100%; 8 | height: 45px; 9 | border: 1px solid ${({ theme }) => theme.colors.borderGray}; 10 | padding: 10px 16px; 11 | border-radius: 8px; 12 | position: relative; 13 | width: 100px; 14 | cursor: pointer; 15 | `; 16 | 17 | export const SelectContainer = styled.div` 18 | position: relative; 19 | width: min-content; 20 | `; 21 | 22 | export const Arrow = styled.img.attrs({ 23 | src: '/icons/Chevron.svg', 24 | alt: 'select', 25 | })` 26 | position: absolute; 27 | right: 25px; 28 | top: 20px; 29 | width: 10px; 30 | height: 5px; 31 | `; 32 | -------------------------------------------------------------------------------- /src/jaeger/Dockerfile: -------------------------------------------------------------------------------- 1 | # Copyright The OpenTelemetry Authors 2 | # SPDX-License-Identifier: Apache-2.0 3 | 4 | FROM nginxinc/nginx-unprivileged:1.29.0-alpine3.22 5 | 6 | USER 0 7 | 8 | RUN printf "%s%s%s%s\n" \ 9 | "@nginx " \ 10 | "http://nginx.org/packages/mainline/alpine/v" \ 11 | `egrep -o '^[0-9]+\.[0-9]+' /etc/alpine-release` \ 12 | "/main" \ 13 | | tee -a /etc/apk/repositories 14 | 15 | RUN apk update 16 | 17 | USER 101 18 | 19 | COPY src/jaeger/ui/ /ui/ 20 | COPY src/jaeger/nginx.conf.template /nginx.conf.template 21 | 22 | EXPOSE ${JAEGER_UI_PORT} 23 | 24 | STOPSIGNAL SIGQUIT 25 | 26 | # Start nginx 27 | CMD ["/bin/sh" , "-c" , "envsubst '$JAEGER_UI_PORT' < /nginx.conf.template > /etc/nginx/nginx.conf && cat /etc/nginx/nginx.conf && exec nginx -g 'daemon off;'"] 28 | -------------------------------------------------------------------------------- /src/frontend/components/PlatformFlag/PlatformFlag.styled.ts: -------------------------------------------------------------------------------- 1 | // Copyright The OpenTelemetry Authors 2 | // SPDX-License-Identifier: Apache-2.0 3 | 4 | import styled from 'styled-components'; 5 | 6 | export const Block = styled.div` 7 | position: absolute; 8 | bottom: 0; 9 | right: 0; 10 | width: 100px; 11 | height: 27px; 12 | display: flex; 13 | justify-content: center; 14 | align-items: center; 15 | font-size: ${({ theme }) => theme.sizes.mSmall}; 16 | font-weight: ${({ theme }) => theme.fonts.regular}; 17 | color: ${({ theme }) => theme.colors.white}; 18 | background: ${({ theme }) => theme.colors.otelYellow}; 19 | 20 | ${({ theme }) => theme.breakpoints.desktop} { 21 | width: 190px; 22 | height: 50px; 23 | font-size: ${({ theme }) => theme.sizes.dSmall}; 24 | } 25 | `; 26 | -------------------------------------------------------------------------------- /src/frontend/.eslintrc: -------------------------------------------------------------------------------- 1 | { 2 | "extends": ["plugin:react/recommended", "plugin:@typescript-eslint/recommended", "next/core-web-vitals"], 3 | "plugins": ["@typescript-eslint"], 4 | "root": true, 5 | "globals": {}, 6 | "rules": { 7 | "@typescript-eslint/no-non-null-assertion": "off", 8 | "react-hooks/exhaustive-deps": "warn", 9 | "no-unused-vars": "off", 10 | "@typescript-eslint/no-unused-vars": "error", 11 | "max-len": [ 12 | "error", 13 | { 14 | "code": 150, 15 | "ignoreComments": true, 16 | "ignoreTrailingComments": true, 17 | "ignoreUrls": true, 18 | "ignoreStrings": true, 19 | "ignoreTemplateLiterals": true 20 | } 21 | ] 22 | }, 23 | "parser": "@typescript-eslint/parser", 24 | "env": {}, 25 | "overrides": [] 26 | } 27 | -------------------------------------------------------------------------------- /src/email/Gemfile: -------------------------------------------------------------------------------- 1 | 2 | 3 | source "https://rubygems.org" 4 | 5 | gem "net-smtp", "~> 0.5.1" 6 | gem "pony", "~> 1.13" 7 | gem "puma", "~> 7.1" 8 | gem "sinatra", "~> 4.2" 9 | gem "rackup", "~> 2.2" 10 | 11 | gem "google-protobuf", "~> 4.33.0" 12 | 13 | gem "ostruct" 14 | 15 | gem "opentelemetry-sdk", "~> 1.10" 16 | gem "opentelemetry-common", "~> 0.23" 17 | gem "opentelemetry-logs-sdk", "~> 0.4" 18 | gem 'opentelemetry-metrics-sdk', "~> 0.11" 19 | gem "opentelemetry-exporter-otlp", "~> 0.31" 20 | gem 'opentelemetry-exporter-otlp-metrics', "~> 0.6" 21 | gem 'opentelemetry-exporter-otlp-logs', "~> 0.2" 22 | gem "opentelemetry-instrumentation-all", "~> 0.87" 23 | 24 | gem "openfeature-sdk", "~> 0.4" 25 | gem "openfeature-flagd-provider", "~> 0.1" 26 | -------------------------------------------------------------------------------- /src/product-catalog/Dockerfile: -------------------------------------------------------------------------------- 1 | # Copyright The OpenTelemetry Authors 2 | # SPDX-License-Identifier: Apache-2.0 3 | 4 | 5 | FROM golang:1.24-bookworm AS builder 6 | 7 | WORKDIR /usr/src/app/ 8 | 9 | COPY ./src/product-catalog/go.mod go.mod 10 | COPY ./src/product-catalog/go.sum go.sum 11 | 12 | RUN go mod download 13 | 14 | COPY ./src/product-catalog/genproto/oteldemo/ genproto/oteldemo/ 15 | COPY ./src/product-catalog/products/ products/ 16 | COPY ./src/product-catalog/main.go main.go 17 | 18 | RUN CGO_ENABLED=0 GOOS=linux GO111MODULE=on go build -ldflags "-s -w" -o product-catalog main.go 19 | 20 | FROM gcr.io/distroless/static-debian12:nonroot 21 | 22 | WORKDIR /usr/src/app/ 23 | 24 | COPY --from=builder /usr/src/app/product-catalog/ ./ 25 | 26 | EXPOSE ${PRODUCT_CATALOG_PORT} 27 | ENTRYPOINT [ "./product-catalog" ] 28 | -------------------------------------------------------------------------------- /src/email/Dockerfile: -------------------------------------------------------------------------------- 1 | # Copyright The OpenTelemetry Authors 2 | # SPDX-License-Identifier: Apache-2.0 3 | 4 | 5 | FROM docker.io/library/ruby:3.4.7-alpine3.22 AS builder 6 | 7 | COPY ./src/email/Gemfile Gemfile 8 | COPY ./src/email/Gemfile.lock Gemfile.lock 9 | 10 | RUN apk update && \ 11 | apk add make gcc musl-dev gcompat && \ 12 | bundle install 13 | 14 | FROM docker.io/library/ruby:3.4.7-alpine3.22 15 | 16 | COPY --from=builder /usr/local/bundle/ /usr/local/bundle/ 17 | 18 | WORKDIR /email_server 19 | 20 | COPY ./src/email/views/ views/ 21 | 22 | COPY ./src/email/.ruby-version .ruby-version 23 | COPY ./src/email/Gemfile Gemfile 24 | COPY ./src/email/Gemfile.lock Gemfile.lock 25 | COPY ./src/email/email_server.rb email_server.rb 26 | 27 | EXPOSE ${EMAIL_PORT} 28 | ENTRYPOINT ["bundle", "exec", "ruby", "email_server.rb"] 29 | -------------------------------------------------------------------------------- /src/flagd-ui/lib/flagd_ui_web/controllers/error_json.ex: -------------------------------------------------------------------------------- 1 | # Copyright The OpenTelemetry Authors 2 | # SPDX-License-Identifier: Apache-2.0 3 | 4 | defmodule FlagdUiWeb.ErrorJSON do 5 | @moduledoc """ 6 | This module is invoked by your endpoint in case of errors on JSON requests. 7 | 8 | See config/config.exs. 9 | """ 10 | 11 | # If you want to customize a particular status code, 12 | # you may add your own clauses, such as: 13 | # 14 | # def render("500.json", _assigns) do 15 | # %{errors: %{detail: "Internal Server Error"}} 16 | # end 17 | 18 | # By default, Phoenix returns the status message from 19 | # the template name. For example, "404.json" becomes 20 | # "Not Found". 21 | def render(template, _assigns) do 22 | %{errors: %{detail: Phoenix.Controller.status_message_from_template(template)}} 23 | end 24 | end 25 | -------------------------------------------------------------------------------- /src/react-native-app/utils/Settings.ts: -------------------------------------------------------------------------------- 1 | // Copyright The OpenTelemetry Authors 2 | // SPDX-License-Identifier: Apache-2.0 3 | import AsyncStorage from "@react-native-async-storage/async-storage"; 4 | import getLocalhost from "@/utils/Localhost"; 5 | 6 | const FRONTEND_PROXY_URL_SETTING = 'frontend_proxy_url'; 7 | 8 | export const getFrontendProxyURL = async (): Promise => { 9 | const proxyURL = await AsyncStorage.getItem(FRONTEND_PROXY_URL_SETTING); 10 | if (proxyURL) { 11 | return proxyURL 12 | } else { 13 | const localhost = await getLocalhost(); 14 | return `http://${localhost}:${process.env.EXPO_PUBLIC_FRONTEND_PROXY_PORT}`; 15 | } 16 | }; 17 | 18 | export const setFrontendProxyURL = async (url: string) => { 19 | await AsyncStorage.setItem(FRONTEND_PROXY_URL_SETTING, url); 20 | } 21 | 22 | export default getFrontendProxyURL; 23 | -------------------------------------------------------------------------------- /src/frontend/cypress.config.ts: -------------------------------------------------------------------------------- 1 | // Copyright The OpenTelemetry Authors 2 | // SPDX-License-Identifier: Apache-2.0 3 | 4 | import { defineConfig } from 'cypress'; 5 | import dotEnv from 'dotenv'; 6 | import dotenvExpand from 'dotenv-expand'; 7 | import { resolve } from 'path'; 8 | 9 | const myEnv = dotEnv.config({ 10 | path: resolve(__dirname, '../../.env'), 11 | }); 12 | dotenvExpand.expand(myEnv); 13 | 14 | const { FRONTEND_ADDR = '', NODE_ENV, FRONTEND_PORT = '8080' } = process.env; 15 | 16 | const baseUrl = NODE_ENV === 'production' ? `http://${FRONTEND_ADDR}` : `http://localhost:${FRONTEND_PORT}`; 17 | 18 | export default defineConfig({ 19 | env: { 20 | baseUrl, 21 | }, 22 | e2e: { 23 | baseUrl, 24 | setupNodeEvents(on, config) { 25 | // implement node event listeners here 26 | }, 27 | supportFile: false, 28 | }, 29 | }); 30 | -------------------------------------------------------------------------------- /src/product-reviews/metrics.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/python 2 | 3 | # Copyright The OpenTelemetry Authors 4 | # SPDX-License-Identifier: Apache-2.0 5 | 6 | def init_metrics(meter): 7 | 8 | # Product reviews counter 9 | app_product_review_counter = meter.create_counter( 10 | 'app_product_review_counter', unit='reviews', description="Counts the total number of returned product reviews" 11 | ) 12 | 13 | # AI Assistant counter 14 | app_ai_assistant_counter = meter.create_counter( 15 | 'app_ai_assistant_counter', unit='summaries', description="Counts the total number of AI Assistant requests" 16 | ) 17 | 18 | product_review_svc_metrics = { 19 | "app_product_review_counter": app_product_review_counter, 20 | "app_ai_assistant_counter": app_ai_assistant_counter, 21 | } 22 | 23 | return product_review_svc_metrics 24 | -------------------------------------------------------------------------------- /src/llm/Dockerfile: -------------------------------------------------------------------------------- 1 | # Copyright The OpenTelemetry Authors 2 | # SPDX-License-Identifier: Apache-2.0 3 | 4 | 5 | FROM docker.io/library/python:3.12-alpine3.22 AS build-venv 6 | 7 | RUN apk update && \ 8 | apk add gcc g++ linux-headers 9 | 10 | COPY ./src/llm/requirements.txt requirements.txt 11 | 12 | RUN python -m venv venv && \ 13 | venv/bin/pip install --no-cache-dir -r requirements.txt 14 | 15 | FROM docker.io/library/python:3.12-alpine3.22 16 | 17 | COPY --from=build-venv /venv/ /venv/ 18 | 19 | WORKDIR /app 20 | 21 | COPY ./src/llm/app.py app.py 22 | COPY ./src/llm/product-review-summaries/product-review-summaries.json product-review-summaries.json 23 | COPY ./src/llm/product-review-summaries/inaccurate-product-review-summaries.json inaccurate-product-review-summaries.json 24 | 25 | EXPOSE ${LLM_PORT} 26 | ENTRYPOINT [ "/venv/bin/python", "app.py" ] 27 | -------------------------------------------------------------------------------- /src/cart/tests/cart.tests.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | net10.0 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | all 14 | runtime; build; native; contentfiles; analyzers; buildtransitive 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | -------------------------------------------------------------------------------- /src/frontend/gateways/rpc/Recommendations.gateway.ts: -------------------------------------------------------------------------------- 1 | // Copyright The OpenTelemetry Authors 2 | // SPDX-License-Identifier: Apache-2.0 3 | 4 | import { ChannelCredentials } from '@grpc/grpc-js'; 5 | import { ListRecommendationsResponse, RecommendationServiceClient } from '../../protos/demo'; 6 | 7 | const { RECOMMENDATION_ADDR = '' } = process.env; 8 | 9 | const client = new RecommendationServiceClient(RECOMMENDATION_ADDR, ChannelCredentials.createInsecure()); 10 | 11 | const RecommendationsGateway = () => ({ 12 | listRecommendations(userId: string, productIds: string[]) { 13 | return new Promise((resolve, reject) => 14 | client.listRecommendations({ userId, productIds }, (error, response) => 15 | error ? reject(error) : resolve(response) 16 | ) 17 | ); 18 | }, 19 | }); 20 | 21 | export default RecommendationsGateway(); 22 | -------------------------------------------------------------------------------- /src/frontend/pages/api/currency.ts: -------------------------------------------------------------------------------- 1 | // Copyright The OpenTelemetry Authors 2 | // SPDX-License-Identifier: Apache-2.0 3 | 4 | import type { NextApiRequest, NextApiResponse } from 'next'; 5 | import InstrumentationMiddleware from '../../utils/telemetry/InstrumentationMiddleware'; 6 | import CurrencyGateway from '../../gateways/rpc/Currency.gateway'; 7 | import { Empty } from '../../protos/demo'; 8 | 9 | type TResponse = string[] | Empty; 10 | 11 | const handler = async ({ method }: NextApiRequest, res: NextApiResponse) => { 12 | switch (method) { 13 | case 'GET': { 14 | const { currencyCodes = [] } = await CurrencyGateway.getSupportedCurrencies(); 15 | 16 | return res.status(200).json(currencyCodes); 17 | } 18 | 19 | default: { 20 | return res.status(405); 21 | } 22 | } 23 | }; 24 | 25 | export default InstrumentationMiddleware(handler); 26 | -------------------------------------------------------------------------------- /test/tracetesting/product-reviews/reviews.yaml: -------------------------------------------------------------------------------- 1 | # Copyright The OpenTelemetry Authors 2 | # SPDX-License-Identifier: Apache-2.0 3 | 4 | type: Test 5 | spec: 6 | id: product-reviews-get 7 | name: 'Product Reviews: Get product reviews for product' 8 | description: Get all product reviews for the specified product 9 | trigger: 10 | type: grpc 11 | grpc: 12 | protobufFile: ../../../pb/demo.proto 13 | address: ${var:PRODUCT_REVIEWS_ADDR} 14 | method: oteldemo.ProductReviewService.GetProductReviews 15 | request: |- 16 | { 17 | "product_id": "L9ECAV7KIM" 18 | } 19 | specs: 20 | - name: It called GetProductReviews correctly and got 5 product reviews 21 | selector: span[name="get_product_reviews"] 22 | assertions: 23 | - attr:app.product.id = "L9ECAV7KIM" 24 | - attr:app.product_reviews.count = 5 25 | -------------------------------------------------------------------------------- /test/tracetesting/checkout/add-item-to-cart.yaml: -------------------------------------------------------------------------------- 1 | # Copyright The OpenTelemetry Authors 2 | # SPDX-License-Identifier: Apache-2.0 3 | 4 | type: Test 5 | spec: 6 | id: checkout-add-item-to-cart 7 | name: 'Checkout: add item to cart' 8 | description: Add items to the shopping cart before placing an order 9 | trigger: 10 | type: grpc 11 | grpc: 12 | protobufFile: ../../../pb/demo.proto 13 | address: ${var:CART_ADDR} 14 | method: oteldemo.CartService.AddItem 15 | request: |- 16 | { 17 | "userId": "1997", 18 | "item": { 19 | "productId": "66VCHSJNUP", 20 | "quantity": 2 21 | } 22 | } 23 | specs: 24 | - name: It added an item correctly into the shopping cart 25 | selector: span[name="POST /oteldemo.CartService/AddItem"] 26 | assertions: 27 | - attr:grpc.status_code = 0 28 | -------------------------------------------------------------------------------- /src/frontend/services/ProductReview.service.ts: -------------------------------------------------------------------------------- 1 | // Copyright The OpenTelemetry Authors 2 | // SPDX-License-Identifier: Apache-2.0 3 | 4 | import ProductReviewGateway from '../gateways/rpc/ProductReview.gateway'; 5 | 6 | const ProductReviewService = () => ({ 7 | 8 | async getProductReviews(id: string) { 9 | const productReviews = await ProductReviewGateway.getProductReviews(id); 10 | 11 | return productReviews; 12 | }, 13 | async getAverageProductReviewScore(id: string) { 14 | const averageScore = await ProductReviewGateway.getAverageProductReviewScore(id); 15 | 16 | return averageScore; 17 | }, 18 | async askProductAIAssistant(id: string, question: string) { 19 | const response = await ProductReviewGateway.askProductAIAssistant(id, question); 20 | 21 | return response; 22 | }, 23 | }); 24 | 25 | export default ProductReviewService(); 26 | -------------------------------------------------------------------------------- /src/payment/Dockerfile: -------------------------------------------------------------------------------- 1 | # Copyright The OpenTelemetry Authors 2 | # SPDX-License-Identifier: Apache-2.0 3 | 4 | 5 | FROM docker.io/library/node:22-slim AS builder 6 | 7 | WORKDIR /usr/src/app/ 8 | 9 | COPY ./src/payment/package.json package.json 10 | COPY ./src/payment/package-lock.json package-lock.json 11 | 12 | RUN npm ci --omit=dev 13 | 14 | # ----------------------------------------------------------------------------- 15 | 16 | FROM gcr.io/distroless/nodejs22-debian12:nonroot 17 | 18 | WORKDIR /usr/src/app/ 19 | 20 | COPY --from=builder /usr/src/app/node_modules/ node_modules/ 21 | 22 | COPY ./pb/demo.proto demo.proto 23 | 24 | COPY ./src/payment/charge.js charge.js 25 | COPY ./src/payment/index.js index.js 26 | COPY ./src/payment/logger.js logger.js 27 | COPY ./src/payment/opentelemetry.js opentelemetry.js 28 | 29 | EXPOSE ${PAYMENT_PORT} 30 | 31 | CMD ["--require=./opentelemetry.js", "index.js"] 32 | -------------------------------------------------------------------------------- /test/tracetesting/frontend/05-view-cart.yaml: -------------------------------------------------------------------------------- 1 | # Copyright The OpenTelemetry Authors 2 | # SPDX-License-Identifier: Apache-2.0 3 | 4 | type: Test 5 | spec: 6 | id: frontend-view-cart 7 | name: 'Frontend: View cart' 8 | description: Simulate a user viewing the shopping cart 9 | trigger: 10 | type: http 11 | httpRequest: 12 | url: http://${var:FRONTEND_ADDR}/api/cart?userId=2491f868-88f1-4345-8836-d5d8511a9f83 13 | method: GET 14 | headers: 15 | - key: Content-Type 16 | value: application/json 17 | specs: 18 | - name: It called the frontend with success 19 | selector: span[tracetest.span.type="general" name="Tracetest trigger"] 20 | assertions: 21 | - attr:tracetest.response.status = 200 22 | - name: It retrieved the cart items correctly 23 | selector: span[name="POST /oteldemo.CartService/GetCart"] 24 | assertions: 25 | - attr:grpc.status_code = 0 26 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | *~ 2 | *.iml 3 | *.ipr 4 | *.iws 5 | *.pyc 6 | .nb-gradle 7 | .nb-gradle-properties 8 | .swp 9 | .DS_Store 10 | \#*\# 11 | 12 | docker-compose.override.yml 13 | 14 | # Eclipse 15 | .classpath 16 | .project 17 | .settings 18 | 19 | bin/ 20 | obj/ 21 | .vs/ 22 | .vscode 23 | .gradle/ 24 | .idea/ 25 | build/ 26 | node_modules/ 27 | coverage 28 | .next/ 29 | out/ 30 | build 31 | next-env.d.ts 32 | vendor/ 33 | composer.lock 34 | .venv 35 | .dockerhub.env 36 | .ghcr.env 37 | 38 | src/frontend/cypress/videos 39 | src/frontend/cypress/screenshots 40 | src/shipping/target/ 41 | test/tracetesting/tracetesting-vars.yaml 42 | 43 | # Ignore copied/generated protobuf files 44 | /src/accounting/src/protos/ 45 | /src/cart/src/protos/ 46 | /src/fraud-detection/src/main/proto 47 | /src/payment/demo.proto 48 | /src/shipping/proto/ 49 | /src/currency/proto 50 | /src/frontend/pb 51 | 52 | # Android 53 | *.apk 54 | 55 | !src/currency/build 56 | -------------------------------------------------------------------------------- /test/tracetesting/cart/empty-cart.yaml: -------------------------------------------------------------------------------- 1 | # Copyright The OpenTelemetry Authors 2 | # SPDX-License-Identifier: Apache-2.0 3 | 4 | type: Test 5 | spec: 6 | id: cart-empty-cart 7 | name: 'Cart: empty cart' 8 | description: Clean shopping cart 9 | trigger: 10 | type: grpc 11 | grpc: 12 | protobufFile: ../../../pb/demo.proto 13 | address: ${var:CART_ADDR} 14 | method: oteldemo.CartService.EmptyCart 15 | request: |- 16 | { 17 | "userId": "1234" 18 | } 19 | specs: 20 | - name: It emptied the shopping cart with success 21 | selector: span[name="POST /oteldemo.CartService/EmptyCart"] 22 | assertions: 23 | - attr:grpc.status_code = 0 24 | - name: It sent cleaning message to the database 25 | selector: span[tracetest.span.type="database" name="EXPIRE" db.system="redis" db.redis.database_index="0"] 26 | assertions: 27 | - attr:db.statement = "EXPIRE 1234" 28 | -------------------------------------------------------------------------------- /src/frontend/components/Button/Button.tsx: -------------------------------------------------------------------------------- 1 | // Copyright The OpenTelemetry Authors 2 | // SPDX-License-Identifier: Apache-2.0 3 | 4 | import styled, { css } from 'styled-components'; 5 | 6 | const Button = styled.button<{ $type?: 'primary' | 'secondary' | 'link' }>` 7 | background-color: #5262a8; 8 | color: white; 9 | display: inline-block; 10 | border: solid 1px #5262a8; 11 | padding: 8px 16px; 12 | outline: none; 13 | font-weight: 700; 14 | font-size: 20px; 15 | line-height: 27px; 16 | border-radius: 10px; 17 | height: 62px; 18 | cursor: pointer; 19 | 20 | ${({ $type = 'primary' }) => 21 | $type === 'secondary' && 22 | css` 23 | background: none; 24 | color: #5262a8; 25 | `}; 26 | 27 | ${({ $type = 'primary' }) => 28 | $type === 'link' && 29 | css` 30 | background: none; 31 | color: #5262a8; 32 | border: none; 33 | `}; 34 | `; 35 | 36 | export default Button; 37 | -------------------------------------------------------------------------------- /src/product-catalog/README.md: -------------------------------------------------------------------------------- 1 | # Product Catalog Service 2 | 3 | When this service is run the output should be similar to the following 4 | 5 | ```json 6 | {"message":"successfully parsed product catalog json","severity":"info","timestamp":"2022-06-02T23:54:10.191283363Z"} 7 | {"message":"starting grpc server at :3550","severity":"info","timestamp":"2022-06-02T23:54:10.191849078Z"} 8 | ``` 9 | 10 | ## Local Build 11 | 12 | To build the service binary, run: 13 | 14 | ```sh 15 | go build -o /go/bin/product-catalog/ 16 | ``` 17 | 18 | ## Docker Build 19 | 20 | From the root directory, run: 21 | 22 | ```sh 23 | docker compose build product-catalog 24 | ``` 25 | 26 | ## Regenerate protos 27 | 28 | To build the protos, run from the root directory: 29 | 30 | ```sh 31 | make docker-generate-protobuf 32 | ``` 33 | 34 | ## Bump dependencies 35 | 36 | To bump all dependencies run: 37 | 38 | ```sh 39 | go get -u -t ./... 40 | go mod tidy 41 | ``` 42 | -------------------------------------------------------------------------------- /src/frontend/utils/Request.ts: -------------------------------------------------------------------------------- 1 | // Copyright The OpenTelemetry Authors 2 | // SPDX-License-Identifier: Apache-2.0 3 | 4 | interface IRequestParams { 5 | url: string; 6 | body?: object; 7 | method?: 'GET' | 'POST' | 'PUT' | 'DELETE'; 8 | queryParams?: Record; 9 | headers?: Record; 10 | } 11 | 12 | const request = async ({ 13 | url = '', 14 | method = 'GET', 15 | body, 16 | queryParams = {}, 17 | headers = { 18 | 'content-type': 'application/json', 19 | }, 20 | }: IRequestParams): Promise => { 21 | const response = await fetch(`${url}?${new URLSearchParams(queryParams).toString()}`, { 22 | method, 23 | body: body ? JSON.stringify(body) : undefined, 24 | headers, 25 | }); 26 | 27 | const responseText = await response.text(); 28 | 29 | if (!!responseText) return JSON.parse(responseText); 30 | 31 | return undefined as unknown as T; 32 | }; 33 | 34 | export default request; 35 | -------------------------------------------------------------------------------- /test/tracetesting/cart/check-if-cart-is-empty.yaml: -------------------------------------------------------------------------------- 1 | # Copyright The OpenTelemetry Authors 2 | # SPDX-License-Identifier: Apache-2.0 3 | 4 | type: Test 5 | spec: 6 | id: cart-check-if-cart-is-empty 7 | name: 'Cart: check if cart is empty' 8 | description: Check if the shopping cart has no items 9 | trigger: 10 | type: grpc 11 | grpc: 12 | protobufFile: ../../../pb/demo.proto 13 | address: ${var:CART_ADDR} 14 | method: oteldemo.CartService.GetCart 15 | request: |- 16 | { 17 | "userId": "1234" 18 | } 19 | specs: 20 | - name: It retrieved the cart items correctly 21 | selector: span[name="POST /oteldemo.CartService/GetCart"] 22 | assertions: 23 | - attr:grpc.status_code = 0 24 | - name: It returned no items 25 | selector: span[tracetest.span.type="general" name="Tracetest trigger"] 26 | assertions: 27 | - attr:tracetest.response.body | json_path '$.items' = "[]" 28 | -------------------------------------------------------------------------------- /src/frontend/components/Input/Input.tsx: -------------------------------------------------------------------------------- 1 | // Copyright The OpenTelemetry Authors 2 | // SPDX-License-Identifier: Apache-2.0 3 | 4 | import { HTMLInputTypeAttribute, InputHTMLAttributes } from 'react'; 5 | import * as S from './Input.styled'; 6 | 7 | interface IProps extends InputHTMLAttributes { 8 | type: HTMLInputTypeAttribute | 'select'; 9 | children?: React.ReactNode; 10 | label: string; 11 | } 12 | 13 | const Input = ({ type, id = '', children, label, ...props }: IProps) => { 14 | return ( 15 | 16 | {label} 17 | {type === 'select' ? ( 18 | <> 19 | 20 | {children} 21 | 22 | 23 | > 24 | ) : ( 25 | 26 | )} 27 | 28 | ); 29 | }; 30 | 31 | export default Input; 32 | -------------------------------------------------------------------------------- /src/frontend/pages/api/data.ts: -------------------------------------------------------------------------------- 1 | // Copyright The OpenTelemetry Authors 2 | // SPDX-License-Identifier: Apache-2.0 3 | 4 | import type { NextApiRequest, NextApiResponse } from 'next'; 5 | import InstrumentationMiddleware from '../../utils/telemetry/InstrumentationMiddleware'; 6 | import AdGateway from '../../gateways/rpc/Ad.gateway'; 7 | import { Ad, Empty } from '../../protos/demo'; 8 | 9 | type TResponse = Ad[] | Empty; 10 | 11 | const handler = async ({ method, query }: NextApiRequest, res: NextApiResponse) => { 12 | switch (method) { 13 | case 'GET': { 14 | const { contextKeys = [] } = query; 15 | const { ads: adList } = await AdGateway.listAds(Array.isArray(contextKeys) ? contextKeys : contextKeys.split(',')); 16 | 17 | return res.status(200).json(adList); 18 | } 19 | 20 | default: { 21 | return res.status(405).send(''); 22 | } 23 | } 24 | }; 25 | 26 | export default InstrumentationMiddleware(handler); 27 | -------------------------------------------------------------------------------- /src/payment/logger.js: -------------------------------------------------------------------------------- 1 | // Copyright The OpenTelemetry Authors 2 | // SPDX-License-Identifier: Apache-2.0 3 | 4 | const pino = require('pino') 5 | 6 | const transport = pino.transport({ 7 | target: 'pino-opentelemetry-transport', 8 | options: { 9 | logRecordProcessorOptions: [ 10 | { 11 | recordProcessorType: 'batch', 12 | exporterOptions: { 13 | protocol: 'grpc', 14 | } 15 | }, 16 | { 17 | recordProcessorType: 'simple', 18 | exporterOptions: { protocol: 'console' } 19 | } 20 | ], 21 | loggerName: 'payment-logger', 22 | serviceVersion: '1.0.0' 23 | } 24 | }) 25 | 26 | const logger = pino(transport, { 27 | mixin() { 28 | return { 29 | 'service.name': process.env['OTEL_SERVICE_NAME'], 30 | } 31 | }, 32 | formatters: { 33 | level: (label) => { 34 | return { 'level': label }; 35 | }, 36 | }, 37 | }); 38 | 39 | module.exports = logger; 40 | -------------------------------------------------------------------------------- /src/flagd-ui/lib/flagd_ui_web/controllers/error_html.ex: -------------------------------------------------------------------------------- 1 | # Copyright The OpenTelemetry Authors 2 | # SPDX-License-Identifier: Apache-2.0 3 | 4 | defmodule FlagdUiWeb.ErrorHTML do 5 | @moduledoc """ 6 | This module is invoked by your endpoint in case of errors on HTML requests. 7 | 8 | See config/config.exs. 9 | """ 10 | use FlagdUiWeb, :html 11 | 12 | # If you want to customize your error pages, 13 | # uncomment the embed_templates/1 call below 14 | # and add pages to the error directory: 15 | # 16 | # * lib/flagd_ui_web/controllers/error_html/404.html.heex 17 | # * lib/flagd_ui_web/controllers/error_html/500.html.heex 18 | # 19 | # embed_templates "error_html/*" 20 | 21 | # The default is to render a plain text page based on 22 | # the template name. For example, "404.html" becomes 23 | # "Not Found". 24 | def render(template, _assigns) do 25 | Phoenix.Controller.status_message_from_template(template) 26 | end 27 | end 28 | -------------------------------------------------------------------------------- /src/react-native-app/components/Field.tsx: -------------------------------------------------------------------------------- 1 | // Copyright The OpenTelemetry Authors 2 | // SPDX-License-Identifier: Apache-2.0 3 | import { StyleSheet, TextInput, type TextInputProps } from "react-native"; 4 | import { ThemedView } from "@/components/ThemedView"; 5 | import { ThemedText } from "@/components/ThemedText"; 6 | import { useThemeColor } from "@/hooks/useThemeColor"; 7 | 8 | export type FieldProps = TextInputProps & { 9 | label: string; 10 | }; 11 | 12 | export function Field({ label, ...otherProps }: FieldProps) { 13 | const color = useThemeColor({}, "text"); 14 | 15 | return ( 16 | 17 | {label}: 18 | 19 | 20 | ); 21 | } 22 | 23 | const styles = StyleSheet.create({ 24 | container: { 25 | display: "flex", 26 | flexDirection: "row", 27 | gap: 10, 28 | alignItems: "center", 29 | }, 30 | }); 31 | -------------------------------------------------------------------------------- /test/tracetesting/product-reviews/summary.yaml: -------------------------------------------------------------------------------- 1 | # Copyright The OpenTelemetry Authors 2 | # SPDX-License-Identifier: Apache-2.0 3 | 4 | type: Test 5 | spec: 6 | id: product-review-summary 7 | name: 'Product Review Summary: Get a summary of the product reviews for product' 8 | description: Get a summary of product reviews for the specified product 9 | trigger: 10 | type: grpc 11 | grpc: 12 | protobufFile: ../../../pb/demo.proto 13 | address: ${var:PRODUCT_REVIEWS_ADDR} 14 | method: oteldemo.ProductReviewService.GetAverageProductReviewScore 15 | request: |- 16 | { 17 | "product_id": "66VCHSJNUP" 18 | } 19 | specs: 20 | - name: It called GetAverageProductReviewScore correctly and got the average score 21 | selector: span[name="get_average_product_review_score"] 22 | assertions: 23 | - attr:app.product.id = "66VCHSJNUP" 24 | - attr:app.product_reviews.average_score = 4.6 25 | -------------------------------------------------------------------------------- /src/image-provider/nginx.conf.template: -------------------------------------------------------------------------------- 1 | load_module modules/ngx_otel_module.so; 2 | 3 | pid /tmp/nginx.pid; 4 | 5 | events { 6 | worker_connections 1024; 7 | } 8 | 9 | http { 10 | otel_exporter { 11 | endpoint ${OTEL_COLLECTOR_HOST}:${OTEL_COLLECTOR_PORT_GRPC}; 12 | } 13 | otel_trace on; 14 | otel_trace_context propagate; 15 | otel_service_name ${OTEL_SERVICE_NAME}; 16 | otel_span_name image-provider; 17 | 18 | 19 | include mime.types; 20 | sendfile on; 21 | server { 22 | listen ${IMAGE_PROVIDER_PORT}; 23 | listen [::]:${IMAGE_PROVIDER_PORT}; 24 | 25 | resolver 127.0.0.11; 26 | autoindex off; 27 | 28 | server_name _; 29 | server_tokens off; 30 | 31 | root /static; 32 | gzip_static on; 33 | 34 | location /status { 35 | stub_status on; 36 | access_log on; 37 | allow all; 38 | } 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /src/flagd-ui/config/prod.exs: -------------------------------------------------------------------------------- 1 | # Copyright The OpenTelemetry Authors 2 | # SPDX-License-Identifier: Apache-2.0 3 | 4 | import Config 5 | 6 | # Note we also include the path to a cache manifest 7 | # containing the digested version of static files. This 8 | # manifest is generated by the `mix assets.deploy` task, 9 | # which you should run after static files are built and 10 | # before starting your production server. 11 | config :flagd_ui, FlagdUiWeb.Endpoint, cache_static_manifest: "priv/static/cache_manifest.json" 12 | 13 | # Configures Swoosh API Client 14 | config :swoosh, api_client: Swoosh.ApiClient.Req 15 | 16 | # Disable Swoosh Local Memory Storage 17 | config :swoosh, local: false 18 | 19 | # Do not print debug messages in production 20 | config :logger, level: :info 21 | 22 | config :flagd_ui, storage_file_path: "/app/data/demo.flagd.json" 23 | 24 | # Runtime production configuration, including reading 25 | # of environment variables, is done on config/runtime.exs. 26 | -------------------------------------------------------------------------------- /src/react-native-app/constants/Colors.ts: -------------------------------------------------------------------------------- 1 | // Copyright The OpenTelemetry Authors 2 | // SPDX-License-Identifier: Apache-2.0 3 | /** 4 | * Below are the colors that are used in the app. The colors are defined in the light and dark mode. 5 | * There are many other ways to style your app. For example, [Nativewind](https://www.nativewind.dev/), [Tamagui](https://tamagui.dev/), [unistyles](https://reactnativeunistyles.vercel.app), etc. 6 | */ 7 | 8 | const tintColorLight = "#0a7ea4"; 9 | const tintColorDark = "#fff"; 10 | 11 | export const Colors = { 12 | light: { 13 | text: "#11181C", 14 | background: "#fff", 15 | tint: tintColorLight, 16 | icon: "#687076", 17 | tabIconDefault: "#687076", 18 | tabIconSelected: tintColorLight, 19 | }, 20 | dark: { 21 | text: "#ECEDEE", 22 | background: "#151718", 23 | tint: tintColorDark, 24 | icon: "#9BA1A6", 25 | tabIconDefault: "#9BA1A6", 26 | tabIconSelected: tintColorDark, 27 | }, 28 | }; 29 | -------------------------------------------------------------------------------- /src/frontend/pages/api/products/index.ts: -------------------------------------------------------------------------------- 1 | // Copyright The OpenTelemetry Authors 2 | // SPDX-License-Identifier: Apache-2.0 3 | 4 | import type { NextApiRequest, NextApiResponse } from 'next'; 5 | import InstrumentationMiddleware from '../../../utils/telemetry/InstrumentationMiddleware'; 6 | import { Empty, Product } from '../../../protos/demo'; 7 | import ProductCatalogService from '../../../services/ProductCatalog.service'; 8 | 9 | type TResponse = Product[] | Empty; 10 | 11 | const handler = async ({ method, query }: NextApiRequest, res: NextApiResponse) => { 12 | switch (method) { 13 | case 'GET': { 14 | const { currencyCode = '' } = query; 15 | const productList = await ProductCatalogService.listProducts(currencyCode as string); 16 | 17 | return res.status(200).json(productList); 18 | } 19 | 20 | default: { 21 | return res.status(405).send(''); 22 | } 23 | } 24 | }; 25 | 26 | export default InstrumentationMiddleware(handler); 27 | -------------------------------------------------------------------------------- /src/quote/Dockerfile: -------------------------------------------------------------------------------- 1 | # Copyright The OpenTelemetry Authors 2 | # SPDX-License-Identifier: Apache-2.0 3 | 4 | 5 | FROM ghcr.io/mlocati/php-extension-installer:2.9.11 AS installer 6 | 7 | FROM docker.io/library/composer:2.8.12 AS vendor 8 | 9 | WORKDIR /tmp/ 10 | 11 | COPY ./src/quote/composer.json composer.json 12 | 13 | RUN composer install \ 14 | --ignore-platform-reqs \ 15 | --no-interaction \ 16 | --no-plugins \ 17 | --no-scripts \ 18 | --no-dev \ 19 | --prefer-dist 20 | 21 | FROM docker.io/library/php:8.4-cli-alpine3.22 22 | 23 | COPY --from=installer /usr/bin/install-php-extensions /usr/local/bin/ 24 | 25 | RUN install-php-extensions opcache pcntl protobuf opentelemetry 26 | 27 | WORKDIR /var/www 28 | 29 | USER www-data 30 | 31 | COPY --from=vendor /tmp/vendor/ vendor/ 32 | 33 | COPY ./src/quote/app/ app/ 34 | COPY ./src/quote/public/ public/ 35 | COPY ./src/quote/src/ src/ 36 | 37 | EXPOSE ${QUOTE_PORT} 38 | 39 | CMD ["php", "public/index.php"] 40 | -------------------------------------------------------------------------------- /src/fraud-detection/Dockerfile: -------------------------------------------------------------------------------- 1 | # Copyright The OpenTelemetry Authors 2 | # SPDX-License-Identifier: Apache-2.0 3 | 4 | 5 | FROM --platform=${BUILDPLATFORM} gradle:8-jdk17 AS builder 6 | 7 | WORKDIR /usr/src/app/ 8 | 9 | COPY ./src/fraud-detection/ ./ 10 | COPY ./pb/ ./src/main/proto/ 11 | 12 | RUN gradle shadowJar 13 | 14 | # ----------------------------------------------------------------------------- 15 | 16 | FROM gcr.io/distroless/java17-debian12:nonroot 17 | 18 | ARG OTEL_JAVA_AGENT_VERSION 19 | WORKDIR /usr/src/app/ 20 | 21 | ADD --chmod=644 https://github.com/open-telemetry/opentelemetry-java-instrumentation/releases/download/v$OTEL_JAVA_AGENT_VERSION/opentelemetry-javaagent.jar /usr/src/app/opentelemetry-javaagent.jar 22 | ENV JAVA_TOOL_OPTIONS=-javaagent:/usr/src/app/opentelemetry-javaagent.jar 23 | 24 | COPY --from=builder /usr/src/app/build/libs/fraud-detection-1.0-all.jar fraud-detection-1.0-all.jar 25 | 26 | ENTRYPOINT [ "java", "-jar", "fraud-detection-1.0-all.jar" ] 27 | -------------------------------------------------------------------------------- /src/frontend/public/icons/Check.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | -------------------------------------------------------------------------------- /src/react-native-app/android/app/src/main/res/values/styles.xml: -------------------------------------------------------------------------------- 1 | 2 | 9 | 14 | 17 | 18 | -------------------------------------------------------------------------------- /src/frontend/gateways/rpc/ProductCatalog.gateway.ts: -------------------------------------------------------------------------------- 1 | // Copyright The OpenTelemetry Authors 2 | // SPDX-License-Identifier: Apache-2.0 3 | 4 | import { ChannelCredentials } from '@grpc/grpc-js'; 5 | import { ListProductsResponse, Product, ProductCatalogServiceClient } from '../../protos/demo'; 6 | 7 | const { PRODUCT_CATALOG_ADDR = '' } = process.env; 8 | 9 | const client = new ProductCatalogServiceClient(PRODUCT_CATALOG_ADDR, ChannelCredentials.createInsecure()); 10 | 11 | const ProductCatalogGateway = () => ({ 12 | listProducts() { 13 | return new Promise((resolve, reject) => 14 | client.listProducts({}, (error, response) => (error ? reject(error) : resolve(response))) 15 | ); 16 | }, 17 | getProduct(id: string) { 18 | return new Promise((resolve, reject) => 19 | client.getProduct({ id }, (error, response) => (error ? reject(error) : resolve(response))) 20 | ); 21 | }, 22 | }); 23 | 24 | export default ProductCatalogGateway(); 25 | -------------------------------------------------------------------------------- /src/frontend/gateways/rpc/Currency.gateway.ts: -------------------------------------------------------------------------------- 1 | // Copyright The OpenTelemetry Authors 2 | // SPDX-License-Identifier: Apache-2.0 3 | 4 | import { ChannelCredentials } from '@grpc/grpc-js'; 5 | import { GetSupportedCurrenciesResponse, CurrencyServiceClient, Money } from '../../protos/demo'; 6 | 7 | const { CURRENCY_ADDR = '' } = process.env; 8 | 9 | const client = new CurrencyServiceClient(CURRENCY_ADDR, ChannelCredentials.createInsecure()); 10 | 11 | const CurrencyGateway = () => ({ 12 | convert(from: Money, toCode: string) { 13 | return new Promise((resolve, reject) => 14 | client.convert({ from, toCode }, (error, response) => (error ? reject(error) : resolve(response))) 15 | ); 16 | }, 17 | getSupportedCurrencies() { 18 | return new Promise((resolve, reject) => 19 | client.getSupportedCurrencies({}, (error, response) => (error ? reject(error) : resolve(response))) 20 | ); 21 | }, 22 | }); 23 | 24 | export default CurrencyGateway(); 25 | -------------------------------------------------------------------------------- /src/quote/app/settings.php: -------------------------------------------------------------------------------- 1 | addDefinitions([ 17 | SettingsInterface::class => function () { 18 | return new Settings([ 19 | 'displayErrorDetails' => true, // Should be set to false in production 20 | 'logError' => false, 21 | 'logErrorDetails' => false, 22 | 'logger' => [ 23 | 'name' => 'slim-app', 24 | 'path' => 'php://stdout', 25 | 'level' => LogLevel::DEBUG, 26 | ], 27 | ]); 28 | } 29 | ]); 30 | }; 31 | -------------------------------------------------------------------------------- /src/frontend/components/ProductCard/ProductCard.styled.ts: -------------------------------------------------------------------------------- 1 | // Copyright The OpenTelemetry Authors 2 | // SPDX-License-Identifier: Apache-2.0 3 | 4 | import styled from 'styled-components'; 5 | import RouterLink from 'next/link'; 6 | 7 | export const Link = styled(RouterLink)` 8 | text-decoration: none; 9 | `; 10 | 11 | export const Image = styled.div<{ $src: string }>` 12 | width: 100%; 13 | height: 150px; 14 | background: url(${({ $src }) => $src}) no-repeat center; 15 | background-size: contain; 16 | 17 | ${({ theme }) => theme.breakpoints.desktop} { 18 | height: 300px; 19 | } 20 | `; 21 | 22 | export const ProductCard = styled.div` 23 | cursor: pointer; 24 | `; 25 | 26 | export const ProductName = styled.p` 27 | margin: 0; 28 | margin-top: 10px; 29 | font-size: ${({ theme }) => theme.sizes.dSmall}; 30 | `; 31 | 32 | export const ProductPrice = styled.p` 33 | margin: 0; 34 | font-size: ${({ theme }) => theme.sizes.dMedium}; 35 | font-weight: ${({ theme }) => theme.fonts.bold}; 36 | `; 37 | -------------------------------------------------------------------------------- /src/quote/app/dependencies.php: -------------------------------------------------------------------------------- 1 | addDefinitions([ 20 | LoggerInterface::class => function (ContainerInterface $c) { 21 | $settings = $c->get(SettingsInterface::class); 22 | $loggerSettings = $settings->get('logger'); 23 | $handler = new Handler( 24 | Globals::loggerProvider(), 25 | LogLevel::INFO, 26 | ); 27 | return new Logger($loggerSettings['name'], [$handler]); 28 | }, 29 | ]); 30 | }; 31 | -------------------------------------------------------------------------------- /src/frontend/components/ProductPrice/ProductPrice.tsx: -------------------------------------------------------------------------------- 1 | // Copyright The OpenTelemetry Authors 2 | // SPDX-License-Identifier: Apache-2.0 3 | 4 | import { useMemo } from 'react'; 5 | import getSymbolFromCurrency from 'currency-symbol-map'; 6 | import { Money } from '../../protos/demo'; 7 | import { useCurrency } from '../../providers/Currency.provider'; 8 | import { CypressFields } from '../../utils/enums/CypressFields'; 9 | 10 | interface IProps { 11 | price: Money; 12 | } 13 | 14 | const ProductPrice = ({ price: { units, currencyCode, nanos } }: IProps) => { 15 | const { selectedCurrency } = useCurrency(); 16 | 17 | const currencySymbol = useMemo( 18 | () => getSymbolFromCurrency(currencyCode) || selectedCurrency, 19 | [currencyCode, selectedCurrency] 20 | ); 21 | 22 | const total = units + nanos / 1000000000; 23 | 24 | return ( 25 | 26 | {currencySymbol} {total.toFixed(2)} 27 | 28 | ); 29 | }; 30 | 31 | export default ProductPrice; 32 | -------------------------------------------------------------------------------- /src/frontend/README.md: -------------------------------------------------------------------------------- 1 | # Frontend service 2 | 3 | The frontend is a [Next.js](https://nextjs.org/) application that is composed 4 | by two layers. 5 | 6 | 1. Client side application. Which renders the components for the OTEL webstore. 7 | 2. API layer. Connects the client to the backend services by exposing REST endpoints. 8 | 9 | ## Build Locally 10 | 11 | By running `docker compose up` at the root of the project you'll have access to the 12 | frontend client by going to . 13 | 14 | ## Local development 15 | 16 | Currently, the easiest way to run the frontend for local development is to execute 17 | 18 | ```shell 19 | docker compose run --service-ports -e NODE_ENV=development --volume $(pwd)/src/frontend:/app --volume $(pwd)/pb:/app/pb --user node --entrypoint sh frontend 20 | ``` 21 | 22 | from the root folder. 23 | 24 | It will start all of the required backend services 25 | and within the container simply run `npm run dev`. 26 | After that the app should be available at . 27 | -------------------------------------------------------------------------------- /src/frontend/components/CartIcon/CartIcon.tsx: -------------------------------------------------------------------------------- 1 | // Copyright The OpenTelemetry Authors 2 | // SPDX-License-Identifier: Apache-2.0 3 | 4 | import { useState } from 'react'; 5 | import { CypressFields } from '../../utils/enums/CypressFields'; 6 | import { useCart } from '../../providers/Cart.provider'; 7 | import CartDropdown from '../CartDropdown'; 8 | import * as S from './CartIcon.styled'; 9 | 10 | const CartIcon = () => { 11 | const [isOpen, setIsOpen] = useState(false); 12 | const { 13 | cart: { items }, 14 | } = useCart(); 15 | 16 | return ( 17 | <> 18 | setIsOpen(true)}> 19 | 20 | {!!items.length && {items.length}} 21 | 22 | setIsOpen(false)} /> 23 | > 24 | ); 25 | }; 26 | 27 | export default CartIcon; 28 | -------------------------------------------------------------------------------- /src/frontend/pages/api/products/[productId]/index.ts: -------------------------------------------------------------------------------- 1 | // Copyright The OpenTelemetry Authors 2 | // SPDX-License-Identifier: Apache-2.0 3 | 4 | import type { NextApiRequest, NextApiResponse } from 'next'; 5 | import InstrumentationMiddleware from '../../../../utils/telemetry/InstrumentationMiddleware'; 6 | import { Empty, Product } from '../../../../protos/demo'; 7 | import ProductCatalogService from '../../../../services/ProductCatalog.service'; 8 | 9 | type TResponse = Product | Empty; 10 | 11 | const handler = async ({ method, query }: NextApiRequest, res: NextApiResponse) => { 12 | switch (method) { 13 | case 'GET': { 14 | const { productId = '', currencyCode = '' } = query; 15 | const product = await ProductCatalogService.getProduct(productId as string, currencyCode as string); 16 | 17 | return res.status(200).json(product); 18 | } 19 | 20 | default: { 21 | return res.status(405).send(''); 22 | } 23 | } 24 | }; 25 | 26 | export default InstrumentationMiddleware(handler); 27 | -------------------------------------------------------------------------------- /src/frontend/components/Recommendations/Recommendations.tsx: -------------------------------------------------------------------------------- 1 | // Copyright The OpenTelemetry Authors 2 | // SPDX-License-Identifier: Apache-2.0 3 | 4 | import { CypressFields } from '../../utils/enums/CypressFields'; 5 | import { useAd } from '../../providers/Ad.provider'; 6 | import ProductCard from '../ProductCard'; 7 | import * as S from './Recommendations.styled'; 8 | 9 | const Recommendations = () => { 10 | const { recommendedProductList } = useAd(); 11 | 12 | if (!recommendedProductList || recommendedProductList.length === 0) { 13 | return null; 14 | } 15 | 16 | return ( 17 | 18 | 19 | You May Also Like 20 | 21 | 22 | {recommendedProductList.map(product => ( 23 | 24 | ))} 25 | 26 | 27 | ); 28 | }; 29 | 30 | export default Recommendations; 31 | -------------------------------------------------------------------------------- /src/frontend/styles/style.d.ts: -------------------------------------------------------------------------------- 1 | // Copyright The OpenTelemetry Authors 2 | // SPDX-License-Identifier: Apache-2.0 3 | 4 | import 'styled-components'; 5 | 6 | declare module 'styled-components' { 7 | export interface DefaultTheme { 8 | colors: { 9 | otelBlue: string; 10 | otelYellow: string; 11 | otelGray: string; 12 | otelRed: string; 13 | backgroundGray: string; 14 | lightBorderGray: string; 15 | borderGray: string; 16 | textGray: string; 17 | textLightGray: string; 18 | white: string; 19 | }; 20 | sizes: { 21 | mLarge: string; 22 | mxLarge: string; 23 | mMedium: string; 24 | mSmall: string; 25 | dLarge: string; 26 | dxLarge: string; 27 | dMedium: string; 28 | dSmall: string; 29 | nano: string; 30 | }; 31 | breakpoints: { 32 | desktop: string; 33 | }; 34 | fonts: { 35 | bold: string; 36 | regular: string; 37 | semiBold: string; 38 | light: string; 39 | }; 40 | } 41 | } 42 | -------------------------------------------------------------------------------- /src/ad/README.md: -------------------------------------------------------------------------------- 1 | # Ad Service 2 | 3 | The Ad service provides advertisement based on context keys. If no context keys 4 | are provided then it returns random ads. 5 | 6 | ## Building Locally 7 | 8 | The Ad service requires at least JDK 21 to build and uses gradlew to 9 | compile/install/distribute. Gradle wrapper is already part of the source code. 10 | To build Ad Service, run: 11 | 12 | ```sh 13 | ./gradlew installDist 14 | ``` 15 | 16 | It will create an executable script 17 | `src/ad/build/install/oteldemo/bin/Ad`. 18 | 19 | To run the Ad Service: 20 | 21 | ```sh 22 | export AD_PORT=8080 23 | export FEATURE_FLAG_GRPC_SERVICE_ADDR=featureflagservice:50053 24 | ./build/install/opentelemetry-demo-ad/bin/Ad 25 | ``` 26 | 27 | ### Upgrading Gradle 28 | 29 | If you need to upgrade the version of gradle then run 30 | 31 | ```sh 32 | ./gradlew wrapper --gradle-version 33 | ``` 34 | 35 | ## Building Docker 36 | 37 | From the root of `opentelemetry-demo`, run: 38 | 39 | ```sh 40 | docker build --file ./src/ad/Dockerfile ./ 41 | ``` 42 | -------------------------------------------------------------------------------- /src/flagd-ui/lib/flagd_ui_web/gettext.ex: -------------------------------------------------------------------------------- 1 | # Copyright The OpenTelemetry Authors 2 | # SPDX-License-Identifier: Apache-2.0 3 | 4 | defmodule FlagdUiWeb.Gettext do 5 | @moduledoc """ 6 | A module providing Internationalization with a gettext-based API. 7 | 8 | By using [Gettext](https://hexdocs.pm/gettext), your module compiles translations 9 | that you can use in your application. To use this Gettext backend module, 10 | call `use Gettext` and pass it as an option: 11 | 12 | use Gettext, backend: FlagdUiWeb.Gettext 13 | 14 | # Simple translation 15 | gettext("Here is the string to translate") 16 | 17 | # Plural translation 18 | ngettext("Here is the string to translate", 19 | "Here are the strings to translate", 20 | 3) 21 | 22 | # Domain-based translation 23 | dgettext("errors", "Here is the error message to translate") 24 | 25 | See the [Gettext Docs](https://hexdocs.pm/gettext) for detailed usage. 26 | """ 27 | use Gettext.Backend, otp_app: :flagd_ui 28 | end 29 | -------------------------------------------------------------------------------- /src/frontend/gateways/Session.gateway.ts: -------------------------------------------------------------------------------- 1 | // Copyright The OpenTelemetry Authors 2 | // SPDX-License-Identifier: Apache-2.0 3 | 4 | import { v4 } from 'uuid'; 5 | 6 | interface ISession { 7 | userId: string; 8 | currencyCode: string; 9 | } 10 | 11 | const sessionKey = 'session'; 12 | const defaultSession = { 13 | userId: v4(), 14 | currencyCode: 'USD', 15 | }; 16 | 17 | const SessionGateway = () => ({ 18 | getSession(): ISession { 19 | if (typeof window === 'undefined') return defaultSession; 20 | const sessionString = localStorage.getItem(sessionKey); 21 | 22 | if (!sessionString) localStorage.setItem(sessionKey, JSON.stringify(defaultSession)); 23 | 24 | return JSON.parse(sessionString || JSON.stringify(defaultSession)) as ISession; 25 | }, 26 | setSessionValue(key: K, value: ISession[K]) { 27 | const session = this.getSession(); 28 | 29 | localStorage.setItem(sessionKey, JSON.stringify({ ...session, [key]: value })); 30 | }, 31 | }); 32 | 33 | export default SessionGateway(); 34 | -------------------------------------------------------------------------------- /src/frontend/components/Recommendations/Recommendations.styled.ts: -------------------------------------------------------------------------------- 1 | // Copyright The OpenTelemetry Authors 2 | // SPDX-License-Identifier: Apache-2.0 3 | 4 | import styled from 'styled-components'; 5 | 6 | export const Recommendations = styled.section` 7 | display: flex; 8 | margin: 40px 0; 9 | align-items: center; 10 | flex-direction: column; 11 | `; 12 | 13 | export const ProductList = styled.div` 14 | display: flex; 15 | width: 100%; 16 | padding: 0 20px; 17 | flex-direction: column; 18 | gap: 24px; 19 | 20 | ${({ theme }) => theme.breakpoints.desktop} { 21 | display: grid; 22 | grid-template-columns: 1fr 1fr 1fr 1fr; 23 | } 24 | `; 25 | 26 | export const TitleContainer = styled.div` 27 | border-top: 1px dashed; 28 | padding: 40px 0; 29 | text-align: center; 30 | width: 100%; 31 | `; 32 | 33 | export const Title = styled.h3` 34 | font-size: ${({ theme }) => theme.sizes.mLarge}; 35 | 36 | ${({ theme }) => theme.breakpoints.desktop} { 37 | font-size: ${({ theme }) => theme.sizes.dLarge}; 38 | } 39 | `; 40 | -------------------------------------------------------------------------------- /src/frontend/styles/Theme.ts: -------------------------------------------------------------------------------- 1 | // Copyright The OpenTelemetry Authors 2 | // SPDX-License-Identifier: Apache-2.0 3 | 4 | import { DefaultTheme } from 'styled-components'; 5 | 6 | const Theme: DefaultTheme = { 7 | colors: { 8 | otelBlue: '#5262A8', 9 | otelYellow: '#EAAA3B', 10 | otelGray: '#403F4B', 11 | otelRed: '#FB7181', 12 | backgroundGray: 'rgba(64, 63, 75, 0.1)', 13 | lightBorderGray: 'rgba(82, 98, 168, 0.3)', 14 | borderGray: '#2E2437', 15 | textGray: '#29293E', 16 | textLightGray: '#78788C', 17 | white: '#FFFFFF', 18 | }, 19 | breakpoints: { 20 | desktop: '@media (min-width: 768px)', 21 | }, 22 | sizes: { 23 | mxLarge: '22px', 24 | mLarge: '20px', 25 | mMedium: '14px', 26 | mSmall: '12px', 27 | dxLarge: '58px', 28 | dLarge: '40px', 29 | dMedium: '18px', 30 | dSmall: '16px', 31 | nano: '8px', 32 | }, 33 | fonts: { 34 | bold: '800', 35 | regular: '500', 36 | semiBold: '700', 37 | light: '400', 38 | }, 39 | }; 40 | 41 | export default Theme; 42 | -------------------------------------------------------------------------------- /src/recommendation/Dockerfile: -------------------------------------------------------------------------------- 1 | # Copyright The OpenTelemetry Authors 2 | # SPDX-License-Identifier: Apache-2.0 3 | 4 | 5 | FROM docker.io/library/python:3.12-alpine3.22 AS build-venv 6 | 7 | RUN apk update && \ 8 | apk add gcc g++ linux-headers 9 | 10 | COPY ./src/recommendation/requirements.txt requirements.txt 11 | 12 | RUN python -m venv venv && \ 13 | venv/bin/pip install --no-cache-dir -r requirements.txt 14 | 15 | RUN venv/bin/opentelemetry-bootstrap -a install 16 | 17 | FROM docker.io/library/python:3.12-alpine3.22 18 | 19 | COPY --from=build-venv /venv/ /venv/ 20 | 21 | WORKDIR /app 22 | 23 | COPY ./src/recommendation/demo_pb2_grpc.py demo_pb2_grpc.py 24 | COPY ./src/recommendation/demo_pb2.py demo_pb2.py 25 | COPY ./src/recommendation/logger.py logger.py 26 | COPY ./src/recommendation/metrics.py metrics.py 27 | COPY ./src/recommendation/recommendation_server.py recommendation_server.py 28 | 29 | EXPOSE ${RECOMMENDATION_PORT} 30 | ENTRYPOINT [ "/venv/bin/opentelemetry-instrument", "/venv/bin/python", "recommendation_server.py" ] 31 | -------------------------------------------------------------------------------- /src/flagd-ui/.gitignore: -------------------------------------------------------------------------------- 1 | # The directory Mix will write compiled artifacts to. 2 | /_build/ 3 | 4 | # If you run "mix test --cover", coverage assets end up here. 5 | /cover/ 6 | 7 | # The directory Mix downloads your dependencies sources to. 8 | /deps/ 9 | 10 | # Where 3rd-party dependencies like ExDoc output generated docs. 11 | /doc/ 12 | 13 | # Ignore .fetch files in case you like to edit your project deps locally. 14 | /.fetch 15 | 16 | # If the VM crashes, it generates a dump, let's ignore it too. 17 | erl_crash.dump 18 | 19 | # Also ignore archive artifacts (built via "mix archive.build"). 20 | *.ez 21 | 22 | # Temporary files, for example, from tests. 23 | /tmp/ 24 | 25 | # Ignore package tarball (built via "mix hex.build"). 26 | flagd_ui-*.tar 27 | 28 | # Ignore assets that are produced by build tools. 29 | /priv/static/assets/ 30 | 31 | # Ignore digested assets cache. 32 | /priv/static/cache_manifest.json 33 | 34 | # In case you use Node.js/npm, you want to ignore these. 35 | npm-debug.log 36 | /assets/node_modules/ 37 | 38 | demo.flagd.json 39 | /data 40 | -------------------------------------------------------------------------------- /src/frontend/utils/telemetry/SessionIdProcessor.ts: -------------------------------------------------------------------------------- 1 | // Copyright The OpenTelemetry Authors 2 | // SPDX-License-Identifier: Apache-2.0 3 | 4 | import { Context } from "@opentelemetry/api"; 5 | import { ReadableSpan, Span, SpanProcessor } from "@opentelemetry/sdk-trace-web"; 6 | import SessionGateway from "../../gateways/Session.gateway"; 7 | import { AttributeNames } from "../enums/AttributeNames"; 8 | 9 | const { userId } = SessionGateway.getSession(); 10 | 11 | export class SessionIdProcessor implements SpanProcessor { 12 | forceFlush(): Promise { 13 | return Promise.resolve(); 14 | } 15 | 16 | // eslint-disable-next-line @typescript-eslint/no-unused-vars 17 | onStart(span: Span, parentContext: Context): void { 18 | span.setAttribute(AttributeNames.SESSION_ID, userId); 19 | } 20 | 21 | // eslint-disable-next-line @typescript-eslint/no-unused-vars, @typescript-eslint/no-empty-function 22 | onEnd(span: ReadableSpan): void {} 23 | 24 | shutdown(): Promise { 25 | return Promise.resolve(); 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /src/product-reviews/Dockerfile: -------------------------------------------------------------------------------- 1 | # Copyright The OpenTelemetry Authors 2 | # SPDX-License-Identifier: Apache-2.0 3 | 4 | 5 | FROM docker.io/library/python:3.12-alpine3.22 AS build-venv 6 | 7 | RUN apk update && \ 8 | apk add gcc g++ linux-headers 9 | 10 | COPY ./src/product-reviews/requirements.txt requirements.txt 11 | 12 | RUN python -m venv venv && \ 13 | venv/bin/pip install --no-cache-dir -r requirements.txt 14 | 15 | RUN venv/bin/opentelemetry-bootstrap -a install 16 | 17 | FROM docker.io/library/python:3.12-alpine3.22 18 | 19 | COPY --from=build-venv /venv/ /venv/ 20 | 21 | WORKDIR /app 22 | 23 | COPY ./src/product-reviews/demo_pb2_grpc.py demo_pb2_grpc.py 24 | COPY ./src/product-reviews/demo_pb2.py demo_pb2.py 25 | COPY ./src/product-reviews/product_reviews_server.py product_reviews_server.py 26 | COPY ./src/product-reviews/database.py database.py 27 | COPY ./src/product-reviews/metrics.py metrics.py 28 | 29 | 30 | EXPOSE ${PRODUCT_REVIEWS_PORT} 31 | ENTRYPOINT [ "/venv/bin/opentelemetry-instrument", "/venv/bin/python", "product_reviews_server.py" ] 32 | -------------------------------------------------------------------------------- /src/react-native-app/components/EmptyCart/EmptyCart.tsx: -------------------------------------------------------------------------------- 1 | // Copyright The OpenTelemetry Authors 2 | // SPDX-License-Identifier: Apache-2.0 3 | /** 4 | * Copied with modification from src/frontend/components/Cart/EmptyCart.tsx 5 | */ 6 | import { ThemedView } from "@/components/ThemedView"; 7 | import { ThemedText } from "@/components/ThemedText"; 8 | import { StyleSheet } from "react-native"; 9 | 10 | const EmptyCart = () => { 11 | return ( 12 | 13 | 14 | Your shopping cart is empty! 15 | 16 | 17 | Items you add to your shopping cart will appear here. 18 | 19 | 20 | ); 21 | }; 22 | 23 | export default EmptyCart; 24 | 25 | const styles = StyleSheet.create({ 26 | container: { 27 | flex: 1, 28 | justifyContent: "center", 29 | alignItems: "center", 30 | }, 31 | header: { 32 | fontSize: 20, 33 | }, 34 | subHeader: { 35 | fontSize: 14, 36 | }, 37 | }); 38 | -------------------------------------------------------------------------------- /test/tracetesting/recommendation/list.yaml: -------------------------------------------------------------------------------- 1 | # Copyright The OpenTelemetry Authors 2 | # SPDX-License-Identifier: Apache-2.0 3 | 4 | type: Test 5 | spec: 6 | id: recommendation-list 7 | name: 'Recommendation: List products' 8 | description: List all products recommended to an user 9 | trigger: 10 | type: grpc 11 | grpc: 12 | protobufFile: ../../../pb/demo.proto 13 | address: ${var:RECOMMENDATION_ADDR} 14 | method: oteldemo.RecommendationService.ListRecommendations 15 | request: |- 16 | { 17 | "userId": "1234", 18 | "productIds": [ "OLJCESPC7Z", "66VCHSJNUP", "1YMWWN1N4O", "L9ECAV7KIM", "2ZYFJ3GM2N" ] 19 | } 20 | specs: 21 | - name: It called ListRecommendations correctly and got 5 products 22 | selector: span[tracetest.span.type="rpc" name="/oteldemo.RecommendationService/ListRecommendations" rpc.system="grpc" rpc.method="ListRecommendations" rpc.service="oteldemo.RecommendationService"] 23 | assertions: 24 | - attr:rpc.grpc.status_code = 0 25 | - attr:app.products_recommended.count = 5 26 | -------------------------------------------------------------------------------- /src/frontend/pages/api/product-reviews/[productId]/index.ts: -------------------------------------------------------------------------------- 1 | // Copyright The OpenTelemetry Authors 2 | // SPDX-License-Identifier: Apache-2.0 3 | 4 | import type { NextApiRequest, NextApiResponse } from 'next'; 5 | import InstrumentationMiddleware from '../../../../utils/telemetry/InstrumentationMiddleware'; 6 | import { Empty, ProductReview } from '../../../../protos/demo'; 7 | import ProductReviewService from '../../../../services/ProductReview.service'; 8 | 9 | type TResponse = ProductReview[] | Empty; 10 | 11 | const handler = async ({ method, query }: NextApiRequest, res: NextApiResponse) => { 12 | 13 | switch (method) { 14 | case 'GET': { 15 | const { productId = '' } = query; 16 | 17 | const productReviews = await ProductReviewService.getProductReviews(productId as string); 18 | 19 | return res.status(200).json(productReviews); 20 | } 21 | 22 | default: { 23 | return res.status(405).send(''); 24 | } 25 | } 26 | }; 27 | 28 | export default InstrumentationMiddleware(handler); 29 | -------------------------------------------------------------------------------- /src/react-native-app/android/settings.gradle: -------------------------------------------------------------------------------- 1 | rootProject.name = 'reactnativeapp' 2 | 3 | dependencyResolutionManagement { 4 | versionCatalogs { 5 | reactAndroidLibs { 6 | from(files(new File(["node", "--print", "require.resolve('react-native/package.json')"].execute(null, rootDir).text.trim(), "../gradle/libs.versions.toml"))) 7 | } 8 | } 9 | } 10 | 11 | apply from: new File(["node", "--print", "require.resolve('expo/package.json')"].execute(null, rootDir).text.trim(), "../scripts/autolinking.gradle"); 12 | useExpoModules() 13 | 14 | apply from: new File(["node", "--print", "require.resolve('@react-native-community/cli-platform-android/package.json', { paths: [require.resolve('react-native/package.json')] })"].execute(null, rootDir).text.trim(), "../native_modules.gradle"); 15 | applyNativeModulesSettingsGradle(settings) 16 | 17 | include ':app' 18 | includeBuild(new File(["node", "--print", "require.resolve('@react-native/gradle-plugin/package.json', { paths: [require.resolve('react-native/package.json')] })"].execute(null, rootDir).text.trim()).getParentFile()) 19 | -------------------------------------------------------------------------------- /test/README.md: -------------------------------------------------------------------------------- 1 | # Service Testing 2 | 3 | The OpenTelemetry Demo uses traced-based testing to validate the 4 | functionality of the services and the traces they generate. 5 | 6 | The trace-based tests will each service and validate the traces they 7 | generate and stored in Jaeger, to a known working trace for the same operation. 8 | 9 | ## Testing services with Trace-based tests 10 | 11 | To run the entire test suite of trace-based tests, run the command: 12 | 13 | ```sh 14 | make run-tracetesting 15 | #or 16 | docker compose run traceBasedTests 17 | ``` 18 | 19 | To run tests for specific services, pass the name of the service as a 20 | parameter (using the folder names located [in the tracetesting directory](./tracetesting/)): 21 | 22 | ```sh 23 | make run-tracetesting SERVICES_TO_TEST="service-1 service-2 ..." 24 | #or 25 | docker compose run traceBasedTests "service-1 service-2 ..." 26 | ``` 27 | 28 | For instance, if you need to run the tests for `ad` and `payment`, you can run 29 | them with: 30 | 31 | ```sh 32 | make run-tracetesting SERVICES_TO_TEST="ad payment" 33 | ``` 34 | -------------------------------------------------------------------------------- /test/tracetesting/product-catalog/list.yaml: -------------------------------------------------------------------------------- 1 | # Copyright The OpenTelemetry Authors 2 | # SPDX-License-Identifier: Apache-2.0 3 | 4 | type: Test 5 | spec: 6 | id: product-list 7 | name: 'Product: List' 8 | description: List all products available on product catalog 9 | trigger: 10 | type: grpc 11 | grpc: 12 | protobufFile: ../../../pb/demo.proto 13 | address: ${var:PRODUCT_CATALOG_ADDR} 14 | method: oteldemo.ProductCatalogService.ListProducts 15 | request: "" 16 | specs: 17 | - name: It queried the product catalog correctly 18 | selector: span[tracetest.span.type="rpc" name="oteldemo.ProductCatalogService/ListProducts" 19 | rpc.system="grpc" rpc.method="ListProducts" rpc.service="oteldemo.ProductCatalogService"] 20 | assertions: 21 | - attr:rpc.grpc.status_code = 0 22 | - attr:app.products.count = 10 23 | - name: It returned products with IDs 24 | selector: span[tracetest.span.type="general" name="Tracetest trigger"] 25 | assertions: 26 | - attr:tracetest.response.body | json_path '$.products[*].id' != "" 27 | -------------------------------------------------------------------------------- /src/frontend/components/CartIcon/CartIcon.styled.ts: -------------------------------------------------------------------------------- 1 | // Copyright The OpenTelemetry Authors 2 | // SPDX-License-Identifier: Apache-2.0 3 | 4 | import Image from 'next/image'; 5 | import styled from 'styled-components'; 6 | 7 | export const CartIcon = styled.a` 8 | position: relative; 9 | display: block; 10 | margin-left: 25px; 11 | display: flex; 12 | flex-flow: column; 13 | align-items: center; 14 | justify-content: center; 15 | cursor: pointer; 16 | `; 17 | 18 | export const Icon = styled(Image).attrs({ 19 | width: '24', 20 | height: '24', 21 | })` 22 | margin-bottom: 3px; 23 | `; 24 | 25 | export const ItemsCount = styled.span` 26 | display: flex; 27 | align-items: center; 28 | justify-content: center; 29 | position: absolute; 30 | top: 9px; 31 | left: 15px; 32 | width: 15px; 33 | height: 15px; 34 | font-size: ${({ theme }) => theme.sizes.nano}; 35 | border-radius: 50%; 36 | border: 1px solid ${({ theme }) => theme.colors.white}; 37 | color: ${({ theme }) => theme.colors.white}; 38 | background: ${({ theme }) => theme.colors.otelRed}; 39 | `; 40 | -------------------------------------------------------------------------------- /src/frontend/pages/api/product-reviews-avg-score/[productId]/index.ts: -------------------------------------------------------------------------------- 1 | // Copyright The OpenTelemetry Authors 2 | // SPDX-License-Identifier: Apache-2.0 3 | 4 | import type { NextApiRequest, NextApiResponse } from 'next'; 5 | import InstrumentationMiddleware from '../../../../utils/telemetry/InstrumentationMiddleware'; 6 | import { Empty, ProductReview } from '../../../../protos/demo'; 7 | import ProductReviewService from '../../../../services/ProductReview.service'; 8 | 9 | type TResponse = string | Empty; 10 | 11 | const handler = async ({ method, query }: NextApiRequest, res: NextApiResponse) => { 12 | 13 | switch (method) { 14 | case 'GET': { 15 | const { productId = '' } = query; 16 | 17 | const averageScore = await ProductReviewService.getAverageProductReviewScore(productId as string); 18 | 19 | return res.status(200).json(averageScore); 20 | } 21 | 22 | default: { 23 | return res.status(405).send(''); 24 | } 25 | } 26 | }; 27 | 28 | export default InstrumentationMiddleware(handler); 29 | -------------------------------------------------------------------------------- /src/product-reviews/README.md: -------------------------------------------------------------------------------- 1 | # Product Reviews Service 2 | 3 | This service returns product reviews for a specific product, along with an 4 | AI-generated summary of the product reviews. 5 | 6 | ## Local Build 7 | 8 | To build the protos, run from the root directory: 9 | 10 | ```sh 11 | make docker-generate-protobuf 12 | ``` 13 | 14 | ## Docker Build 15 | 16 | From the root directory, run: 17 | 18 | ```sh 19 | docker compose build product-reviews 20 | ``` 21 | 22 | ## LLM Configuration 23 | 24 | By default, this service uses a mock LLM service, as configured in 25 | the `.env` file: 26 | 27 | ``` yaml 28 | LLM_BASE_URL=http://${LLM_HOST}:${LLM_PORT}/v1 29 | LLM_MODEL=astronomy-llm 30 | OPENAI_API_KEY=dummy 31 | ``` 32 | 33 | If desired, the configuration can be changed to point to a real, OpenAI API 34 | compatible LLM in the file `.env.override`. For example, the following 35 | configuration can be used to utilize OpenAI's gpt-4o-mini model: 36 | 37 | ``` yaml 38 | LLM_BASE_URL=https://api.openai.com/v1 39 | LLM_MODEL=gpt-4o-mini 40 | OPENAI_API_KEY= 41 | ``` 42 | -------------------------------------------------------------------------------- /test/tracetesting/cart/check-if-cart-is-populated.yaml: -------------------------------------------------------------------------------- 1 | # Copyright The OpenTelemetry Authors 2 | # SPDX-License-Identifier: Apache-2.0 3 | 4 | type: Test 5 | spec: 6 | id: cart-check-if-cart-is-populated 7 | name: 'Cart: check if cart is populated' 8 | description: Check if the shopping cart has one item 9 | trigger: 10 | type: grpc 11 | grpc: 12 | protobufFile: ../../../pb/demo.proto 13 | address: ${var:CART_ADDR} 14 | method: oteldemo.CartService.GetCart 15 | request: |- 16 | { 17 | "userId": "1234" 18 | } 19 | specs: 20 | - name: It retrieved the cart items correctly 21 | selector: span[name="POST /oteldemo.CartService/GetCart"] 22 | assertions: 23 | - attr:grpc.status_code = 0 24 | - name: It returned the first item with correct attributes 25 | selector: span[tracetest.span.type="general" name="Tracetest trigger"] 26 | assertions: 27 | - attr:tracetest.response.body | json_path '$.items[0].quantity' = 1 28 | - attr:tracetest.response.body | json_path '$.items[0].productId' = "OLJCESPC7Z" 29 | -------------------------------------------------------------------------------- /src/react-native-app/app.json: -------------------------------------------------------------------------------- 1 | { 2 | "expo": { 3 | "name": "Astronomy Shop App", 4 | "slug": "astronomyshopapp", 5 | "version": "1.0.0", 6 | "orientation": "portrait", 7 | "icon": "./assets/images/icon.png", 8 | "scheme": "myapp", 9 | "userInterfaceStyle": "automatic", 10 | "splash": { 11 | "image": "./assets/images/splash.png", 12 | "resizeMode": "contain", 13 | "backgroundColor": "#ffffff" 14 | }, 15 | "ios": { 16 | "supportsTablet": true, 17 | "bundleIdentifier": "io.opentelemetry.reactnativeapp" 18 | }, 19 | "android": { 20 | "adaptiveIcon": { 21 | "foregroundImage": "./assets/images/adaptive-icon.png", 22 | "backgroundColor": "#ffffff" 23 | }, 24 | "package": "io.opentelemetry.reactnativeapp" 25 | }, 26 | "web": { 27 | "bundler": "metro", 28 | "output": "static", 29 | "favicon": "./assets/images/favicon.png" 30 | }, 31 | "plugins": [ 32 | "expo-router" 33 | ], 34 | "experiments": { 35 | "typedRoutes": true 36 | } 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /test/tracetesting/ad/get.yaml: -------------------------------------------------------------------------------- 1 | # Copyright The OpenTelemetry Authors 2 | # SPDX-License-Identifier: Apache-2.0 3 | 4 | type: Test 5 | spec: 6 | id: ad-get-ads 7 | name: 'Ad: get' 8 | description: Get Ads from API 9 | trigger: 10 | type: grpc 11 | grpc: 12 | protobufFile: ../../../pb/demo.proto 13 | address: ${var:AD_ADDR} 14 | method: oteldemo.AdService.GetAds 15 | request: |- 16 | { 17 | "contextKeys": [ "galaxy", "telescope" ] 18 | } 19 | specs: 20 | - name: It returns two ads 21 | selector: span[tracetest.span.type="rpc" name="oteldemo.AdService/GetAds" rpc.system="grpc" rpc.method="GetAds" rpc.service="oteldemo.AdService"] 22 | assertions: 23 | - attr:app.ads.count = 2 24 | - name: It returns a valid redirectUrl for each ads 25 | selector: span[tracetest.span.type="general" name="Tracetest trigger"] 26 | assertions: 27 | - attr:tracetest.response.body | json_path '$.ads[0].redirectUrl' contains "/product/" 28 | - attr:tracetest.response.body | json_path '$.ads[1].redirectUrl' contains "/product/" 29 | -------------------------------------------------------------------------------- /src/react-native-app/utils/SessionIdProcessor.ts: -------------------------------------------------------------------------------- 1 | // Copyright The OpenTelemetry Authors 2 | // SPDX-License-Identifier: Apache-2.0 3 | /** 4 | * Copied with modification from src/frontend/utils/telemetry/SessionIdProcessor.ts 5 | */ 6 | import { Context } from "@opentelemetry/api"; 7 | import { 8 | ReadableSpan, 9 | Span, 10 | SpanProcessor, 11 | } from "@opentelemetry/sdk-trace-web"; 12 | import SessionGateway from "@/gateways/Session.gateway"; 13 | 14 | export class SessionIdProcessor implements SpanProcessor { 15 | forceFlush(): Promise { 16 | return Promise.resolve(); 17 | } 18 | 19 | // eslint-disable-next-line @typescript-eslint/no-unused-vars 20 | onStart(span: Span, parentContext: Context): void { 21 | SessionGateway.getSession().then(({ userId }) => { 22 | span.setAttribute("session.id", userId); 23 | }); 24 | } 25 | 26 | // eslint-disable-next-line @typescript-eslint/no-unused-vars, @typescript-eslint/no-empty-function 27 | onEnd(span: ReadableSpan): void {} 28 | 29 | shutdown(): Promise { 30 | return Promise.resolve(); 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /test/tracetesting/currency/supported.yaml: -------------------------------------------------------------------------------- 1 | # Copyright The OpenTelemetry Authors 2 | # SPDX-License-Identifier: Apache-2.0 3 | 4 | type: Test 5 | spec: 6 | id: currency-supported 7 | name: 'Currency: Supported' 8 | description: Get all supported currencies 9 | trigger: 10 | type: grpc 11 | grpc: 12 | protobufFile: ../../../pb/demo.proto 13 | address: ${var:CURRENCY_ADDR} 14 | method: oteldemo.CurrencyService.GetSupportedCurrencies 15 | specs: 16 | - name: It has a span called "Currency/GetSupportedCurrencies" 17 | selector: span[tracetest.span.type="rpc" name="Currency/GetSupportedCurrencies" 18 | rpc.system="grpc" rpc.method="GetSupportedCurrencies" rpc.service="oteldemo.CurrencyService"] 19 | assertions: 20 | - attr:name = "Currency/GetSupportedCurrencies" 21 | - name: It returns the expected currency codes 22 | selector: span[tracetest.span.type="general" name="Tracetest trigger"] 23 | assertions: 24 | - attr:tracetest.response.body | json_path '$.currencyCodes[0]' = "ZAR" 25 | - attr:tracetest.response.body | json_path '$.currencyCodes[32]' = "MYR" 26 | -------------------------------------------------------------------------------- /src/flagd-ui/config/test.exs: -------------------------------------------------------------------------------- 1 | # Copyright The OpenTelemetry Authors 2 | # SPDX-License-Identifier: Apache-2.0 3 | 4 | import Config 5 | 6 | # We don't run a server during test. If one is required, 7 | # you can enable the server option below. 8 | config :flagd_ui, FlagdUiWeb.Endpoint, 9 | url: [path: "/"], 10 | http: [ip: {127, 0, 0, 1}, port: 4002], 11 | secret_key_base: "7WKq9+4aRwQEUAE69h03WLZKqkUmgMOlrrXvsq28ZvKNK9HSinOQ3ZBcnUG/eSgb", 12 | server: false 13 | 14 | # In test we don't send emails 15 | config :flagd_ui, FlagdUi.Mailer, adapter: Swoosh.Adapters.Test 16 | 17 | # Disable swoosh api client as it is only required for production adapters 18 | config :swoosh, :api_client, false 19 | 20 | # Print only warnings and errors during test 21 | config :logger, level: :warning 22 | 23 | # Initialize plugs at runtime for faster test compilation 24 | config :phoenix, :plug_init_mode, :runtime 25 | 26 | # Enable helpful, but potentially expensive runtime checks 27 | config :phoenix_live_view, 28 | enable_expensive_runtime_checks: true 29 | 30 | config :flagd_ui, storage_file_path: "./test/fixtures/demo.flagd.json" 31 | -------------------------------------------------------------------------------- /src/shipping/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "shipping" 3 | edition = "2021" 4 | 5 | [[bin]] 6 | name = "shipping" 7 | path = "src/main.rs" 8 | 9 | [dependencies] 10 | actix-web = "4" 11 | anyhow = "1.0.100" 12 | awc = { version = "3.8.1", default-features = false, features = ["compress-zstd"] } 13 | serde = { version = "1.0.228", features = ["derive"] } 14 | tonic = "0.14.2" 15 | tracing = "0.1.43" 16 | tracing-subscriber = { version = "0.3.22", features = ["env-filter"] } 17 | 18 | opentelemetry = "0.31.0" 19 | opentelemetry_sdk = "0.31.0" 20 | opentelemetry-otlp = { version = "0.31.0", features = ["grpc-tonic"] } 21 | opentelemetry-instrumentation-actix-web = { version = "0.23.0", features = ["sync-middleware", "awc", "metrics"] } 22 | opentelemetry-appender-tracing = "0.31.1" 23 | opentelemetry-resource-detectors = "0.10.0" 24 | 25 | [dependencies.uuid] 26 | version = "1.19.0" 27 | features = [ 28 | "v4", # Lets you generate random UUIDs 29 | "fast-rng", # Use a faster (but still sufficiently random) RNG 30 | "macro-diagnostics", # Enable better diagnostics for compile-time UUIDs 31 | ] 32 | -------------------------------------------------------------------------------- /src/kafka/Dockerfile: -------------------------------------------------------------------------------- 1 | # Copyright The OpenTelemetry Authors 2 | # SPDX-License-Identifier: Apache-2.0 3 | 4 | 5 | FROM apache/kafka:3.9.1 6 | 7 | USER root 8 | ARG OTEL_JAVA_AGENT_VERSION 9 | 10 | USER appuser 11 | 12 | ADD --chown=appuser:appuser https://github.com/open-telemetry/opentelemetry-java-instrumentation/releases/download/v$OTEL_JAVA_AGENT_VERSION/opentelemetry-javaagent.jar /tmp/opentelemetry-javaagent.jar 13 | 14 | ENV KAFKA_CONTROLLER_LISTENER_NAMES=CONTROLLER 15 | ENV KAFKA_LISTENER_SECURITY_PROTOCOL_MAP=CONTROLLER:PLAINTEXT,PLAINTEXT:PLAINTEXT 16 | ENV KAFKA_GROUP_INITIAL_REBALANCE_DELAY_MS=0 17 | ENV KAFKA_PROCESS_ROLES=controller,broker 18 | ENV KAFKA_NODE_ID=1 19 | ENV KAFKA_METADATA_LOG_SEGMENT_MS=15000 20 | ENV KAFKA_METADATA_MAX_RETENTION_MS=60000 21 | ENV KAFKA_METADATA_LOG_MAX_RECORD_BYTES_BETWEEN_SNAPSHOTS=2800 22 | ENV KAFKA_AUTO_CREATE_TOPICS_ENABLE=true 23 | ENV KAFKA_OFFSETS_TOPIC_REPLICATION_FACTOR=1 24 | ENV KAFKA_TRANSACTION_STATE_LOG_REPLICATION_FACTOR=1 25 | ENV KAFKA_OPTS="-javaagent:/tmp/opentelemetry-javaagent.jar -Dotel.jmx.target.system=kafka-broker" 26 | ENV CLUSTER_ID=ckjPoprWQzOf0-FuNkGfFQ 27 | -------------------------------------------------------------------------------- /src/frontend/utils/imageLoader.js: -------------------------------------------------------------------------------- 1 | // Copyright The OpenTelemetry Authors 2 | // SPDX-License-Identifier: Apache-2.0 3 | /* 4 | * We connect to image-provider through the envoy proxy, straight from the browser, for this we need to know the current hostname and port. 5 | * During building and serverside rendering, these are undefined so we use some conditionals and default values. 6 | */ 7 | let hostname = "localhost"; 8 | let port = 8080; 9 | let protocol = "http"; 10 | 11 | if (typeof window !== "undefined" && window.location) { 12 | hostname = window.location.hostname; 13 | port = window.location.port ? parseInt(window.location.port, 10) : (window.location.protocol === "https:" ? 443 : 80); 14 | protocol = window.location.protocol.slice(0, -1); // Remove trailing ':' 15 | } 16 | 17 | export default function imageLoader({ src, width, quality }) { 18 | // We pass down the optimisation request to the image-provider service here, without this, nextJs would try to use internal optimiser which is not working with the external image-provider. 19 | return `${protocol}://${hostname}:${port}/${src}?w=${width}&q=${quality || 75}` 20 | } 21 | -------------------------------------------------------------------------------- /src/jaeger/nginx.conf.template: -------------------------------------------------------------------------------- 1 | pid /tmp/nginx.pid; 2 | 3 | events { 4 | worker_connections 1024; 5 | } 6 | 7 | http { 8 | include mime.types; 9 | sendfile on; 10 | server { 11 | listen ${JAEGER_UI_PORT}; 12 | listen [::]:${JAEGER_UI_PORT}; 13 | 14 | server_name _; 15 | 16 | location /status { 17 | stub_status on; 18 | access_log on; 19 | allow all; 20 | } 21 | 22 | location /jaeger/api { 23 | proxy_pass http://victoriatraces:10428/select/jaeger/api; 24 | } 25 | 26 | location /jaeger/static/ { 27 | alias /ui/static/; 28 | } 29 | 30 | location /api { 31 | proxy_pass http://victoriatraces:10428/select/jaeger/api; 32 | } 33 | 34 | location /static/ { 35 | root /ui; 36 | } 37 | 38 | location /jaeger { 39 | root /ui; 40 | try_files $uri $uri/ /index.html; 41 | } 42 | 43 | location / { 44 | root /ui; 45 | try_files $uri $uri/ /index.html; 46 | } 47 | } 48 | } 49 | -------------------------------------------------------------------------------- /src/frontend/pages/api/product-ask-ai-assistant/[productId]/index.ts: -------------------------------------------------------------------------------- 1 | // Copyright The OpenTelemetry Authors 2 | // SPDX-License-Identifier: Apache-2.0 3 | 4 | import type { NextApiRequest, NextApiResponse } from 'next'; 5 | import InstrumentationMiddleware from '../../../../utils/telemetry/InstrumentationMiddleware'; 6 | import {AddItemRequest, Empty} from '../../../../protos/demo'; 7 | import ProductReviewService from '../../../../services/ProductReview.service'; 8 | 9 | type TResponse = string | Empty; 10 | 11 | const handler = async ({ method, body, query }: NextApiRequest, res: NextApiResponse) => { 12 | 13 | switch (method) { 14 | case 'POST': { 15 | const { productId = '' } = query; 16 | const { question } = body ; 17 | 18 | const response = await ProductReviewService.askProductAIAssistant(productId as string, question as string); 19 | 20 | return res.status(200).json(response); 21 | } 22 | 23 | default: { 24 | return res.status(405).send(''); 25 | } 26 | } 27 | }; 28 | 29 | export default InstrumentationMiddleware(handler); 30 | -------------------------------------------------------------------------------- /src/frontend/utils/enums/CypressFields.ts: -------------------------------------------------------------------------------- 1 | // Copyright The OpenTelemetry Authors 2 | // SPDX-License-Identifier: Apache-2.0 3 | 4 | export enum CypressFields { 5 | Ad = 'ad', 6 | CartDropdown = 'cart-dropdown', 7 | CartDropdownItem = 'cart-dropdown-item', 8 | CartDropdownItemQuantity = 'cart-dropdown-item-quantity', 9 | CartGoToShopping = 'cart-go-to-shopping', 10 | CartIcon = 'cart-icon', 11 | CartItemCount = 'cart-item-count', 12 | CheckoutPlaceOrder = 'checkout-place-order', 13 | CheckoutItem = 'checkout-item', 14 | CurrencySwitcher = 'currency-switcher', 15 | SessionId = 'session-id', 16 | ProductCard = 'product-card', 17 | ProductList = 'product-list', 18 | ProductPrice = 'product-price', 19 | ProductReviews = 'product-reviews', 20 | RecommendationList = 'recommendation-list', 21 | HomePage = 'home-page', 22 | ProductDetail = 'product-detail', 23 | HotProducts = 'hot-products', 24 | ProductPicture = 'product-picture', 25 | ProductName = 'product-name', 26 | ProductDescription = 'product-description', 27 | ProductQuantity = 'product-quantity', 28 | ProductAddToCart = 'product-add-to-cart', 29 | } 30 | -------------------------------------------------------------------------------- /src/accounting/Helpers.cs: -------------------------------------------------------------------------------- 1 | // Copyright The OpenTelemetry Authors 2 | // SPDX-License-Identifier: Apache-2.0 3 | 4 | using System.Collections; 5 | 6 | namespace Accounting 7 | { 8 | internal static class Helpers 9 | { 10 | private static List RelevantPrefixes = ["DOTNET_", "CORECLR_", "OTEL_", "KAFKA_"]; 11 | 12 | public static IEnumerable FilterRelevant(this IDictionary envs) 13 | { 14 | foreach (DictionaryEntry env in envs) 15 | { 16 | foreach (var prefix in RelevantPrefixes) 17 | { 18 | if (env.Key.ToString()?.StartsWith(prefix, StringComparison.InvariantCultureIgnoreCase) ?? false) 19 | { 20 | yield return env; 21 | } 22 | } 23 | } 24 | } 25 | 26 | public static void OutputInOrder(this IEnumerable envs) 27 | { 28 | foreach (var env in envs.OrderBy(x => x.Key)) 29 | { 30 | Console.WriteLine(env); 31 | } 32 | } 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /src/frontend/gateways/rpc/Cart.gateway.ts: -------------------------------------------------------------------------------- 1 | // Copyright The OpenTelemetry Authors 2 | // SPDX-License-Identifier: Apache-2.0 3 | 4 | import { ChannelCredentials } from '@grpc/grpc-js'; 5 | import { Cart, CartItem, CartServiceClient, Empty } from '../../protos/demo'; 6 | 7 | const { CART_ADDR = '' } = process.env; 8 | 9 | const client = new CartServiceClient(CART_ADDR, ChannelCredentials.createInsecure()); 10 | 11 | const CartGateway = () => ({ 12 | getCart(userId: string) { 13 | return new Promise((resolve, reject) => 14 | client.getCart({ userId }, (error, response) => (error ? reject(error) : resolve(response))) 15 | ); 16 | }, 17 | addItem(userId: string, item: CartItem) { 18 | return new Promise((resolve, reject) => 19 | client.addItem({ userId, item }, (error, response) => (error ? reject(error) : resolve(response))) 20 | ); 21 | }, 22 | emptyCart(userId: string) { 23 | return new Promise((resolve, reject) => 24 | client.emptyCart({ userId }, (error, response) => (error ? reject(error) : resolve(response))) 25 | ); 26 | }, 27 | }); 28 | 29 | export default CartGateway(); 30 | -------------------------------------------------------------------------------- /src/quote/composer.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "openteletry-demo/quote", 3 | "description": "Quote Service part of OpenTelemetry Demo", 4 | "license": "Apache-2.0", 5 | "require": { 6 | "php": ">= 8.3", 7 | "ext-json": "*", 8 | "ext-pcntl": "*", 9 | "monolog/monolog": "3.9.0", 10 | "open-telemetry/api": "1.7.1", 11 | "open-telemetry/sdk": "1.10.0", 12 | "open-telemetry/exporter-otlp": "1.3.3", 13 | "open-telemetry/opentelemetry-auto-slim": "1.3.0", 14 | "open-telemetry/detector-container": "1.1.0", 15 | "open-telemetry/opentelemetry-logger-monolog": "1.1.0", 16 | "guzzlehttp/guzzle": "7.10.0", 17 | "php-di/php-di": "7.1.1", 18 | "php-di/slim-bridge": "3.4.1", 19 | "php-http/guzzle7-adapter": "1.1.0", 20 | "react/http": "v1.11.0", 21 | "slim/psr7": "1.8.0", 22 | "slim/slim": "4.15.1" 23 | }, 24 | "autoload": { 25 | "psr-4": { 26 | "App\\": "src/" 27 | } 28 | }, 29 | "config": { 30 | "allow-plugins": { 31 | "php-http/discovery": false 32 | } 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /src/quote/README.md: -------------------------------------------------------------------------------- 1 | # Quote Service 2 | 3 | The Quote Service calculates the shipping costs, 4 | based on the number of items to be shipped. 5 | 6 | It is a PHP based service, using a combination of automatic and manual instrumentation. 7 | 8 | ## Docker Build 9 | 10 | To build the quote service, run the following from root directory 11 | of opentelemetry-demo 12 | 13 | ```sh 14 | docker compose build quote 15 | ``` 16 | 17 | ## Run the service 18 | 19 | Execute the below command to run the service. 20 | 21 | ```sh 22 | docker compose up quote 23 | ``` 24 | 25 | In order to get traffic into the service you have to deploy 26 | the whole opentelemetry-demo. 27 | 28 | Please follow the root README to do so. 29 | 30 | ## Development 31 | 32 | To build and run the quote service locally: 33 | 34 | ```sh 35 | docker build src/quote --target base -t quote 36 | cd src/quote 37 | docker run --rm -it -v $(pwd):/var/www -e QUOTE_PORT=8999 -p "8999:8999" quote 38 | ``` 39 | 40 | Then, send some curl requests: 41 | 42 | ```sh 43 | curl --location 'http://localhost:8999/getquote' \ 44 | --header 'Content-Type: application/json' \ 45 | --data '{"numberOfItems":3}' 46 | ``` 47 | -------------------------------------------------------------------------------- /test/tracetesting/product-catalog/search.yaml: -------------------------------------------------------------------------------- 1 | # Copyright The OpenTelemetry Authors 2 | # SPDX-License-Identifier: Apache-2.0 3 | 4 | type: Test 5 | spec: 6 | id: product-search 7 | name: 'Product: Search' 8 | description: Search for products querying for their names 9 | trigger: 10 | type: grpc 11 | grpc: 12 | protobufFile: ../../../pb/demo.proto 13 | address: ${var:PRODUCT_CATALOG_ADDR} 14 | method: oteldemo.ProductCatalogService.SearchProducts 15 | request: |- 16 | { 17 | "query": "Roof Binoculars" 18 | } 19 | specs: 20 | - name: It called SearchProducts correctly and it returned 1 item 21 | selector: span[tracetest.span.type="rpc" name="oteldemo.ProductCatalogService/SearchProducts" rpc.system="grpc" rpc.method="SearchProducts" rpc.service="oteldemo.ProductCatalogService"] 22 | assertions: 23 | - attr:app.products_search.count = 1 24 | - attr:rpc.grpc.status_code = 0 25 | - name: It returned the desired product 26 | selector: span[tracetest.span.type="general" name="Tracetest trigger"] 27 | assertions: 28 | - attr:tracetest.response.body | json_path '$.results[0].name' = "Roof Binoculars" 29 | -------------------------------------------------------------------------------- /src/ad/Dockerfile: -------------------------------------------------------------------------------- 1 | # Copyright The OpenTelemetry Authors 2 | # SPDX-License-Identifier: Apache-2.0 3 | 4 | 5 | FROM --platform=${BUILDPLATFORM} eclipse-temurin:21-jdk AS builder 6 | ARG _JAVA_OPTIONS 7 | WORKDIR /usr/src/app/ 8 | 9 | COPY ./src/ad/gradlew* ./src/ad/settings.gradle* ./src/ad/build.gradle ./ 10 | COPY ./src/ad/gradle ./gradle 11 | 12 | RUN chmod +x ./gradlew 13 | RUN ./gradlew 14 | RUN ./gradlew downloadRepos 15 | 16 | COPY ./src/ad/ ./ 17 | COPY ./pb/ ./proto 18 | RUN chmod +x ./gradlew 19 | RUN ./gradlew installDist -PprotoSourceDir=./proto 20 | 21 | # ----------------------------------------------------------------------------- 22 | 23 | FROM eclipse-temurin:21-jre 24 | 25 | ARG OTEL_JAVA_AGENT_VERSION 26 | ARG _JAVA_OPTIONS 27 | 28 | WORKDIR /usr/src/app/ 29 | 30 | COPY --from=builder /usr/src/app/ ./ 31 | ADD --chmod=644 https://github.com/open-telemetry/opentelemetry-java-instrumentation/releases/download/v$OTEL_JAVA_AGENT_VERSION/opentelemetry-javaagent.jar /usr/src/app/opentelemetry-javaagent.jar 32 | ENV JAVA_TOOL_OPTIONS=-javaagent:/usr/src/app/opentelemetry-javaagent.jar 33 | 34 | EXPOSE ${AD_PORT} 35 | ENTRYPOINT [ "./build/install/opentelemetry-demo-ad/bin/Ad" ] 36 | -------------------------------------------------------------------------------- /src/frontend/components/CartItems/CartItem.tsx: -------------------------------------------------------------------------------- 1 | // Copyright The OpenTelemetry Authors 2 | // SPDX-License-Identifier: Apache-2.0 3 | 4 | import Link from 'next/link'; 5 | import { Product } from '../../protos/demo'; 6 | import ProductPrice from '../ProductPrice'; 7 | import * as S from './CartItems.styled'; 8 | 9 | interface IProps { 10 | product: Product; 11 | quantity: number; 12 | } 13 | 14 | const CartItem = ({ 15 | product: { id, name, picture, priceUsd = { units: 0, nanos: 0, currencyCode: 'USD' } }, 16 | quantity, 17 | }: IProps) => { 18 | return ( 19 | 20 | 21 | 22 | 23 | {name} 24 | 25 | 26 | 27 | {quantity} 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | ); 38 | }; 39 | 40 | export default CartItem; 41 | -------------------------------------------------------------------------------- /src/frontend/components/Footer/Footer.tsx: -------------------------------------------------------------------------------- 1 | // Copyright The OpenTelemetry Authors 2 | // SPDX-License-Identifier: Apache-2.0 3 | 4 | import { useEffect, useState } from 'react'; 5 | import * as S from './Footer.styled'; 6 | import SessionGateway from '../../gateways/Session.gateway'; 7 | import { CypressFields } from '../../utils/enums/CypressFields'; 8 | import PlatformFlag from '../PlatformFlag'; 9 | 10 | const currentYear = new Date().getFullYear(); 11 | 12 | const { userId } = SessionGateway.getSession(); 13 | 14 | const Footer = () => { 15 | const [sessionId, setSessionId] = useState(''); 16 | 17 | useEffect(() => { 18 | setSessionId(userId); 19 | }, []); 20 | 21 | return ( 22 | 23 | 24 | This website is hosted for demo purpose only. It is not an actual shop. 25 | 26 | session-id: {sessionId} 27 | 28 | 29 | 30 | @ {currentYear} OpenTelemetry (Source Code) 31 | 32 | 33 | 34 | ); 35 | }; 36 | 37 | export default Footer; 38 | -------------------------------------------------------------------------------- /src/accounting/Accounting.sln: -------------------------------------------------------------------------------- 1 | 2 | Microsoft Visual Studio Solution File, Format Version 12.00 3 | # Visual Studio Version 17 4 | VisualStudioVersion = 17.9.34701.34 5 | MinimumVisualStudioVersion = 10.0.40219.1 6 | Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Accounting", "Accounting.csproj", "{C66C35E2-DF04-4DCF-8F6A-87B6D6433FF6}" 7 | EndProject 8 | Global 9 | GlobalSection(SolutionConfigurationPlatforms) = preSolution 10 | Debug|Any CPU = Debug|Any CPU 11 | Release|Any CPU = Release|Any CPU 12 | EndGlobalSection 13 | GlobalSection(ProjectConfigurationPlatforms) = postSolution 14 | {C66C35E2-DF04-4DCF-8F6A-87B6D6433FF6}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 15 | {C66C35E2-DF04-4DCF-8F6A-87B6D6433FF6}.Debug|Any CPU.Build.0 = Debug|Any CPU 16 | {C66C35E2-DF04-4DCF-8F6A-87B6D6433FF6}.Release|Any CPU.ActiveCfg = Release|Any CPU 17 | {C66C35E2-DF04-4DCF-8F6A-87B6D6433FF6}.Release|Any CPU.Build.0 = Release|Any CPU 18 | EndGlobalSection 19 | GlobalSection(SolutionProperties) = preSolution 20 | HideSolutionNode = FALSE 21 | EndGlobalSection 22 | GlobalSection(ExtensibilityGlobals) = postSolution 23 | SolutionGuid = {6340CDDC-E917-4532-A056-5526E0A7BDDA} 24 | EndGlobalSection 25 | EndGlobal 26 | -------------------------------------------------------------------------------- /src/frontend/styles/globals.css: -------------------------------------------------------------------------------- 1 | /* Copyright The OpenTelemetry Authors */ 2 | /* */ 3 | /* Licensed under the Apache License, Version 2.0 (the "License"); */ 4 | /* you may not use this file except in compliance with the License. */ 5 | /* You may obtain a copy of the License at */ 6 | /* */ 7 | /* http://www.apache.org/licenses/LICENSE-2.0 */ 8 | /* */ 9 | /* Unless required by applicable law or agreed to in writing, software */ 10 | /* distributed under the License is distributed on an "AS IS" BASIS, */ 11 | /* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. */ 12 | /* See the License for the specific language governing permissions and */ 13 | /* limitations under the License. */ 14 | 15 | html, body { 16 | height: 100%; 17 | } 18 | 19 | body { 20 | background: white; 21 | margin: 0px; 22 | font-family: 'Open Sans', sans-serif; 23 | } 24 | 25 | body * { 26 | box-sizing: border-box; 27 | color: #29293E; 28 | font-weight: 600; 29 | } 30 | 31 | #__next { 32 | display: flex; 33 | flex-direction: column; 34 | min-height: 100vh; 35 | } 36 | 37 | main { 38 | flex: 1 0 auto; 39 | } 40 | 41 | select { 42 | -webkit-appearance: none; 43 | -webkit-border-radius: 0px; 44 | } 45 | -------------------------------------------------------------------------------- /src/frontend/pages/api/shipping.ts: -------------------------------------------------------------------------------- 1 | // Copyright The OpenTelemetry Authors 2 | // SPDX-License-Identifier: Apache-2.0 3 | 4 | import type { NextApiRequest, NextApiResponse } from 'next'; 5 | import InstrumentationMiddleware from '../../utils/telemetry/InstrumentationMiddleware'; 6 | import ShippingGateway from '../../gateways/http/Shipping.gateway'; 7 | import { Address, CartItem, Empty, Money } from '../../protos/demo'; 8 | import CurrencyGateway from '../../gateways/rpc/Currency.gateway'; 9 | 10 | type TResponse = Money | Empty; 11 | 12 | const handler = async ({ method, query }: NextApiRequest, res: NextApiResponse) => { 13 | switch (method) { 14 | case 'GET': { 15 | const { itemList = '', currencyCode = 'USD', address = '' } = query; 16 | const { costUsd } = await ShippingGateway.getShippingCost(JSON.parse(itemList as string) as CartItem[], 17 | JSON.parse(address as string) as Address); 18 | const cost = await CurrencyGateway.convert(costUsd!, currencyCode as string); 19 | 20 | return res.status(200).json(cost!); 21 | } 22 | 23 | default: { 24 | return res.status(405); 25 | } 26 | } 27 | }; 28 | 29 | export default InstrumentationMiddleware(handler); 30 | -------------------------------------------------------------------------------- /src/currency/genproto/Dockerfile: -------------------------------------------------------------------------------- 1 | # Copyright The OpenTelemetry Authors 2 | # SPDX-License-Identifier: Apache-2.0 3 | # Copyright 2023 The OpenTelemetry Authors 4 | # 5 | # Licensed under the Apache License, Version 2.0 (the "License"); 6 | # you may not use this file except in compliance with the License. 7 | # You may obtain a copy of the License at 8 | # 9 | # http://www.apache.org/licenses/LICENSE-2.0 10 | # 11 | # Unless required by applicable law or agreed to in writing, software 12 | # distributed under the License is distributed on an "AS IS" BASIS, 13 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | # See the License for the specific language governing permissions and 15 | # limitations under the License. 16 | 17 | FROM docker.io/library/alpine:3.21 AS builder 18 | 19 | RUN apk update && \ 20 | apk add git cmake make g++ grpc-dev protobuf-dev linux-headers 21 | 22 | WORKDIR /currency 23 | 24 | COPY ./src/currency/genproto/CMakeLists.txt genproto/CMakeLists.txt 25 | COPY ./src/currency/proto/ proto/ 26 | 27 | COPY ./pb/demo.proto proto/demo.proto 28 | 29 | RUN mkdir -p build && cd build \ 30 | && cmake ../genproto \ 31 | && make -j$(nproc || sysctl -n hw.ncpu || echo 1) demo-proto 32 | -------------------------------------------------------------------------------- /src/frontend/pages/cart/index.tsx: -------------------------------------------------------------------------------- 1 | // Copyright The OpenTelemetry Authors 2 | // SPDX-License-Identifier: Apache-2.0 3 | 4 | import { NextPage } from 'next'; 5 | import Head from 'next/head'; 6 | import Layout from '../../components/Layout'; 7 | import Recommendations from '../../components/Recommendations'; 8 | import * as S from '../../styles/Cart.styled'; 9 | import CartDetail from '../../components/Cart/CartDetail'; 10 | import EmptyCart from '../../components/Cart/EmptyCart'; 11 | import { useCart } from '../../providers/Cart.provider'; 12 | import AdProvider from '../../providers/Ad.provider'; 13 | 14 | const Cart: NextPage = () => { 15 | const { 16 | cart: { items }, 17 | } = useCart(); 18 | 19 | return ( 20 | productId)} 22 | contextKeys={[...new Set(items.flatMap(({ product }) => product.categories))]} 23 | > 24 | 25 | Otel Demo - Cart 26 | 27 | 28 | 29 | {(!!items.length && ) || } 30 | 31 | 32 | 33 | 34 | ); 35 | }; 36 | 37 | export default Cart; 38 | -------------------------------------------------------------------------------- /src/react-native-app/utils/Request.ts: -------------------------------------------------------------------------------- 1 | // Copyright The OpenTelemetry Authors 2 | // SPDX-License-Identifier: Apache-2.0 3 | /** 4 | * Copied with modification from src/frontend/utils/Request.ts 5 | */ 6 | import getFrontendProxyURL from "@/utils/Settings"; 7 | 8 | interface IRequestParams { 9 | url: string; 10 | body?: object; 11 | method?: "GET" | "POST" | "PUT" | "DELETE"; 12 | queryParams?: Record; 13 | headers?: Record; 14 | } 15 | 16 | const request = async ({ 17 | url = "", 18 | method = "GET", 19 | body, 20 | queryParams = {}, 21 | headers = { 22 | "content-type": "application/json", 23 | }, 24 | }: IRequestParams): Promise => { 25 | const proxyURL = await getFrontendProxyURL(); 26 | const requestURL = `${proxyURL}${url}?${new URLSearchParams(queryParams).toString()}`; 27 | const requestBody = body ? JSON.stringify(body) : undefined; 28 | const response = await fetch(requestURL, { 29 | method, 30 | body: requestBody, 31 | headers, 32 | }); 33 | 34 | const responseText = await response.text(); 35 | 36 | if (!!responseText) return JSON.parse(responseText); 37 | 38 | return undefined as unknown as T; 39 | }; 40 | 41 | export default request; 42 | -------------------------------------------------------------------------------- /test/tracetesting/currency/convert.yaml: -------------------------------------------------------------------------------- 1 | # Copyright The OpenTelemetry Authors 2 | # SPDX-License-Identifier: Apache-2.0 3 | 4 | type: Test 5 | spec: 6 | id: currency-convert 7 | name: 'Currency: Convert' 8 | description: Convert a currency 9 | trigger: 10 | type: grpc 11 | grpc: 12 | protobufFile: ../../../pb/demo.proto 13 | address: ${var:CURRENCY_ADDR} 14 | method: oteldemo.CurrencyService.Convert 15 | request: |- 16 | { 17 | "from": { 18 | "currencyCode": "USD", 19 | "units": 330, 20 | "nanos": 750000000 21 | }, 22 | "toCode": "CAD" 23 | } 24 | specs: 25 | - name: It converts from USD to CAD 26 | selector: span[tracetest.span.type="rpc" name="Currency/Convert" rpc.system="grpc" 27 | rpc.method="Convert" rpc.service="oteldemo.CurrencyService"] 28 | assertions: 29 | - attr:app.currency.conversion.from = "USD" 30 | - attr:app.currency.conversion.to = "CAD" 31 | - name: It has more nanos than expected 32 | selector: span[tracetest.span.type="general" name="Tracetest trigger"] 33 | assertions: 34 | - attr:tracetest.response.body| json_path '$.nanos' >= 599380800 35 | -------------------------------------------------------------------------------- /src/frontend/styles/Home.styled.ts: -------------------------------------------------------------------------------- 1 | // Copyright The OpenTelemetry Authors 2 | // SPDX-License-Identifier: Apache-2.0 3 | 4 | import styled from 'styled-components'; 5 | 6 | export const Container = styled.div` 7 | width: 100%; 8 | padding: 0 20px; 9 | 10 | ${({ theme }) => theme.breakpoints.desktop} { 11 | padding: 0 100px; 12 | } 13 | `; 14 | 15 | export const Row = styled.div` 16 | display: flex; 17 | flex-wrap: wrap; 18 | width: 100%; 19 | `; 20 | 21 | export const Content = styled.div` 22 | width: 100%; 23 | ${({ theme }) => theme.breakpoints.desktop} { 24 | margin-top: 100px; 25 | } 26 | `; 27 | 28 | export const HotProducts = styled.div` 29 | margin-bottom: 20px; 30 | 31 | ${({ theme }) => theme.breakpoints.desktop} { 32 | margin-bottom: 100px; 33 | } 34 | `; 35 | 36 | export const HotProductsTitle = styled.h1` 37 | font-size: ${({ theme }) => theme.sizes.mLarge}; 38 | font-weight: ${({ theme }) => theme.fonts.bold}; 39 | 40 | ${({ theme }) => theme.breakpoints.desktop} { 41 | font-size: ${({ theme }) => theme.sizes.dxLarge}; 42 | } 43 | `; 44 | 45 | export const Home = styled.div` 46 | @media (max-width: 992px) { 47 | ${Content} { 48 | width: 100%; 49 | } 50 | } 51 | `; 52 | --------------------------------------------------------------------------------
{text}
{name}
{quantity}
32 | 33 |
This website is hosted for demo purpose only. It is not an actual shop.
26 | session-id: {sessionId} 27 |
30 | @ {currentYear} OpenTelemetry (Source Code) 31 |