-
Notifications
You must be signed in to change notification settings - Fork 2.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
The integration utilizes the HttpSender interface introduced in OTel 1.28 and is based on the Vert.x HTTP Client
- Loading branch information
Showing
25 changed files
with
508 additions
and
155 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
18 changes: 18 additions & 0 deletions
18
.../java/io/quarkus/opentelemetry/runtime/exporter/otlp/NonCopyingByteArrayOutputStream.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
package io.quarkus.opentelemetry.runtime.exporter.otlp; | ||
|
||
import java.io.ByteArrayOutputStream; | ||
|
||
/** | ||
* Used when we know that the stream will never be used again, therefore we can skip copying the data | ||
* WARNING: This should only be used when we know that we will write at least this many bytes to the stream | ||
*/ | ||
final class NonCopyingByteArrayOutputStream extends ByteArrayOutputStream { | ||
NonCopyingByteArrayOutputStream(int size) { | ||
super(size); | ||
} | ||
|
||
@Override | ||
public byte[] toByteArray() { | ||
return buf; | ||
} | ||
} |
26 changes: 26 additions & 0 deletions
26
...untime/src/main/java/io/quarkus/opentelemetry/runtime/exporter/otlp/OtlpExporterUtil.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
package io.quarkus.opentelemetry.runtime.exporter.otlp; | ||
|
||
import java.net.URI; | ||
import java.util.Locale; | ||
|
||
final class OtlpExporterUtil { | ||
|
||
private OtlpExporterUtil() { | ||
} | ||
|
||
static int getPort(URI uri) { | ||
int originalPort = uri.getPort(); | ||
if (originalPort > -1) { | ||
return originalPort; | ||
} | ||
|
||
if (isHttps(uri)) { | ||
return 443; | ||
} | ||
return 80; | ||
} | ||
|
||
static boolean isHttps(URI uri) { | ||
return "https".equals(uri.getScheme().toLowerCase(Locale.ROOT)); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.