Skip to content

Commit

Permalink
NH-37575: extract environment from endpoint so stage integration test…
Browse files Browse the repository at this point in the history
… pass
  • Loading branch information
cleverchuk committed Jun 26, 2024
1 parent eda48b5 commit 9e203c6
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -203,19 +203,25 @@ static void configOtelLogExport(ConfigContainer container) {

String[] fragments = collectorEndpoint.split("\\.");
String dataCell = "na-01";
String env = "cloud";

if (fragments.length > 2) {
// This is based on knowledge of the SWO url format where the third name from the left in
// the domain is the data-cell name and assumes this format will stay stable.
dataCell = fragments[2];
}

if (fragments.length > 3) {
env = fragments[3];
}

System.setProperty("otel.exporter.otlp.protocol", "grpc");
System.setProperty("otel.logs.exporter", "otlp");
System.setProperty(
"otel.exporter.otlp.logs.headers", String.format("authorization=Bearer %s", apiKey));
System.setProperty(
"otel.exporter.otlp.logs.endpoint",
String.format("https://otel.collector.%s.cloud.solarwinds.com", dataCell));
String.format("https://otel.collector.%s.%s.solarwinds.com", dataCell, env));
}
}

Expand Down
1 change: 0 additions & 1 deletion smoke-tests/src/test/java/com/solarwinds/SmokeTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -243,7 +243,6 @@ void assertThatJDBCInstrumentationIsApplied() {


@Test
@Disabled // Disabled because log linking doesn't work in staging at moment
void assertThatLogsAreExported() throws IOException {
String resultJson = new String(
Files.readAllBytes(namingConventions.local.k6Results(Configs.E2E.config.agents().get(0))));
Expand Down

0 comments on commit 9e203c6

Please sign in to comment.