Skip to content

Commit

Permalink
Merge pull request #34 from ligangty/o11y
Browse files Browse the repository at this point in the history
Remove o11yphant dependencies
  • Loading branch information
ligangty authored Jul 18, 2024
2 parents fc5a981 + c56281f commit bca82ea
Show file tree
Hide file tree
Showing 27 changed files with 1,722 additions and 715 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -144,8 +144,6 @@ public void clearTrackingRecord( final String trackingId, final StoreType type,
public boolean sealTrackingRecord( String trackingId )
throws IndyClientException
{
http.connect();

HttpPost request = http.newRawPost( UrlUtils.buildUrl( http.getBaseUrl(), "/folo/admin", trackingId, "record" ) );
HttpResources resources = null;
try
Expand Down
21 changes: 10 additions & 11 deletions core-java/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -37,20 +37,20 @@
<artifactId>jhttpc</artifactId>
</dependency>
<dependency>
<groupId>org.commonjava.util</groupId>
<artifactId>o11yphant-trace-api</artifactId>
<groupId>io.opentelemetry</groupId>
<artifactId>opentelemetry-api</artifactId>
</dependency>
<dependency>
<groupId>org.commonjava.util</groupId>
<artifactId>o11yphant-trace-otel</artifactId>
<groupId>io.opentelemetry</groupId>
<artifactId>opentelemetry-sdk</artifactId>
</dependency>
<dependency>
<groupId>org.commonjava.util</groupId>
<artifactId>o11yphant-trace-helper-jhttpc</artifactId>
<groupId>io.opentelemetry</groupId>
<artifactId>opentelemetry-exporter-logging</artifactId>
</dependency>
<dependency>
<groupId>org.commonjava.util</groupId>
<artifactId>o11yphant-metrics-common</artifactId>
<groupId>io.opentelemetry</groupId>
<artifactId>opentelemetry-exporter-otlp</artifactId>
</dependency>
<dependency>
<groupId>org.apache.httpcomponents</groupId>
Expand All @@ -65,9 +65,8 @@
<artifactId>commons-io</artifactId>
</dependency>
<dependency>
<groupId>org.commonjava.indy</groupId>
<artifactId>indy-test-fixtures-core</artifactId>
<scope>test</scope>
<groupId>org.apache.commons</groupId>
<artifactId>commons-lang3</artifactId>
</dependency>
</dependencies>

Expand Down
28 changes: 9 additions & 19 deletions core-java/src/main/java/org/commonjava/indy/client/core/Indy.java
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,10 @@
import org.commonjava.indy.client.core.auth.IndyClientAuthenticator;
import org.commonjava.indy.client.core.module.IndyContentClientModule;
import org.commonjava.indy.client.core.module.IndyStoresClientModule;
import org.commonjava.indy.client.core.o11y.trace.ClientTracerConfiguration;
import org.commonjava.indy.inject.IndyVersioningProvider;
import org.commonjava.indy.model.core.io.IndyObjectMapper;
import org.commonjava.indy.stats.IndyVersioning;
import org.commonjava.o11yphant.trace.TraceManager;
import org.commonjava.o11yphant.trace.TracerConfiguration;
import org.commonjava.util.jhttpc.auth.PasswordManager;
import org.commonjava.util.jhttpc.model.SiteConfig;

Expand Down Expand Up @@ -213,9 +212,7 @@ public static final class Builder

private Map<String, String> mdcCopyMappings;

private TracerConfiguration existedTraceConfig;

private TraceManager existedTraceManager;
private ClientTracerConfiguration traceConfig;

private Builder()
{
Expand Down Expand Up @@ -252,18 +249,6 @@ public Builder setObjectMapper( IndyObjectMapper objectMapper )
return this;
}

public Builder setExistedTraceConfig( TracerConfiguration existedTraceConfig )
{
this.existedTraceConfig = existedTraceConfig;
return this;
}

public Builder setExistedTraceManager( TraceManager traceManager )
{
this.existedTraceManager = traceManager;
return this;
}

public Builder setAuthenticator( IndyClientAuthenticator authenticator )
{
this.authenticator = authenticator;
Expand All @@ -276,6 +261,12 @@ public Builder setMdcCopyMappings( Map<String, String> mdcCopyMappings )
return this;
}

public Builder setTraceConfiguration( ClientTracerConfiguration traceConfig )
{
this.traceConfig = traceConfig;
return this;
}

public Indy build()
throws IndyClientException
{
Expand All @@ -290,9 +281,8 @@ public Indy build()
.setAuthenticator( this.authenticator )
.setApiVersion( indy.getApiVersion() )
.setLocation( this.location )
.setTracerConfiguration( this.traceConfig )
.setPasswordManager( this.passwordManager )
.setExistedTraceConfig( this.existedTraceConfig )
.setExistedTraceManager( this.existedTraceManager )
.setMdcCopyMappings( this.mdcCopyMappings )
.setObjectMapper( this.objectMapper )
.build();
Expand Down
Loading

0 comments on commit bca82ea

Please sign in to comment.