diff --git a/client-app/src/main/java/com/instana/test/Application.java b/client-app/src/main/java/com/instana/test/Application.java index 6699156..ec475d1 100644 --- a/client-app/src/main/java/com/instana/test/Application.java +++ b/client-app/src/main/java/com/instana/test/Application.java @@ -85,7 +85,7 @@ static class SchedulingConfiguration { @Autowired private ApiImpl apiImpl; - @Scheduled(fixedRate=1_000) + @Scheduled(fixedRate = 1, initialDelay = 120_000) @Span(value="recurrent-task", type = Span.Type.ENTRY) void issueRequest() { apiImpl.issueRequest(); @@ -93,4 +93,4 @@ void issueRequest() { } -} \ No newline at end of file +} diff --git a/docker-compose.yml b/docker-compose.yml index 39a46e3..2b30026 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -1,7 +1,49 @@ version: '3' services: - client-app: + server-app: + build: + context: ./server-app + networks: + nginxmesh: + aliases: + - server-app + environment: + - INSTANA_DEV=1 + - SERVER_PORT=8080 + healthcheck: + test: ["CMD", "ping", "localhost:8080"] + interval: 8s + timeout: 30s + retries: 25 + expose: + - "8080" + + client-app-1: + build: + context: ./client-app + networks: + - nginxmesh + environment: + - INSTANA_DEV=1 + - target_url=http://nginx-gateway:8080/nginx-demo + depends_on: + agent: + condition: service_healthy + + client-app-2: + build: + context: ./client-app + networks: + - nginxmesh + environment: + - INSTANA_DEV=1 + - target_url=http://nginx-gateway:8080/nginx-demo + depends_on: + agent: + condition: service_healthy + + client-app-3: build: context: ./client-app networks: @@ -9,6 +51,90 @@ services: environment: - INSTANA_DEV=1 - target_url=http://nginx-gateway:8080/nginx-demo + depends_on: + agent: + condition: service_healthy + + client-app-4: + build: + context: ./client-app + networks: + - nginxmesh + environment: + - INSTANA_DEV=1 + - target_url=http://nginx-gateway:8080/nginx-demo + depends_on: + agent: + condition: service_healthy + + client-app-5: + build: + context: ./client-app + networks: + - nginxmesh + environment: + - INSTANA_DEV=1 + - target_url=http://nginx-gateway:8080/nginx-demo + depends_on: + agent: + condition: service_healthy + + client-app-6: + build: + context: ./client-app + networks: + - nginxmesh + environment: + - INSTANA_DEV=1 + - target_url=http://nginx-gateway:8080/nginx-demo + depends_on: + agent: + condition: service_healthy + + client-app-7: + build: + context: ./client-app + networks: + - nginxmesh + environment: + - INSTANA_DEV=1 + - target_url=http://nginx-gateway:8080/nginx-demo + depends_on: + agent: + condition: service_healthy + + client-app-8: + build: + context: ./client-app + networks: + - nginxmesh + environment: + - INSTANA_DEV=1 + - target_url=http://nginx-gateway:8080/nginx-demo + depends_on: + agent: + condition: service_healthy + + client-app-9: + build: + context: ./client-app + networks: + - nginxmesh + environment: + - INSTANA_DEV=1 + - target_url=http://nginx-gateway:8080/nginx-demo + + client-app-10: + build: + context: ./client-app + networks: + - nginxmesh + environment: + - INSTANA_DEV=1 + - target_url=http://nginx-gateway:8080/nginx-demo + depends_on: + agent: + condition: service_healthy nginx: build: @@ -24,24 +150,14 @@ services: volumes: - ./nginx/nginx.conf:/etc/nginx/nginx.conf - ./nginx/instana-config.json:/etc/instana-config.json - # Instana developers only: Include the following lines to override the nginx module, for local testing - #- ./nginx/ngx_http_opentracing_module.so:/opt/instana/nginx/ngx_http_opentracing_module.so:ro - #- ./nginx/ngx_http_opentracing_module.so:/usr/lib/nginx/modules/ngx_http_opentracing_module.so:ro - expose: - - "8080" - - server-app: - build: - context: ./server-app - networks: - nginxmesh: - aliases: - - server-app - environment: - - INSTANA_DEV=1 - - SERVER_PORT=8080 + # Include the following lines to override the nginx module, for local testing + # - ./nginx/ngx_http_opentracing_module.so:/opt/instana/nginx/ngx_http_opentracing_module.so:ro + # - ./nginx/ngx_http_opentracing_module.so:/usr/lib/nginx/modules/ngx_http_opentracing_module.so:ro expose: - "8080" + depends_on: + agent: + condition: service_healthy agent: image: icr.io/instana/agent @@ -64,6 +180,9 @@ services: - INSTANA_DOWNLOAD_KEY=${download_key} - INSTANA_AGENT_KEY=${agent_key} - INSTANA_AGENT_ZONE=${agent_zone:-nginx-tracing-demo} + depends_on: + server-app: + condition: service_started healthcheck: test: ["CMD", "curl", "localhost:42699"] interval: 8s diff --git a/nginx/nginx.conf b/nginx/nginx.conf deleted file mode 100644 index cb947ed..0000000 --- a/nginx/nginx.conf +++ /dev/null @@ -1,32 +0,0 @@ -load_module modules/ngx_http_opentracing_module.so; - -events {} - -error_log /dev/stdout info; - -http { - error_log /dev/stdout info; - - opentracing_load_tracer /usr/local/lib/instana/libinstana_sensor.so /etc/instana-config.json; - opentracing_propagate_context; - - upstream backend { - server server-app:8080; - } - - server { - error_log /dev/stdout info; - listen 8080; - server_name localhost; - - location /nginx_status { - stub_status on; - access_log off; - allow all; # don't ever push in production something like this :-) - } - - location ^~ / { - proxy_pass http://backend; - } - } -} diff --git a/nginx/nginx.conf b/nginx/nginx.conf new file mode 120000 index 0000000..411067b --- /dev/null +++ b/nginx/nginx.conf @@ -0,0 +1 @@ +nginx.conf.location_enabled \ No newline at end of file