diff --git a/README.md b/README.md index b7e1129c..cbae3169 100644 --- a/README.md +++ b/README.md @@ -43,7 +43,11 @@ The final artifact is in `javaagent/build/libs/hypertrace-agent--all.ja Download the [latest version](https://github.com/hypertrace/javaagent/releases/latest/download/hypertrace-agent-all.jar). ```bash -HT_REPORTING_ENDPOINT=http://localhost:4317 java -javaagent:javaagent/build/libs/hypertrace-agent--all.jar -jar app.jar +HT_REPORTING_ENDPOINT=http://localhost:5442 java -javaagent:javaagent/build/libs/hypertrace-agent--all.jar -jar app.jar +``` +If TPA is configured with TLS server +```bash +HT_REPORTING_ENDPOINT=https://localhost:5443 java -javaagent:javaagent/build/libs/hypertrace-agent--all.jar -jar app.jar ``` By default the agent uses Otlp exporter. diff --git a/example-config.yaml b/example-config.yaml index 41834b12..675f4179 100644 --- a/example-config.yaml +++ b/example-config.yaml @@ -1,3 +1,3 @@ service_name: service_name reporting: - endpoint: http://localhost:4317 + endpoint: http://localhost:5442 diff --git a/otel-extensions/src/main/java/org/hypertrace/agent/otel/extensions/config/HypertraceConfig.java b/otel-extensions/src/main/java/org/hypertrace/agent/otel/extensions/config/HypertraceConfig.java index 372b6662..5af9065d 100644 --- a/otel-extensions/src/main/java/org/hypertrace/agent/otel/extensions/config/HypertraceConfig.java +++ b/otel-extensions/src/main/java/org/hypertrace/agent/otel/extensions/config/HypertraceConfig.java @@ -78,7 +78,7 @@ private static List initDefaultContentTypes() { static final String DEFAULT_SERVICE_NAME = "unknown"; // Default reporting endpoint for traces and metrics - static final String DEFAULT_REPORTING_ENDPOINT = "http://localhost:4317"; + static final String DEFAULT_REPORTING_ENDPOINT = "http://localhost:5442"; // 128 KiB static final int DEFAULT_BODY_MAX_SIZE_BYTES = 128 * 1024; diff --git a/otel-extensions/src/main/proto b/otel-extensions/src/main/proto index 800c2631..c23ea673 160000 --- a/otel-extensions/src/main/proto +++ b/otel-extensions/src/main/proto @@ -1 +1 @@ -Subproject commit 800c2631ff6026340ba8bee2681fa8f0cf5a9f75 +Subproject commit c23ea67314a32edf1a0073d650c5370960db7443 diff --git a/otel-extensions/src/test/java/org/hypertrace/agent/otel/extensions/config/HypertraceConfigTest.java b/otel-extensions/src/test/java/org/hypertrace/agent/otel/extensions/config/HypertraceConfigTest.java index b0a76d70..c6253245 100644 --- a/otel-extensions/src/test/java/org/hypertrace/agent/otel/extensions/config/HypertraceConfigTest.java +++ b/otel-extensions/src/test/java/org/hypertrace/agent/otel/extensions/config/HypertraceConfigTest.java @@ -137,9 +137,9 @@ private void assertConfig(AgentConfig agentConfig) { Assertions.assertEquals( "/foo/bar/example.pem", agentConfig.getReporting().getCertFile().getValue()); Assertions.assertEquals( - "http://localhost:4317", agentConfig.getReporting().getEndpoint().getValue()); + "http://localhost:5442", agentConfig.getReporting().getEndpoint().getValue()); Assertions.assertEquals( - "http://localhost:4317", agentConfig.getReporting().getMetricEndpoint().getValue()); + "http://localhost:5442", agentConfig.getReporting().getMetricEndpoint().getValue()); Assertions.assertEquals(true, agentConfig.getReporting().getSecure().getValue()); Assertions.assertEquals(16, agentConfig.getDataCapture().getBodyMaxSizeBytes().getValue()); Assertions.assertEquals( @@ -172,7 +172,7 @@ public void configWithSystemProps() throws IOException { } @Test - @SetEnvironmentVariable(key = "HT_REPORTING_ENDPOINT", value = "http://oltp.hypertrace.org:4317") + @SetEnvironmentVariable(key = "HT_REPORTING_ENDPOINT", value = "http://oltp.hypertrace.org:5442") public void complexConfig() throws IOException { // GIVEN a config file with a non-default reporting endpoint and an env-var with a different // non-default otlp reporting endpoint @@ -180,7 +180,7 @@ public void complexConfig() throws IOException { // WHEN we load the config AgentConfig agentConfig = HypertraceConfig.load(resource.getPath()); // VERIFY the trace and metric endpoints are the both the value of the env var - String expectedEndpoint = "http://oltp.hypertrace.org:4317"; + String expectedEndpoint = "http://oltp.hypertrace.org:5442"; Assertions.assertEquals(expectedEndpoint, agentConfig.getReporting().getEndpoint().getValue()); Assertions.assertEquals( expectedEndpoint, agentConfig.getReporting().getMetricEndpoint().getValue()); @@ -238,7 +238,7 @@ void nonDefaultReportingEndpoint() throws IOException { // VERIFY the trace reporting type is OTLP Assertions.assertEquals( TraceReporterType.OTLP, agentConfig.getReporting().getTraceReporterType()); - String expectedReportingEndpoint = "http://example.com:4317"; + String expectedReportingEndpoint = "http://example.com:5442"; // VERIFY the trace reporting and metric reporting endpoints are both the specified value Assertions.assertEquals( expectedReportingEndpoint, agentConfig.getReporting().getEndpoint().getValue()); @@ -257,10 +257,10 @@ void nonDefaultMetricsEndpoint() throws IOException { TraceReporterType.OTLP, agentConfig.getReporting().getTraceReporterType()); // VERIFY the trace reporting endpoint is still the default value Assertions.assertEquals( - "http://localhost:4317", agentConfig.getReporting().getEndpoint().getValue()); + "http://localhost:5442", agentConfig.getReporting().getEndpoint().getValue()); // VERIFY the metric reporting endpoint is the specified value Assertions.assertEquals( - "http://example.com:4317", agentConfig.getReporting().getMetricEndpoint().getValue()); + "http://example.com:5442", agentConfig.getReporting().getMetricEndpoint().getValue()); } @Test diff --git a/otel-extensions/src/test/resources/config.yaml b/otel-extensions/src/test/resources/config.yaml index b8afeeef..b9116b83 100644 --- a/otel-extensions/src/test/resources/config.yaml +++ b/otel-extensions/src/test/resources/config.yaml @@ -4,8 +4,8 @@ enabled: false propagationFormats: - B3 reporting: - endpoint: http://localhost:4317 - metric_endpoint: http://localhost:4317 + endpoint: http://localhost:5442 + metric_endpoint: http://localhost:5442 secure: true trace_reporter_type: OTLP metric_reporter_type: METRIC_REPORTER_TYPE_OTLP diff --git a/otel-extensions/src/test/resources/nonDefaultDataCaptureConfig.yaml b/otel-extensions/src/test/resources/nonDefaultDataCaptureConfig.yaml index b7382a5f..58d42095 100644 --- a/otel-extensions/src/test/resources/nonDefaultDataCaptureConfig.yaml +++ b/otel-extensions/src/test/resources/nonDefaultDataCaptureConfig.yaml @@ -4,8 +4,8 @@ enabled: false propagationFormats: - B3 reporting: - endpoint: http://localhost:4317 - metric_endpoint: http://localhost:4317 + endpoint: http://localhost:5442 + metric_endpoint: http://localhost:5442 secure: true trace_reporter_type: OTLP metric_reporter_type: METRIC_REPORTER_TYPE_OTLP diff --git a/otel-extensions/src/test/resources/nonDefaultMetricsEndpoint.yaml b/otel-extensions/src/test/resources/nonDefaultMetricsEndpoint.yaml index 9bd250f2..5fd3bf43 100644 --- a/otel-extensions/src/test/resources/nonDefaultMetricsEndpoint.yaml +++ b/otel-extensions/src/test/resources/nonDefaultMetricsEndpoint.yaml @@ -1,3 +1,3 @@ service_name: service reporting: - metric_endpoint: http://example.com:4317 + metric_endpoint: http://example.com:5442 diff --git a/otel-extensions/src/test/resources/nonDefaultReportingEndpoint.yaml b/otel-extensions/src/test/resources/nonDefaultReportingEndpoint.yaml index 89565184..1750933f 100644 --- a/otel-extensions/src/test/resources/nonDefaultReportingEndpoint.yaml +++ b/otel-extensions/src/test/resources/nonDefaultReportingEndpoint.yaml @@ -1,3 +1,3 @@ service_name: service reporting: - endpoint: http://example.com:4317 + endpoint: http://example.com:5442 diff --git a/otel-extensions/src/test/resources/zipkinConfig.yaml b/otel-extensions/src/test/resources/zipkinConfig.yaml index f2014b64..4cf7b801 100644 --- a/otel-extensions/src/test/resources/zipkinConfig.yaml +++ b/otel-extensions/src/test/resources/zipkinConfig.yaml @@ -1,4 +1,4 @@ service_name: service reporting: trace_reporter_type: ZIPKIN - endpoint: http://example.com:9411/api/v2/spans + endpoint: http://example.com:5442/api/v2/spans diff --git a/smoke-tests/src/test/groovy/org/hypertrace/agent/smoketest/SmokeTest.groovy b/smoke-tests/src/test/groovy/org/hypertrace/agent/smoketest/SmokeTest.groovy index 73774acf..c27eaebe 100644 --- a/smoke-tests/src/test/groovy/org/hypertrace/agent/smoketest/SmokeTest.groovy +++ b/smoke-tests/src/test/groovy/org/hypertrace/agent/smoketest/SmokeTest.groovy @@ -84,7 +84,7 @@ abstract class SmokeTest extends Specification { .withEnv("OTEL_BSP_SCHEDULE_DELAY", "10") .withEnv("OTEL_EXPORTER_OTLP_ENDPOINT", "http://collector:55680") .withEnv("HT_SERVICE_NAME", "CIService") - .withEnv("HT_REPORTING_ENDPOINT", "http://collector:4317") + .withEnv("HT_REPORTING_ENDPOINT", "http://collector:5442") .withEnv("OTEL_TRACES_EXPORTER", "otlp") .withImagePullPolicy(PullPolicy.alwaysPull()) .withEnv(extraEnv) diff --git a/smoke-tests/src/test/java/org/hypertrace/agent/smoketest/AbstractSmokeTest.java b/smoke-tests/src/test/java/org/hypertrace/agent/smoketest/AbstractSmokeTest.java index 19693b8b..f4aa13e2 100644 --- a/smoke-tests/src/test/java/org/hypertrace/agent/smoketest/AbstractSmokeTest.java +++ b/smoke-tests/src/test/java/org/hypertrace/agent/smoketest/AbstractSmokeTest.java @@ -63,7 +63,7 @@ public abstract class AbstractSmokeTest { private static final String NETWORK_ALIAS_OTEL_COLLECTOR = "collector"; private static final String NETWORK_ALIAS_OTEL_MOCK_STORAGE = "backend"; private static final String OTEL_EXPORTER_ENDPOINT = - String.format("http://%s:4317", NETWORK_ALIAS_OTEL_COLLECTOR); + String.format("http://%s:5442", NETWORK_ALIAS_OTEL_COLLECTOR); // note - with OTEL 1.13, the value of this manifest property is specified // as the version in the InstrumentationLibrary class. diff --git a/smoke-tests/src/test/java/org/hypertrace/agent/smoketest/OpenTelemetryCollector.java b/smoke-tests/src/test/java/org/hypertrace/agent/smoketest/OpenTelemetryCollector.java index d4df6595..64c80281 100644 --- a/smoke-tests/src/test/java/org/hypertrace/agent/smoketest/OpenTelemetryCollector.java +++ b/smoke-tests/src/test/java/org/hypertrace/agent/smoketest/OpenTelemetryCollector.java @@ -25,10 +25,10 @@ public class OpenTelemetryCollector extends GenericContainer { public static final int JAEGER_COLLECTOR_THRIFT_PORT = 14268; - public static final int JAEGER_COLLECTOR_GRPC_PORT = 14250; - public static final int ZIPKIN_PORT = 9411; - public static final int OTLP_PORT = 4317; - public static final int HEALTH_CHECK_PORT = 13133; + public static final int JAEGER_COLLECTOR_GRPC_PORT = 14250; + public static final int HTTP_REVERSE_PROXY_PORT = 5442; + public static final int HTTPS_REVERSE_PROXY_PORT = 5443; + public static final int HEALTH_CHECK_PORT = 13133; public OpenTelemetryCollector(String dockerImage) { super(DockerImageName.parse(dockerImage)); @@ -41,8 +41,9 @@ protected void init() { HEALTH_CHECK_PORT, JAEGER_COLLECTOR_THRIFT_PORT, JAEGER_COLLECTOR_GRPC_PORT, - ZIPKIN_PORT, - OTLP_PORT); + HTTP_REVERSE_PROXY_PORT, + HTTPS_REVERSE_PROXY_PORT + ); } public static class BoundPortHttpWaitStrategy extends HttpWaitStrategy { diff --git a/smoke-tests/src/test/resources/ht-config-all-disabled.yaml b/smoke-tests/src/test/resources/ht-config-all-disabled.yaml index 6fb4c4d6..380cac95 100644 --- a/smoke-tests/src/test/resources/ht-config-all-disabled.yaml +++ b/smoke-tests/src/test/resources/ht-config-all-disabled.yaml @@ -1,6 +1,6 @@ service_name: app_under_test reporting: - endpoint: http://localhost:4317 + endpoint: http://localhost:5442 trace_reporter_type: OTLP secure: true data_capture: diff --git a/smoke-tests/src/test/resources/ht-config.yaml b/smoke-tests/src/test/resources/ht-config.yaml index 4de2b08f..dba1c96d 100644 --- a/smoke-tests/src/test/resources/ht-config.yaml +++ b/smoke-tests/src/test/resources/ht-config.yaml @@ -1,4 +1,4 @@ serviceName: app_under_test reporting: - endpoint: http://localhost:4317 + endpoint: http://localhost:5442 trace_reporter_type: OTLP