Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[chore] drop _SERVICE for dependent service env variables #1897

Merged
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
25 changes: 1 addition & 24 deletions .dockerignore
Original file line number Diff line number Diff line change
Expand Up @@ -13,35 +13,12 @@ src/*/*/Dockerfile
./src/currency/node_modules/
###################################

###################################
# featureflagservice
# Common development/test artifacts
./src/featureflagservice/cover/
./src/featureflagservice/doc/
./src/featureflagservice/test/
./src/featureflagservice/tmp/
./src/featureflagservice/.elixir_ls

###################################
# frontend
./src/frontend/node_modules/

###################################
# shippingservice
# shipping
./src/shipping/target
###################################

# Mix artifacts
./src/featureflagservice/_build/
./src/featureflagservice/deps/
./src/featureflagservice/*.ez

# Generated on crash by the VM
./src/featureflagservice/erl_crash.dump

# Static artifacts - These should be fetched and built inside the Docker image
./src/featureflagservice/assets/node_modules/
./src/featureflagservice/priv/static/assets/
./src/featureflagservice/priv/static/cache_manifest.json
###################################

20 changes: 10 additions & 10 deletions .env
Original file line number Diff line number Diff line change
Expand Up @@ -139,9 +139,9 @@ FLAGD_UI_PORT=4000
FLAGD_UI_DOCKERFILE=./src/flagd-ui/Dockerfile

# Kafka
KAFKA_SERVICE_PORT=9092
KAFKA_SERVICE_ADDR=kafka:${KAFKA_SERVICE_PORT}
KAFKA_SERVICE_DOCKERFILE=./src/kafka/Dockerfile
KAFKA_PORT=9092
KAFKA_ADDR=kafka:${KAFKA_PORT}
KAFKA_DOCKERFILE=./src/kafka/Dockerfile

# Valkey
VALKEY_PORT=6379
Expand All @@ -151,14 +151,14 @@ VALKEY_ADDR=valkey-cart:${VALKEY_PORT}
# Telemetry Components
# ********************
# Grafana
GRAFANA_SERVICE_PORT=3000
GRAFANA_SERVICE_HOST=grafana
GRAFANA_PORT=3000
GRAFANA_HOST=grafana

# Jaeger
JAEGER_SERVICE_PORT=16686
JAEGER_SERVICE_HOST=jaeger
JAEGER_PORT=16686
JAEGER_HOST=jaeger

# Prometheus
PROMETHEUS_SERVICE_PORT=9090
PROMETHEUS_SERVICE_HOST=prometheus
PROMETHEUS_ADDR=${PROMETHEUS_SERVICE_HOST}:${PROMETHEUS_SERVICE_PORT}
PROMETHEUS_PORT=9090
PROMETHEUS_HOST=prometheus
PROMETHEUS_ADDR=${PROMETHEUS_HOST}:${PROMETHEUS_PORT}
4 changes: 0 additions & 4 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -43,10 +43,6 @@ test/tracetesting/tracetesting-vars.yaml
# Ignore copied/generated protobuf files
/src/accounting/src/protos/
/src/cart/src/protos/
/src/featureflagservice/proto/
/src/featureflagservice/src/ffs_demo_pb.erl
/src/featureflagservice/src/ffs_service_*.erl
/src/featureflagservice/src/oteldemo_*.erl
/src/fraud-detection/src/main/proto
/src/frontend/pb/
/src/frontend/protos/
Expand Down
2 changes: 0 additions & 2 deletions .licenserc.json
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,6 @@
"src/cart/tests/obj/",
"src/currency/build/",
"src/checkout/genproto/",
"src/featureflagservice/assets/vendor/",
"src/featureflagservice/priv/",
"src/product-catalog/genproto/",
"src/react-native-app/ios/Pods/",
"src/react-native-app/ios/build/",
Expand Down
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,8 @@ the release.
([#1864](https://github.com/open-telemetry/opentelemetry-demo/pull/1864))
* [checkout] rename checkoutservice to checkout
([#1867](https://github.com/open-telemetry/opentelemetry-demo/pull/1867))
* [chore] remove `SERVICE_` from environment variables
([#1897](https://github.com/open-telemetry/opentelemetry-demo/pull/1897))

## 1.12.0

Expand Down
2 changes: 1 addition & 1 deletion docker-compose-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ services:
- PRODUCT_CATALOG_ADDR
- RECOMMENDATION_ADDR
- SHIPPING_ADDR
- KAFKA_SERVICE_ADDR
- KAFKA_ADDR
extra_hosts:
- "host.docker.internal:host-gateway"
volumes:
Expand Down
14 changes: 7 additions & 7 deletions docker-compose.minimal.yml
Original file line number Diff line number Diff line change
Expand Up @@ -261,10 +261,10 @@ services:
- FRONTEND_HOST
- LOCUST_WEB_HOST
- LOCUST_WEB_PORT
- GRAFANA_SERVICE_PORT
- GRAFANA_SERVICE_HOST
- JAEGER_SERVICE_PORT
- JAEGER_SERVICE_HOST
- GRAFANA_PORT
- GRAFANA_HOST
- JAEGER_PORT
- JAEGER_HOST
- OTEL_COLLECTOR_HOST
- IMAGE_PROVIDER_HOST
- IMAGE_PROVIDER_PORT
Expand Down Expand Up @@ -558,7 +558,7 @@ services:
memory: 400M
restart: unless-stopped
ports:
- "${JAEGER_SERVICE_PORT}" # Jaeger UI
- "${JAEGER_PORT}" # Jaeger UI
- "${OTEL_COLLECTOR_PORT_GRPC}"
environment:
- METRICS_STORAGE_TYPE=prometheus
Expand All @@ -579,7 +579,7 @@ services:
- ./src/grafana/grafana.ini:/etc/grafana/grafana.ini
- ./src/grafana/provisioning/:/etc/grafana/provisioning/
ports:
- "${GRAFANA_SERVICE_PORT}"
- "${GRAFANA_PORT}"
logging: *logging

# OpenTelemetry Collector
Expand Down Expand Up @@ -636,7 +636,7 @@ services:
memory: 300M
restart: unless-stopped
ports:
- "${PROMETHEUS_SERVICE_PORT}:${PROMETHEUS_SERVICE_PORT}"
- "${PROMETHEUS_PORT}:${PROMETHEUS_PORT}"
logging: *logging

# OpenSearch
Expand Down
22 changes: 11 additions & 11 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ services:
memory: 120M
restart: unless-stopped
environment:
- KAFKA_SERVICE_ADDR
- KAFKA_ADDR
- OTEL_EXPORTER_OTLP_ENDPOINT=http://${OTEL_COLLECTOR_HOST}:${OTEL_COLLECTOR_PORT_HTTP}
- OTEL_EXPORTER_OTLP_METRICS_TEMPORALITY_PREFERENCE
- OTEL_RESOURCE_ATTRIBUTES
Expand Down Expand Up @@ -140,7 +140,7 @@ services:
- PAYMENT_ADDR
- PRODUCT_CATALOG_ADDR
- SHIPPING_ADDR
- KAFKA_SERVICE_ADDR
- KAFKA_ADDR
- OTEL_EXPORTER_OTLP_ENDPOINT
- OTEL_EXPORTER_OTLP_METRICS_TEMPORALITY_PREFERENCE
- OTEL_RESOURCE_ATTRIBUTES
Expand Down Expand Up @@ -240,7 +240,7 @@ services:
environment:
- FLAGD_HOST
- FLAGD_PORT
- KAFKA_SERVICE_ADDR
- KAFKA_ADDR
- OTEL_EXPORTER_OTLP_ENDPOINT=http://${OTEL_COLLECTOR_HOST}:${OTEL_COLLECTOR_PORT_HTTP}
- OTEL_EXPORTER_OTLP_METRICS_TEMPORALITY_PREFERENCE
- OTEL_INSTRUMENTATION_KAFKA_EXPERIMENTAL_SPAN_ATTRIBUTES=true
Expand Down Expand Up @@ -335,10 +335,10 @@ services:
- FRONTEND_HOST
- LOCUST_WEB_HOST
- LOCUST_WEB_PORT
- GRAFANA_SERVICE_PORT
- GRAFANA_SERVICE_HOST
- JAEGER_SERVICE_PORT
- JAEGER_SERVICE_HOST
- GRAFANA_PORT
- GRAFANA_HOST
- JAEGER_PORT
- JAEGER_HOST
- OTEL_COLLECTOR_HOST
- IMAGE_PROVIDER_HOST
- IMAGE_PROVIDER_PORT
Expand Down Expand Up @@ -643,7 +643,7 @@ services:
container_name: kafka
build:
context: ./
dockerfile: ${KAFKA_SERVICE_DOCKERFILE}
dockerfile: ${KAFKA_DOCKERFILE}
cache_from:
- ${IMAGE_NAME}:${IMAGE_VERSION}-kafka
args:
Expand Down Expand Up @@ -704,7 +704,7 @@ services:
memory: 1200M
restart: unless-stopped
ports:
- "${JAEGER_SERVICE_PORT}" # Jaeger UI
- "${JAEGER_PORT}" # Jaeger UI
- "${OTEL_COLLECTOR_PORT_GRPC}"
environment:
- METRICS_STORAGE_TYPE=prometheus
Expand All @@ -725,7 +725,7 @@ services:
- ./src/grafana/grafana.ini:/etc/grafana/grafana.ini
- ./src/grafana/provisioning/:/etc/grafana/provisioning/
ports:
- "${GRAFANA_SERVICE_PORT}"
- "${GRAFANA_PORT}"
logging: *logging

# OpenTelemetry Collector
Expand Down Expand Up @@ -782,7 +782,7 @@ services:
memory: 300M
restart: unless-stopped
ports:
- "${PROMETHEUS_SERVICE_PORT}:${PROMETHEUS_SERVICE_PORT}"
- "${PROMETHEUS_PORT}:${PROMETHEUS_PORT}"
logging: *logging

# OpenSearch
Expand Down
4 changes: 2 additions & 2 deletions src/accounting/Consumer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@ public Consumer(ILogger<Consumer> logger)
{
_logger = logger;

var servers = Environment.GetEnvironmentVariable("KAFKA_SERVICE_ADDR")
?? throw new ArgumentNullException("KAFKA_SERVICE_ADDR");
var servers = Environment.GetEnvironmentVariable("KAFKA_ADDR")
?? throw new ArgumentNullException("KAFKA_ADDR");

_consumer = BuildConsumer(servers);
_consumer.Subscribe(TopicName);
Expand Down
2 changes: 1 addition & 1 deletion src/checkout/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -197,7 +197,7 @@ func main() {
svc.paymentSvcClient = pb.NewPaymentServiceClient(c)
defer c.Close()

svc.kafkaBrokerSvcAddr = os.Getenv("KAFKA_SERVICE_ADDR")
svc.kafkaBrokerSvcAddr = os.Getenv("KAFKA_ADDR")

if svc.kafkaBrokerSvcAddr != "" {
svc.KafkaProducerClient, err = kafka.CreateKafkaProducer([]string{svc.kafkaBrokerSvcAddr}, log)
Expand Down
4 changes: 2 additions & 2 deletions src/fraud-detection/src/main/kotlin/frauddetection/main.kt
Original file line number Diff line number Diff line change
Expand Up @@ -39,9 +39,9 @@ fun main() {
props[KEY_DESERIALIZER_CLASS_CONFIG] = StringDeserializer::class.java.name
props[VALUE_DESERIALIZER_CLASS_CONFIG] = ByteArrayDeserializer::class.java.name
props[GROUP_ID_CONFIG] = groupID
val bootstrapServers = System.getenv("KAFKA_SERVICE_ADDR")
val bootstrapServers = System.getenv("KAFKA_ADDR")
if (bootstrapServers == null) {
println("KAFKA_SERVICE_ADDR is not supplied")
println("KAFKA_ADDR is not supplied")
exitProcess(1)
}
props[BOOTSTRAP_SERVERS_CONFIG] = bootstrapServers
Expand Down
8 changes: 4 additions & 4 deletions src/frontendproxy/envoy.tmpl.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -258,8 +258,8 @@ static_resources:
- endpoint:
address:
socket_address:
address: ${GRAFANA_SERVICE_HOST}
port_value: ${GRAFANA_SERVICE_PORT}
address: ${GRAFANA_HOST}
port_value: ${GRAFANA_PORT}
- name: jaeger
type: STRICT_DNS
lb_policy: ROUND_ROBIN
Expand All @@ -270,8 +270,8 @@ static_resources:
- endpoint:
address:
socket_address:
address: ${JAEGER_SERVICE_HOST}
port_value: ${JAEGER_SERVICE_PORT}
address: ${JAEGER_HOST}
port_value: ${JAEGER_PORT}
admin:
address:
socket_address:
Expand Down
Loading