Skip to content

Commit e1706f7

Browse files
authored
Merge branch 'main' into sozhan/rename.ad
2 parents 2c5397a + 5dbe836 commit e1706f7

23 files changed

+48
-46
lines changed

.env

+3-3
Original file line numberDiff line numberDiff line change
@@ -112,9 +112,9 @@ PRODUCT_CATALOG_SERVICE_ADDR=productcatalogservice:${PRODUCT_CATALOG_SERVICE_POR
112112
PRODUCT_CATALOG_DOCKERFILE=./src/productcatalogservice/Dockerfile
113113

114114
# Quote Service
115-
QUOTE_SERVICE_PORT=8090
116-
QUOTE_SERVICE_ADDR=http://quoteservice:${QUOTE_SERVICE_PORT}
117-
QUOTE_SERVICE_DOCKERFILE=./src/quoteservice/Dockerfile
115+
QUOTE_PORT=8090
116+
QUOTE_ADDR=http://quote:${QUOTE_PORT}
117+
QUOTE_DOCKERFILE=./src/quote/Dockerfile
118118

119119
# Recommendation Service
120120
RECOMMENDATION_SERVICE_PORT=9001

.github/workflows/component-build-images.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -111,8 +111,8 @@ jobs:
111111
tag_suffix: productcatalogservice
112112
context: ./
113113
setup-qemu: true
114-
- file: ./src/quoteservice/Dockerfile
115-
tag_suffix: quoteservice
114+
- file: ./src/quote/Dockerfile
115+
tag_suffix: quote
116116
context: ./
117117
setup-qemu: true
118118
- file: ./src/recommendationservice/Dockerfile

CHANGELOG.md

+2
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,8 @@ the release.
3434
([#1830](https://github.com/open-telemetry/opentelemetry-demo/pull/1830))
3535
* [grafana] Add Exemplars Dashboard
3636
([#1836](https://github.com/open-telemetry/opentelemetry-demo/pull/1836))
37+
* [quote] rename quoteservice to quote
38+
([#1838](https://github.com/open-telemetry/opentelemetry-demo/pull/1838))
3739
* [otel-collector] rename otelcol to otel-collector
3840
([#1841](https://github.com/open-telemetry/opentelemetry-demo/pull/1841))
3941
* [ad] rename adservice to ad

docker-compose-tests.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ services:
7777
condition: service_started
7878
productcatalogservice:
7979
condition: service_started
80-
quoteservice:
80+
quote:
8181
condition: service_started
8282
recommendationservice:
8383
condition: service_started

docker-compose.minimal.yml

+9-9
Original file line numberDiff line numberDiff line change
@@ -227,7 +227,7 @@ services:
227227
condition: service_started
228228
productcatalogservice:
229229
condition: service_started
230-
quoteservice:
230+
quote:
231231
condition: service_started
232232
recommendationservice:
233233
condition: service_started
@@ -407,27 +407,27 @@ services:
407407
logging: *logging
408408

409409
# Quote service
410-
quoteservice:
411-
image: ${IMAGE_NAME}:${DEMO_VERSION}-quoteservice
410+
quote:
411+
image: ${IMAGE_NAME}:${DEMO_VERSION}-quote
412412
container_name: quote-service
413413
build:
414414
context: ./
415-
dockerfile: ${QUOTE_SERVICE_DOCKERFILE}
415+
dockerfile: ${QUOTE_DOCKERFILE}
416416
cache_from:
417-
- ${IMAGE_NAME}:${IMAGE_VERSION}-quoteservice
417+
- ${IMAGE_NAME}:${IMAGE_VERSION}-quote
418418
deploy:
419419
resources:
420420
limits:
421421
memory: 40M
422422
restart: unless-stopped
423423
ports:
424-
- "${QUOTE_SERVICE_PORT}"
424+
- "${QUOTE_PORT}"
425425
environment:
426426
- OTEL_EXPORTER_OTLP_ENDPOINT=http://${OTEL_COLLECTOR_HOST}:${OTEL_COLLECTOR_PORT_HTTP}
427427
- OTEL_PHP_AUTOLOAD_ENABLED=true
428-
- QUOTE_SERVICE_PORT
428+
- QUOTE_PORT
429429
- OTEL_RESOURCE_ATTRIBUTES
430-
- OTEL_SERVICE_NAME=quoteservice
430+
- OTEL_SERVICE_NAME=quote
431431
- OTEL_PHP_INTERNAL_METRICS_ENABLED=true
432432
depends_on:
433433
otel-collector:
@@ -485,7 +485,7 @@ services:
485485
- "${SHIPPING_SERVICE_PORT}"
486486
environment:
487487
- SHIPPING_SERVICE_PORT
488-
- QUOTE_SERVICE_ADDR
488+
- QUOTE_ADDR
489489
- OTEL_EXPORTER_OTLP_ENDPOINT=http://${OTEL_COLLECTOR_HOST}:${OTEL_COLLECTOR_PORT_GRPC}
490490
- OTEL_RESOURCE_ATTRIBUTES
491491
- OTEL_SERVICE_NAME=shippingservice

docker-compose.yml

+9-9
Original file line numberDiff line numberDiff line change
@@ -299,7 +299,7 @@ services:
299299
condition: service_started
300300
productcatalogservice:
301301
condition: service_started
302-
quoteservice:
302+
quote:
303303
condition: service_started
304304
recommendationservice:
305305
condition: service_started
@@ -489,27 +489,27 @@ services:
489489
logging: *logging
490490

491491
# Quote service
492-
quoteservice:
493-
image: ${IMAGE_NAME}:${DEMO_VERSION}-quoteservice
492+
quote:
493+
image: ${IMAGE_NAME}:${DEMO_VERSION}-quote
494494
container_name: quote-service
495495
build:
496496
context: ./
497-
dockerfile: ${QUOTE_SERVICE_DOCKERFILE}
497+
dockerfile: ${QUOTE_DOCKERFILE}
498498
cache_from:
499-
- ${IMAGE_NAME}:${IMAGE_VERSION}-quoteservice
499+
- ${IMAGE_NAME}:${IMAGE_VERSION}-quote
500500
deploy:
501501
resources:
502502
limits:
503503
memory: 40M
504504
restart: unless-stopped
505505
ports:
506-
- "${QUOTE_SERVICE_PORT}"
506+
- "${QUOTE_PORT}"
507507
environment:
508508
- OTEL_EXPORTER_OTLP_ENDPOINT=http://${OTEL_COLLECTOR_HOST}:${OTEL_COLLECTOR_PORT_HTTP}
509509
- OTEL_PHP_AUTOLOAD_ENABLED=true
510-
- QUOTE_SERVICE_PORT
510+
- QUOTE_PORT
511511
- OTEL_RESOURCE_ATTRIBUTES
512-
- OTEL_SERVICE_NAME=quoteservice
512+
- OTEL_SERVICE_NAME=quote
513513
- OTEL_PHP_INTERNAL_METRICS_ENABLED=true
514514
depends_on:
515515
otel-collector:
@@ -570,7 +570,7 @@ services:
570570
- "${SHIPPING_SERVICE_PORT}"
571571
environment:
572572
- SHIPPING_SERVICE_PORT
573-
- QUOTE_SERVICE_ADDR
573+
- QUOTE_ADDR
574574
- OTEL_EXPORTER_OTLP_ENDPOINT=http://${OTEL_COLLECTOR_HOST}:${OTEL_COLLECTOR_PORT_GRPC}
575575
- OTEL_RESOURCE_ATTRIBUTES
576576
- OTEL_SERVICE_NAME=shippingservice

docker-gen-proto.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,6 @@ gen_proto_go checkoutservice
3030
#gen_proto_ts frontend
3131
#gen_proto_js paymentservice
3232
gen_proto_go productcatalogservice
33-
#gen_proto_php quoteservice
33+
#gen_proto_php quote
3434
gen_proto_python recommendationservice
3535
#gen_proto_rust shippingservice

ide-gen-proto.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,6 @@ gen_proto_go checkoutservice
7474
gen_proto_ts frontend
7575
gen_proto_js paymentservice
7676
gen_proto_go productcatalogservice
77-
# gen_proto_php quoteservice
77+
# gen_proto_php quote
7878
gen_proto_python recommendationservice
7979
gen_proto_rust shippingservice

renovate.json5

+2-2
Original file line numberDiff line numberDiff line change
@@ -83,8 +83,8 @@
8383
"groupName": "prometheus",
8484
},
8585
{
86-
"matchFileNames": ["src/quoteservice/**"],
87-
"groupName": "quoteservice",
86+
"matchFileNames": ["src/quote/**"],
87+
"groupName": "quote",
8888
},
8989
{
9090
"matchFileNames": ["src/recommendationservice/**"],

src/grafana/provisioning/dashboards/demo/demo-dashboard.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1022,7 +1022,7 @@
10221022
"uid": "webstore-metrics"
10231023
},
10241024
"editorMode": "code",
1025-
"expr": "rate(otel_trace_span_processor_spans{job=\"opentelemetry-demo/quoteservice\"}[2m])*120",
1025+
"expr": "rate(otel_trace_span_processor_spans{job=\"opentelemetry-demo/quote\"}[2m])*120",
10261026
"interval": "2m",
10271027
"legendFormat": "{{state}}",
10281028
"range": true,
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
.dockerignore
2-
.idea
3-
Dockerfile
4-
vendor
1+
.dockerignore
2+
.idea
3+
Dockerfile
4+
vendor
File renamed without changes.

src/quoteservice/Dockerfile src/quote/Dockerfile

+3-3
Original file line numberDiff line numberDiff line change
@@ -15,12 +15,12 @@ RUN chmod +x /usr/local/bin/install-php-extensions \
1515
WORKDIR /var/www
1616
CMD ["php", "public/index.php"]
1717
USER www-data
18-
EXPOSE ${QUOTE_SERVICE_PORT}
18+
EXPOSE ${QUOTE_PORT}
1919

2020
FROM composer:2.7 AS vendor
2121

2222
WORKDIR /tmp/
23-
COPY ./src/quoteservice/composer.json .
23+
COPY ./src/quote/composer.json .
2424

2525
RUN composer install \
2626
--ignore-platform-reqs \
@@ -32,4 +32,4 @@ RUN composer install \
3232

3333
FROM base AS final
3434
COPY --from=vendor /tmp/vendor/ ./vendor/
35-
COPY ./src/quoteservice/ /var/www
35+
COPY ./src/quote/ /var/www

src/quoteservice/README.md src/quote/README.md

+5-5
Original file line numberDiff line numberDiff line change
@@ -11,15 +11,15 @@ To build the quote service, run the following from root directory
1111
of opentelemetry-demo
1212

1313
```sh
14-
docker compose build quoteservice
14+
docker compose build quote
1515
```
1616

1717
## Run the service
1818

1919
Execute the below command to run the service.
2020

2121
```sh
22-
docker compose up quoteservice
22+
docker compose up quote
2323
```
2424

2525
In order to get traffic into the service you have to deploy
@@ -32,9 +32,9 @@ Please follow the root README to do so.
3232
To build and run the quote service locally:
3333

3434
```sh
35-
docker build src/quoteservice --target base -t quoteservice
36-
cd src/quoteservice
37-
docker run --rm -it -v $(pwd):/var/www -e QUOTE_SERVICE_PORT=8999 -p "8999:8999" quoteservice
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
3838
```
3939

4040
Then, send some curl requests:
File renamed without changes.
File renamed without changes.
File renamed without changes.

src/quoteservice/composer.json src/quote/composer.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"name": "openteletry-demo/quoteservice",
2+
"name": "openteletry-demo/quote",
33
"description": "Quote Service part of OpenTelemetry Demo",
44
"license": "Apache-2.0",
55
"require": {

src/quoteservice/public/index.php src/quote/public/index.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@
8787

8888
return $response;
8989
});
90-
$address = '0.0.0.0:' . getenv('QUOTE_SERVICE_PORT');
90+
$address = '0.0.0.0:' . getenv('QUOTE_PORT');
9191
$socket = new SocketServer($address);
9292
$server->listen($socket);
9393

src/shippingservice/README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Shipping Service
22

3-
The Shipping service queries `quoteservice` for price quote, provides tracking IDs,
3+
The Shipping service queries `quote` for price quote, provides tracking IDs,
44
and the impression of order fulfillment & shipping processes.
55

66
## Local

src/shippingservice/src/shipping_service/quote.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -40,8 +40,8 @@ pub async fn create_quote_from_count(count: u32) -> Result<Quote, tonic::Status>
4040
async fn request_quote(count: u32) -> Result<f64, Box<dyn std::error::Error>> {
4141
let quote_service_addr: String = format!(
4242
"{}{}",
43-
env::var("QUOTE_SERVICE_ADDR")
44-
.unwrap_or_else(|_| "http://quoteservice:8090".to_string())
43+
env::var("QUOTE_ADDR")
44+
.unwrap_or_else(|_| "http://quote:8090".to_string())
4545
.parse::<String>()
4646
.expect("Invalid quote service address"),
4747
"/getquote"

0 commit comments

Comments
 (0)