-
Notifications
You must be signed in to change notification settings - Fork 17
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add fork of Quarkus vertx-based gRPC exporters Create new module for exporters Bump version
- Loading branch information
Showing
23 changed files
with
804 additions
and
14 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
name: SmallRye Config | ||
release: | ||
current-version: 2.5.0 | ||
next-version: 2.5.1-SNAPSHOT | ||
next-version: 2.6.0-SNAPSHOT |
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
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
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
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
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
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
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
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,77 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> | ||
<modelVersion>4.0.0</modelVersion> | ||
<parent> | ||
<groupId>io.smallrye.opentelemetry</groupId> | ||
<artifactId>smallrye-opentelemetry-parent</artifactId> | ||
<version>2.6.0-SNAPSHOT</version> | ||
<relativePath>../../pom.xml</relativePath> | ||
</parent> | ||
|
||
<artifactId>smallrye-opentelemetry-exporters</artifactId> | ||
<name>SmallRye OpenTelemetry: Exporters</name> | ||
|
||
<dependencies> | ||
<dependency> | ||
<groupId>io.smallrye.opentelemetry</groupId> | ||
<artifactId>smallrye-opentelemetry-api</artifactId> | ||
</dependency> | ||
|
||
<dependency> | ||
<groupId>jakarta.enterprise</groupId> | ||
<artifactId>jakarta.enterprise.cdi-api</artifactId> | ||
<scope>provided</scope> | ||
</dependency> | ||
|
||
<!-- Test Dependencies --> | ||
<dependency> | ||
<groupId>org.junit.jupiter</groupId> | ||
<artifactId>junit-jupiter</artifactId> | ||
</dependency> | ||
<dependency> | ||
<groupId>org.awaitility</groupId> | ||
<artifactId>awaitility</artifactId> | ||
</dependency> | ||
<dependency> | ||
<groupId>org.jboss.weld</groupId> | ||
<artifactId>weld-junit5</artifactId> | ||
<exclusions> | ||
<exclusion> | ||
<groupId>javax.enterprise</groupId> | ||
<artifactId>cdi-api</artifactId> | ||
</exclusion> | ||
</exclusions> | ||
</dependency> | ||
<dependency> | ||
<groupId>io.smallrye.config</groupId> | ||
<artifactId>smallrye-config</artifactId> | ||
</dependency> | ||
<dependency> | ||
<groupId>io.smallrye.opentelemetry</groupId> | ||
<artifactId>smallrye-opentelemetry-config</artifactId> | ||
<scope>test</scope> | ||
</dependency> | ||
<dependency> | ||
<groupId>io.opentelemetry</groupId> | ||
<artifactId>opentelemetry-exporter-common</artifactId> | ||
</dependency> | ||
<dependency> | ||
<groupId>io.vertx</groupId> | ||
<artifactId>vertx-core</artifactId> | ||
<version>4.4.6</version> | ||
</dependency> | ||
<dependency> | ||
<groupId>io.vertx</groupId> | ||
<artifactId>vertx-grpc-client</artifactId> | ||
<version>4.4.6</version> | ||
</dependency> | ||
<dependency> | ||
<groupId>io.opentelemetry</groupId> | ||
<artifactId>opentelemetry-exporter-otlp-common</artifactId> | ||
</dependency> | ||
<dependency> | ||
<groupId>io.opentelemetry</groupId> | ||
<artifactId>opentelemetry-exporter-otlp</artifactId> | ||
</dependency> | ||
</dependencies> | ||
</project> |
25 changes: 25 additions & 0 deletions
25
.../src/main/java/io/smallrye/opentelemetry/implementation/exporters/BufferOutputStream.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,25 @@ | ||
package io.smallrye.opentelemetry.implementation.exporters; | ||
|
||
import java.io.IOException; | ||
import java.io.OutputStream; | ||
|
||
import io.vertx.core.buffer.Buffer; | ||
|
||
public class BufferOutputStream extends OutputStream { | ||
|
||
private final Buffer buffer; | ||
|
||
public BufferOutputStream(Buffer buffer) { | ||
this.buffer = buffer; | ||
} | ||
|
||
@Override | ||
public void write(byte[] b, int off, int len) throws IOException { | ||
buffer.appendBytes(b, off, len); | ||
} | ||
|
||
@Override | ||
public void write(int b) throws IOException { | ||
buffer.appendInt(b); | ||
} | ||
} |
36 changes: 36 additions & 0 deletions
36
...rs/src/main/java/io/smallrye/opentelemetry/implementation/exporters/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,36 @@ | ||
package io.smallrye.opentelemetry.implementation.exporters; | ||
|
||
import java.net.URI; | ||
import java.util.HashMap; | ||
import java.util.Locale; | ||
import java.util.Map; | ||
|
||
import io.opentelemetry.exporter.otlp.internal.OtlpUserAgent; | ||
|
||
public 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; | ||
} | ||
|
||
public static Map<String, String> populateTracingExportHttpHeaders() { | ||
Map<String, String> headersMap = new HashMap<>(); | ||
OtlpUserAgent.addUserAgentHeader(headersMap::put); | ||
return headersMap; | ||
} | ||
|
||
static boolean isHttps(URI uri) { | ||
return "https".equals(uri.getScheme().toLowerCase(Locale.ROOT)); | ||
} | ||
} |
Oops, something went wrong.