diff --git a/TrafficCapture/dockerSolution/README.md b/TrafficCapture/dockerSolution/README.md index dba70daa2..a9fb1bf9f 100644 --- a/TrafficCapture/dockerSolution/README.md +++ b/TrafficCapture/dockerSolution/README.md @@ -14,6 +14,33 @@ While in the TrafficCapture directory, run the following command: `./gradlew :dockerSolution:composeUp` +### Interacting with the Docker Solution + +A sample source cluster (running Elasticsearch 7.10) is set up with the Capture Proxy running in front of it. To route +calls through the Capture Proxy, send requests to `localhost:9200` with the default credentials (admin, admin), e.g.: +```sh +curl --insecure https://localhost:9200/_cat/indices -u 'admin:admin' +``` + +You can send the same calls to the source cluster while bypassing the Capture Proxy (calls will not be relayed to the +target cluster) via `localhost:19200`, and to the target cluster directly at `localhost:29200`. + +For sample data that exercises various endpoints with a range of datatypes, you can execute a shell in the Migration +Console (`docker exec -i -t $(docker ps -aqf "ancestor=migrations/migration_console:latest") bash` or via the Docker +console) and run `./runTestBenchmarks.sh`. By default, this runs four short test workloads from +[Opensearch-Benchmark](https://github.com/opensearch-project/opensearch-benchmark) against the Capture Proxy endpoint +(9200). The Migration Console contains other utility functions (`./catIndices.sh`, `kafka-tools`, etc.) to interact +with the various containers of the solution. + +With the default docker-compose configuration launched with :dockerSolution:composeUp, instrumentation containers +will be started (see below for other options). You can access the metrics generated by the solution in Grafana. +While the solution is running, go to [http://localhost:3000](http://localhost:3000/) and enter the default credentials +(admin, admin). Connections to Jaeger and Prometheus are automatically provisioned (see them under +`Connections->Data sources`), so you can go directly to `Explore` and define a query using the supplied data +from either data source. Traces for the capture proxy and replayer are available via Jaeger at +[http://localhost:16686](http://localhost:16686). + + ### Running with different telemetry flavors. By default, composeUp will run an otel-collector that exports instrumentation to other local containers within the diff --git a/TrafficCapture/dockerSolution/build.gradle b/TrafficCapture/dockerSolution/build.gradle index dbd5a07c5..a056deada 100644 --- a/TrafficCapture/dockerSolution/build.gradle +++ b/TrafficCapture/dockerSolution/build.gradle @@ -19,7 +19,8 @@ dependencies { def dockerFilesForExternalServices = [ "elasticsearchWithSearchGuard": "elasticsearch_searchguard", "migrationConsole": "migration_console", - "otelCollector": "otel_collector" + "otelCollector": "otel_collector", + "grafana": "grafana" ] // Create the static docker files that aren't hosting migrations java code from this repo dockerFilesForExternalServices.each { projectName, dockerImageName -> @@ -74,6 +75,7 @@ task buildDockerImages { dependsOn buildDockerImage_elasticsearchWithSearchGuard dependsOn buildDockerImage_migrationConsole dependsOn buildDockerImage_otelCollector + dependsOn buildDockerImage_grafana dependsOn buildDockerImage_trafficCaptureProxyServer dependsOn buildDockerImage_trafficReplayer diff --git a/TrafficCapture/dockerSolution/src/main/docker/docker-compose.yml b/TrafficCapture/dockerSolution/src/main/docker/docker-compose.yml index 90c180717..69ed9072d 100644 --- a/TrafficCapture/dockerSolution/src/main/docker/docker-compose.yml +++ b/TrafficCapture/dockerSolution/src/main/docker/docker-compose.yml @@ -28,7 +28,7 @@ services: - COLLECTOR_OTLP_ENABLED=true grafana: - image: grafana/grafana:latest + image: 'migrations/grafana:latest' networks: - migrations ports: diff --git a/TrafficCapture/dockerSolution/src/main/docker/grafana/Dockerfile b/TrafficCapture/dockerSolution/src/main/docker/grafana/Dockerfile new file mode 100644 index 000000000..57b951496 --- /dev/null +++ b/TrafficCapture/dockerSolution/src/main/docker/grafana/Dockerfile @@ -0,0 +1,3 @@ +FROM grafana/grafana:latest + +COPY datasources.yaml /usr/share/grafana/conf/provisioning/datasources/ diff --git a/TrafficCapture/dockerSolution/src/main/docker/grafana/datasources.yaml b/TrafficCapture/dockerSolution/src/main/docker/grafana/datasources.yaml new file mode 100644 index 000000000..f466234e3 --- /dev/null +++ b/TrafficCapture/dockerSolution/src/main/docker/grafana/datasources.yaml @@ -0,0 +1,22 @@ +apiVersion: 1 +datasources: + - name: Jaeger + type: jaeger + url: http://jaeger:16686 + basicAuth: false + isDefault: false + readOnly: false + jsonData: {} + - name: Prometheus + type: prometheus + url: http://prometheus:9090 + access: proxy + basicAuth: false + isDefault: true + jsonData: + httpMethod: POST + prometheusType: Prometheus + exemplarTraceIdDestinations: + - name: trace_id + urlDisplayLabel: Jaeger + readOnly: false