Skip to content

Commit

Permalink
Merge branch 'main' into sozhan/rename.shippingservice
Browse files Browse the repository at this point in the history
  • Loading branch information
Sozhan308 authored Dec 16, 2024
2 parents 07f5dbb + fa7847e commit e62b1df
Show file tree
Hide file tree
Showing 16 changed files with 491 additions and 54 deletions.
8 changes: 4 additions & 4 deletions .env
Original file line number Diff line number Diff line change
Expand Up @@ -28,11 +28,11 @@ ENV_PLATFORM=local
# OpenTelemetry Collector
HOST_FILESYSTEM=/
DOCKER_SOCK=/var/run/docker.sock
OTEL_COLLECTOR_HOST=otelcol
OTEL_COLLECTOR_HOST=otel-collector
OTEL_COLLECTOR_PORT_GRPC=4317
OTEL_COLLECTOR_PORT_HTTP=4318
OTEL_COLLECTOR_CONFIG=./src/otelcollector/otelcol-config.yml
OTEL_COLLECTOR_CONFIG_EXTRAS=./src/otelcollector/otelcol-config-extras.yml
OTEL_COLLECTOR_CONFIG=./src/otel-collector/otelcol-config.yml
OTEL_COLLECTOR_CONFIG_EXTRAS=./src/otel-collector/otelcol-config-extras.yml
OTEL_EXPORTER_OTLP_ENDPOINT=http://${OTEL_COLLECTOR_HOST}:${OTEL_COLLECTOR_PORT_GRPC}
PUBLIC_OTEL_EXPORTER_OTLP_TRACES_ENDPOINT=http://localhost:8080/otlp-http/v1/traces

Expand Down Expand Up @@ -94,7 +94,7 @@ IMAGE_PROVIDER_DOCKERFILE=./src/imageprovider/Dockerfile

