From 21638f21414230fdbd609f45eae15f418c19ab6c Mon Sep 17 00:00:00 2001 From: Raja Kolli Date: Thu, 18 Jul 2024 15:35:37 +0530 Subject: [PATCH 1/2] feat : expose grafanaURL When user wants to access Grafana dashboard listening to 3000, this method helps to achieve it easily. --- .../java/org/testcontainers/grafana/LgtmStackContainer.java | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/modules/grafana/src/main/java/org/testcontainers/grafana/LgtmStackContainer.java b/modules/grafana/src/main/java/org/testcontainers/grafana/LgtmStackContainer.java index 218b37c0da0..2279ca2c249 100644 --- a/modules/grafana/src/main/java/org/testcontainers/grafana/LgtmStackContainer.java +++ b/modules/grafana/src/main/java/org/testcontainers/grafana/LgtmStackContainer.java @@ -61,4 +61,8 @@ public String getOtlpHttpUrl() { public String getPromehteusHttpUrl() { return "http://" + getHost() + ":" + getMappedPort(PROMETHEUS_PORT); } + + public String getGrafanaHttpUrl() { + return "http://" + getHost() + ":" + getMappedPort(GRAFANA_PORT); + } } From 2506abc11189a0043e2e252e06282631c7c6d8de Mon Sep 17 00:00:00 2001 From: Raja Kolli Date: Thu, 18 Jul 2024 15:49:59 +0530 Subject: [PATCH 2/2] Update grafana dashboard URL --- .../java/org/testcontainers/grafana/LgtmStackContainer.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/grafana/src/main/java/org/testcontainers/grafana/LgtmStackContainer.java b/modules/grafana/src/main/java/org/testcontainers/grafana/LgtmStackContainer.java index 2279ca2c249..080be6d6eaf 100644 --- a/modules/grafana/src/main/java/org/testcontainers/grafana/LgtmStackContainer.java +++ b/modules/grafana/src/main/java/org/testcontainers/grafana/LgtmStackContainer.java @@ -47,7 +47,7 @@ public LgtmStackContainer(DockerImageName image) { @Override protected void containerIsStarted(InspectContainerResponse containerInfo) { - log.info("Access to the Grafana dashboard: {}", getOtlpHttpUrl()); + log.info("Access to the Grafana dashboard: {}", getGrafanaHttpUrl()); } public String getOtlpGrpcUrl() {