Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions .env
Original file line number Diff line number Diff line change
Expand Up @@ -49,9 +49,9 @@ OTEL_EXPORTER_OTLP_METRICS_TEMPORALITY_PREFERENCE=cumulative
ACCOUNTING_DOCKERFILE=./src/accounting/Dockerfile

# Ad Service
AD_SERVICE_PORT=9555
AD_SERVICE_ADDR=adservice:${AD_SERVICE_PORT}
AD_SERVICE_DOCKERFILE=./src/adservice/Dockerfile
AD_PORT=9555
AD_ADDR=ad:${AD_PORT}
AD_DOCKERFILE=./src/ad/Dockerfile

# Cart Service
CART_SERVICE_PORT=7070
Expand Down
2 changes: 1 addition & 1 deletion .github/component_owners.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
# SPDX-License-Identifier: Apache-2.0
# this file is used by .github/workflows/assign-reviewers.yml
components:
src/adservice:
src/ad:
- jack-berg
- mateuszrzeszutek
- trask
4 changes: 2 additions & 2 deletions .github/workflows/component-build-images.yml
Original file line number Diff line number Diff line change
Expand Up @@ -55,8 +55,8 @@ jobs:
tag_suffix: accounting
context: ./
setup-qemu: true
- file: ./src/adservice/Dockerfile
tag_suffix: adservice
- file: ./src/ad/Dockerfile
tag_suffix: ad
context: ./
setup-qemu: true
- file: ./src/cartservice/src/Dockerfile
Expand Down
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,8 @@ the release.
([#1838](https://github.com/open-telemetry/opentelemetry-demo/pull/1838))
* [otel-collector] rename otelcol to otel-collector
([#1841](https://github.com/open-telemetry/opentelemetry-demo/pull/1841))
* [ad] rename adservice to ad
([#1827](https://github.com/open-telemetry/opentelemetry-demo/pull/1832))

## 1.12.0

Expand Down
2 changes: 1 addition & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ cd opentelemetry-demo/
- Navigate to the Java Ad Service folder to install and update Gradle:

```shell
cd .\src\adservice\
cd .\src\ad\
.\gradlew installDist
.\gradlew wrapper --gradle-version 7.4.2
```
Expand Down
4 changes: 2 additions & 2 deletions docker-compose-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ services:
args:
TRACETEST_IMAGE_VERSION: ${TRACETEST_IMAGE_VERSION}
environment:
- AD_SERVICE_ADDR
- AD_ADDR
- CART_SERVICE_ADDR
- CHECKOUT_SERVICE_ADDR
- CURRENCY_SERVICE_ADDR
Expand All @@ -59,7 +59,7 @@ services:
# adding demo services as dependencies
accounting:
condition: service_started
adservice:
ad:
condition: service_started
cartservice:
condition: service_started
Expand Down
20 changes: 10 additions & 10 deletions docker-compose.minimal.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,14 +19,14 @@ services:
# ******************

# AdService
adservice:
image: ${IMAGE_NAME}:${DEMO_VERSION}-adservice
container_name: ad-service
ad:
image: ${IMAGE_NAME}:${DEMO_VERSION}-ad
container_name: ad
build:
context: ./
dockerfile: ${AD_SERVICE_DOCKERFILE}
dockerfile: ${AD_DOCKERFILE}
cache_from:
- ${IMAGE_NAME}:${IMAGE_VERSION}-adservice
- ${IMAGE_NAME}:${IMAGE_VERSION}-ad
args:
OTEL_JAVA_AGENT_VERSION: ${OTEL_JAVA_AGENT_VERSION}
deploy:
Expand All @@ -35,15 +35,15 @@ services:
memory: 300M
restart: unless-stopped
ports:
- "${AD_SERVICE_PORT}"
- "${AD_PORT}"
environment:
- AD_SERVICE_PORT
- AD_PORT
- FLAGD_HOST
- OTEL_EXPORTER_OTLP_ENDPOINT=http://${OTEL_COLLECTOR_HOST}:${OTEL_COLLECTOR_PORT_HTTP}
- OTEL_EXPORTER_OTLP_METRICS_TEMPORALITY_PREFERENCE
- OTEL_RESOURCE_ATTRIBUTES
- OTEL_LOGS_EXPORTER=otlp
- OTEL_SERVICE_NAME=adservice
- OTEL_SERVICE_NAME=ad
depends_on:
otel-collector:
condition: service_started
Expand Down Expand Up @@ -199,7 +199,7 @@ services:
environment:
- PORT=${FRONTEND_PORT}
- FRONTEND_ADDR
- AD_SERVICE_ADDR
- AD_ADDR
- CART_SERVICE_ADDR
- CHECKOUT_SERVICE_ADDR
- CURRENCY_SERVICE_ADDR
Expand All @@ -217,7 +217,7 @@ services:
- FLAGD_HOST
- FLAGD_PORT
depends_on:
adservice:
ad:
condition: service_started
cartservice:
condition: service_started
Expand Down
20 changes: 10 additions & 10 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -45,14 +45,14 @@ services:
logging: *logging

# AdService
adservice:
image: ${IMAGE_NAME}:${DEMO_VERSION}-adservice
container_name: ad-service
ad:
image: ${IMAGE_NAME}:${DEMO_VERSION}-ad
container_name: ad
build:
context: ./
dockerfile: ${AD_SERVICE_DOCKERFILE}
dockerfile: ${AD_DOCKERFILE}
cache_from:
- ${IMAGE_NAME}:${IMAGE_VERSION}-adservice
- ${IMAGE_NAME}:${IMAGE_VERSION}-ad
args:
OTEL_JAVA_AGENT_VERSION: ${OTEL_JAVA_AGENT_VERSION}
deploy:
Expand All @@ -61,16 +61,16 @@ services:
memory: 300M
restart: unless-stopped
ports:
- "${AD_SERVICE_PORT}"
- "${AD_PORT}"
environment:
- AD_SERVICE_PORT
- AD_PORT
- FLAGD_HOST
- FLAGD_PORT
- OTEL_EXPORTER_OTLP_ENDPOINT=http://${OTEL_COLLECTOR_HOST}:${OTEL_COLLECTOR_PORT_HTTP}
- OTEL_EXPORTER_OTLP_METRICS_TEMPORALITY_PREFERENCE
- OTEL_RESOURCE_ATTRIBUTES
- OTEL_LOGS_EXPORTER=otlp
- OTEL_SERVICE_NAME=adservice
- OTEL_SERVICE_NAME=ad
depends_on:
otel-collector:
condition: service_started
Expand Down Expand Up @@ -271,7 +271,7 @@ services:
environment:
- PORT=${FRONTEND_PORT}
- FRONTEND_ADDR
- AD_SERVICE_ADDR
- AD_ADDR
- CART_SERVICE_ADDR
- CHECKOUT_SERVICE_ADDR
- CURRENCY_SERVICE_ADDR
Expand All @@ -289,7 +289,7 @@ services:
- FLAGD_HOST
- FLAGD_PORT
depends_on:
adservice:
ad:
condition: service_started
cartservice:
condition: service_started
Expand Down
2 changes: 1 addition & 1 deletion docker-gen-proto.sh
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ gen_proto_python() {
}

#gen_proto_dotnet accounting
#gen_proto_java adservice
#gen_proto_java ad
#gen_proto_dotnet cartservice
gen_proto_go checkoutservice
#gen_proto_cpp currencyservice
Expand Down
2 changes: 1 addition & 1 deletion ide-gen-proto.sh
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ gen_proto_ts() {
}

gen_proto_dotnet accounting
# gen_proto_java adservice
# gen_proto_java ad
gen_proto_dotnet cartservice
gen_proto_go checkoutservice
# gen_proto_cpp currencyservice
Expand Down
4 changes: 2 additions & 2 deletions renovate.json5
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@
"groupName": "accounting",
},
{
"matchFileNames": ["src/adservice/**"],
"groupName": "adservice",
"matchFileNames": ["src/ad/**"],
"groupName": "ad",
},
{
"matchFileNames": ["src/cartservice/**"],
Expand Down
File renamed without changes.
12 changes: 7 additions & 5 deletions src/adservice/Dockerfile → src/ad/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,16 @@ FROM --platform=${BUILDPLATFORM} eclipse-temurin:21-jdk AS builder

WORKDIR /usr/src/app/

COPY ./src/adservice/gradlew* ./src/adservice/settings.gradle* ./src/adservice/build.gradle ./
COPY ./src/adservice/gradle ./gradle
COPY ./src/ad/gradlew* ./src/ad/settings.gradle* ./src/ad/build.gradle ./
COPY ./src/ad/gradle ./gradle

RUN chmod +x ./gradlew
RUN ./gradlew
RUN ./gradlew downloadRepos

COPY ./src/adservice/ ./
COPY ./src/ad/ ./
COPY ./pb/ ./proto
RUN chmod +x ./gradlew
RUN ./gradlew installDist -PprotoSourceDir=./proto

# -----------------------------------------------------------------------------
Expand All @@ -27,5 +29,5 @@ COPY --from=builder /usr/src/app/ ./
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
ENV JAVA_TOOL_OPTIONS=-javaagent:/usr/src/app/opentelemetry-javaagent.jar

EXPOSE ${AD_SERVICE_PORT}
ENTRYPOINT [ "./build/install/opentelemetry-demo-ad-service/bin/AdService" ]
EXPOSE ${AD_PORT}
ENTRYPOINT [ "./build/install/opentelemetry-demo-ad-service/bin/Ad" ]
8 changes: 4 additions & 4 deletions src/adservice/README.md → src/ad/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,14 +14,14 @@ To build Ad Service, run:
```

It will create an executable script
`src/adservice/build/install/oteldemo/bin/AdService`.
`src/ad/build/install/oteldemo/bin/Ad`.

To run the Ad Service:

```sh
export AD_SERVICE_PORT=8080
export AD_PORT=8080
export FEATURE_FLAG_GRPC_SERVICE_ADDR=featureflagservice:50053
./build/install/opentelemetry-demo-ad-service/bin/AdService
./build/install/opentelemetry-demo-ad-service/bin/Ad
```

### Upgrading Gradle
Expand All @@ -37,5 +37,5 @@ If you need to upgrade the version of gradle then run
From the root of `opentelemetry-demo`, run:

```sh
docker build --file ./src/adservice/Dockerfile ./
docker build --file ./src/ad/Dockerfile ./
```
8 changes: 4 additions & 4 deletions src/adservice/build.gradle → src/ad/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ repositories {
}

description = 'Ad Service'
group = "adservice"
group = "ad"
version = "0.1.0-SNAPSHOT"

def opentelemetryVersion = "1.40.0"
Expand Down Expand Up @@ -129,14 +129,14 @@ task downloadRepos(type: Copy) {
into offlineCompile
}

task adService(type: CreateStartScripts) {
task ad(type: CreateStartScripts) {
mainClass.set('oteldemo.AdService')
applicationName = 'AdService'
applicationName = 'Ad'
outputDir = new File(project.buildDir, 'tmp')
classpath = startScripts.classpath
}

applicationDistribution.into('bin') {
from(adService)
from(ad)
fileMode = 0755
}
File renamed without changes.
Loading