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

OpenTracingCollector fixes #18307

Merged
merged 3 commits into from
Jul 19, 2023
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
5 changes: 5 additions & 0 deletions testing/trino-testing-containers/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,11 @@
<artifactId>log</artifactId>
</dependency>

<dependency>
<groupId>io.airlift</groupId>
<artifactId>units</artifactId>
</dependency>

<dependency>
<groupId>io.minio</groupId>
<artifactId>minio</artifactId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@
*/
package io.trino.testing.containers;

import io.airlift.units.DataSize;

import java.io.File;
import java.io.IOException;
import java.io.UncheckedIOException;
Expand All @@ -27,24 +29,16 @@
import java.util.stream.Stream;

import static com.google.common.net.UrlEscapers.urlFragmentEscaper;
import static io.airlift.units.DataSize.Unit.GIGABYTE;

public class OpenTracingCollector
extends BaseTestContainer
{
private static final Path storageDirectory;

static {
try {
storageDirectory = Files.createTempDirectory("tracing-collector");
}
catch (IOException e) {
throw new UncheckedIOException(e);
}
}

private static final int COLLECTOR_PORT = 4317;
private static final int HTTP_PORT = 16686;

private final Path storageDirectory;

public OpenTracingCollector()
{
super(
Expand All @@ -67,8 +61,15 @@ public OpenTracingCollector()
"--badger.maintenance-interval=30s"));

withCreateContainerModifier(command -> command.getHostConfig()
.withMemory(2 * 1024 * 1024 * 1024L)); // 1 GB limit
mountDirectory(storageDirectory.toString(), "/badger");
.withMemory(DataSize.of(1, GIGABYTE).toBytes()));

try {
this.storageDirectory = Files.createTempDirectory("tracing-collector");
mountDirectory(storageDirectory.toString(), "/badger");
}
catch (IOException e) {
throw new UncheckedIOException(e);
}
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -800,7 +800,7 @@ protected SELF self()
public DistributedQueryRunner build()
throws Exception
{
String tracingEnabled = firstNonNull(getenv("TRACING"), "false");
String tracingEnabled = firstNonNull(getenv("TESTS_TRACING_ENABLED"), "false");
if (parseBoolean(tracingEnabled) || tracingEnabled.equals("1")) {
withTracing();
}
Expand Down