# Load Generator
LOCUST_WEB_PORT=8089
LOCUST_USERS=10
LOCUST_USERS=5
LOCUST_HOST=http://${FRONTEND_PROXY_ADDR}
LOCUST_WEB_HOST=loadgenerator
LOCUST_AUTOSTART=true
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/label-pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ jobs:
- 'docker-compose*.yml'
- 'src/flagd/**'
- 'src/grafana/**'
- 'src/otelcollector/**'
- 'src/otel-collector/**'
- 'src/prometheus/**'
- name: "Add Label: docs-update-required"
Expand Down
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,10 @@ the release.
([#1827](https://github.com/open-telemetry/opentelemetry-demo/pull/1827))
* [cartservice] - Add Exemplars to Cart Service
([#1830](https://github.com/open-telemetry/opentelemetry-demo/pull/1830))
* [grafana] Add Exemplars Dashboard
([#1836](https://github.com/open-telemetry/opentelemetry-demo/pull/1836))
* [otel-collector] rename otelcol to otel-collector
([#1841](https://github.com/open-telemetry/opentelemetry-demo/pull/1841))
* [shipping] rename shippingservice to accounting
([#1827](https://github.com/open-telemetry/opentelemetry-demo/pull/1842))

Expand Down
2 changes: 1 addition & 1 deletion docker-compose-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ services:
depends_on:
tracetest-postgres:
condition: service_healthy
otelcol:
otel-collector:
condition: service_started
healthcheck:
test: [ "CMD", "wget", "--spider", "localhost:11633" ]
Expand Down
2 changes: 1 addition & 1 deletion docker-compose-tests_include-override.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

services:

otelcol:
otel-collector:
command: [ "--config=/etc/otelcol-config.yml", "--config=/etc/otelcol-config-tracetest.yml" ]
environment:
- ENVOY_PORT
Expand Down
28 changes: 14 additions & 14 deletions docker-compose.minimal.yml
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ services:
- OTEL_LOGS_EXPORTER=otlp
- OTEL_SERVICE_NAME=adservice
depends_on:
otelcol:
otel-collector:
condition: service_started
logging: *logging

Expand Down Expand Up @@ -76,7 +76,7 @@ services:
depends_on:
valkey-cart:
condition: service_started
otelcol:
otel-collector:
condition: service_started
logging: *logging

Expand Down Expand Up @@ -122,7 +122,7 @@ services:
condition: service_started
shipping:
condition: service_started
otelcol:
otel-collector:
condition: service_started
logging: *logging

Expand Down Expand Up @@ -150,7 +150,7 @@ services:
- OTEL_EXPORTER_OTLP_ENDPOINT
- OTEL_RESOURCE_ATTRIBUTES=${OTEL_RESOURCE_ATTRIBUTES},service.name=currencyservice # The C++ SDK does not support OTEL_SERVICE_NAME
depends_on:
otelcol:
otel-collector:
condition: service_started
logging: *logging

Expand All @@ -176,7 +176,7 @@ services:
- OTEL_RESOURCE_ATTRIBUTES
- OTEL_SERVICE_NAME=emailservice
depends_on:
otelcol:
otel-collector:
condition: service_started
logging: *logging

Expand Down Expand Up @@ -233,7 +233,7 @@ services:
condition: service_started
shipping:
condition: service_started
otelcol:
otel-collector:
condition: service_started
imageprovider:
condition: service_started
Expand Down Expand Up @@ -308,7 +308,7 @@ services:
- OTEL_SERVICE_NAME=imageprovider
- OTEL_RESOURCE_ATTRIBUTES
depends_on:
otelcol:
otel-collector:
condition: service_started
logging: *logging

Expand Down Expand Up @@ -374,7 +374,7 @@ services:
- OTEL_RESOURCE_ATTRIBUTES
- OTEL_SERVICE_NAME=paymentservice
depends_on:
otelcol:
otel-collector:
condition: service_started
logging: *logging

Expand Down Expand Up @@ -402,7 +402,7 @@ services:
- OTEL_RESOURCE_ATTRIBUTES
- OTEL_SERVICE_NAME=productcatalogservice
depends_on:
otelcol:
otel-collector:
condition: service_started
logging: *logging

Expand Down Expand Up @@ -430,7 +430,7 @@ services:
- OTEL_SERVICE_NAME=quoteservice
- OTEL_PHP_INTERNAL_METRICS_ENABLED=true
depends_on:
otelcol:
otel-collector:
condition: service_started
logging: *logging

Expand Down Expand Up @@ -463,7 +463,7 @@ services:
depends_on:
productcatalogservice:
condition: service_started
otelcol:
otel-collector:
condition: service_started
logging: *logging

Expand All @@ -490,7 +490,7 @@ services:
- OTEL_RESOURCE_ATTRIBUTES
- OTEL_SERVICE_NAME=shipping
depends_on:
otelcol:
otel-collector:
condition: service_started
logging: *logging

Expand Down Expand Up @@ -581,9 +581,9 @@ services:
logging: *logging

# OpenTelemetry Collector
otelcol:
otel-collector:
image: ${COLLECTOR_CONTRIB_IMAGE}
container_name: otel-col
container_name: otel-collector
deploy:
resources:
limits:
Expand Down
38 changes: 19 additions & 19 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ services:
- OTEL_RESOURCE_ATTRIBUTES
- OTEL_SERVICE_NAME=accounting
depends_on:
otelcol:
otel-collector:
condition: service_started
kafka:
condition: service_healthy
Expand Down Expand Up @@ -72,7 +72,7 @@ services:
- OTEL_LOGS_EXPORTER=otlp
- OTEL_SERVICE_NAME=adservice
depends_on:
otelcol:
otel-collector:
condition: service_started
flagd:
condition: service_started
Expand Down Expand Up @@ -106,7 +106,7 @@ services:
depends_on:
valkey-cart:
condition: service_started
otelcol:
otel-collector:
condition: service_started
flagd:
condition: service_started
Expand Down Expand Up @@ -156,7 +156,7 @@ services:
condition: service_started
shipping:
condition: service_started
otelcol:
otel-collector:
condition: service_started
kafka:
condition: service_healthy
Expand Down Expand Up @@ -188,7 +188,7 @@ services:
- OTEL_EXPORTER_OTLP_ENDPOINT
- OTEL_RESOURCE_ATTRIBUTES=${OTEL_RESOURCE_ATTRIBUTES},service.name=currencyservice # The C++ SDK does not support OTEL_SERVICE_NAME
depends_on:
otelcol:
otel-collector:
condition: service_started
logging: *logging

Expand All @@ -215,7 +215,7 @@ services:
- OTEL_RESOURCE_ATTRIBUTES
- OTEL_SERVICE_NAME=emailservice
depends_on:
otelcol:
otel-collector:
condition: service_started
logging: *logging

Expand Down Expand Up @@ -246,7 +246,7 @@ services:
- OTEL_RESOURCE_ATTRIBUTES
- OTEL_SERVICE_NAME=frauddetectionservice
depends_on:
otelcol:
otel-collector:
condition: service_started
kafka:
condition: service_healthy
Expand Down Expand Up @@ -305,7 +305,7 @@ services:
condition: service_started
shipping:
condition: service_started
otelcol:
otel-collector:
condition: service_started
imageprovider:
condition: service_started
Expand Down Expand Up @@ -384,7 +384,7 @@ services:
- OTEL_SERVICE_NAME=imageprovider
- OTEL_RESOURCE_ATTRIBUTES
depends_on:
otelcol:
otel-collector:
condition: service_started
logging: *logging

Expand Down Expand Up @@ -451,7 +451,7 @@ services:
- OTEL_RESOURCE_ATTRIBUTES
- OTEL_SERVICE_NAME=paymentservice
depends_on:
otelcol:
otel-collector:
condition: service_started
flagd:
condition: service_started
Expand Down Expand Up @@ -482,7 +482,7 @@ services:
- OTEL_RESOURCE_ATTRIBUTES
- OTEL_SERVICE_NAME=productcatalogservice
depends_on:
otelcol:
otel-collector:
condition: service_started
flagd:
condition: service_started
Expand Down Expand Up @@ -512,7 +512,7 @@ services:
- OTEL_SERVICE_NAME=quoteservice
- OTEL_PHP_INTERNAL_METRICS_ENABLED=true
depends_on:
otelcol:
otel-collector:
condition: service_started
logging: *logging

Expand Down Expand Up @@ -546,7 +546,7 @@ services:
depends_on:
productcatalogservice:
condition: service_started
otelcol:
otel-collector:
condition: service_started
flagd:
condition: service_started
Expand Down Expand Up @@ -575,7 +575,7 @@ services:
- OTEL_RESOURCE_ATTRIBUTES
- OTEL_SERVICE_NAME=shipping
depends_on:
otelcol:
otel-collector:
condition: service_started
logging: *logging

Expand Down Expand Up @@ -628,7 +628,7 @@ services:
ports:
- "${FLAGD_UI_PORT}"
depends_on:
otelcol:
otel-collector:
condition: service_started
flagd:
condition: service_started
Expand Down Expand Up @@ -689,15 +689,15 @@ services:
image: ${JAEGERTRACING_IMAGE}
container_name: jaeger
command:
- "--memory.max-traces=5000"
- "--memory.max-traces=25000"
- "--query.base-path=/jaeger/ui"
- "--prometheus.server-url=http://${PROMETHEUS_ADDR}"
- "--prometheus.query.normalize-calls=true"
- "--prometheus.query.normalize-duration=true"
deploy:
resources:
limits:
memory: 400M
memory: 1200M
restart: unless-stopped
ports:
- "${JAEGER_SERVICE_PORT}" # Jaeger UI
Expand Down Expand Up @@ -725,9 +725,9 @@ services:
logging: *logging

# OpenTelemetry Collector
otelcol:
otel-collector:
image: ${COLLECTOR_CONTRIB_IMAGE}
container_name: otel-col
container_name: otel-collector
deploy:
resources:
limits:
Expand Down
4 changes: 2 additions & 2 deletions renovate.json5
Original file line number Diff line number Diff line change
Expand Up @@ -67,8 +67,8 @@
"groupName": "loadgenerator",
},
{
"matchFileNames": ["src/otelcollector/**"],
"groupName": "otelcollector",
"matchFileNames": ["src/otel-collector/**"],
"groupName": "otel-collector",
},
{
"matchFileNames": ["src/paymentservice/**"],
Expand Down
4 changes: 1 addition & 3 deletions src/frontend/pages/_app.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
import '../styles/globals.css';
import { QueryClient, QueryClientProvider } from '@tanstack/react-query';
import App, { AppContext, AppProps } from 'next/app';
import { getCookie } from 'cookies-next';
import CurrencyProvider from '../providers/Currency.provider';
import CartProvider from '../providers/Cart.provider';
import { ThemeProvider } from 'styled-components';
Expand All @@ -26,8 +25,7 @@ declare global {
}

if (typeof window !== 'undefined') {
const collector = getCookie('otelCollectorUrl')?.toString() || '';
FrontendTracer(collector);
FrontendTracer();
if (window.location) {
const session = SessionGateway.getSession();

Expand Down
4 changes: 2 additions & 2 deletions src/frontend/utils/telemetry/FrontendTracer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ const {
IS_SYNTHETIC_REQUEST = '',
} = typeof window !== 'undefined' ? window.ENV : {};

const FrontendTracer = (collectorString: string) => {
const FrontendTracer = () => {
let resource = new Resource({
[SemanticResourceAttributes.SERVICE_NAME]: NEXT_PUBLIC_OTEL_SERVICE_NAME,
});
Expand All @@ -33,7 +33,7 @@ const FrontendTracer = (collectorString: string) => {
provider.addSpanProcessor(
new BatchSpanProcessor(
new OTLPTraceExporter({
url: NEXT_PUBLIC_OTEL_EXPORTER_OTLP_TRACES_ENDPOINT || collectorString || 'http://localhost:4318/v1/traces',
url: NEXT_PUBLIC_OTEL_EXPORTER_OTLP_TRACES_ENDPOINT || 'http://localhost:4318/v1/traces',
}),
{
scheduledDelayMillis: 500,
Expand Down
Loading

0 comments on commit e62b1df

Please sign in to comment.