Skip to content

Commit a34b2a8

Browse files
feat/open-telemetry exporters for spans and metrics
1 parent f5b68a7 commit a34b2a8

24 files changed

Lines changed: 882 additions & 141 deletions

.idea/workspace.xml

Lines changed: 61 additions & 53 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

pom.xml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
</modules>
1616

1717
<properties>
18+
<traceo.core.version>1.0.0</traceo.core.version>
1819
<maven.compiler.source>8</maven.compiler.source>
1920
<maven.compiler.target>8</maven.compiler.target>
2021
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
@@ -24,6 +25,7 @@
2425
<jackson.databind.version>2.13.0</jackson.databind.version>
2526
<mockito.core.version>3.11.2</mockito.core.version>
2627
<slf4j.api.version>1.7.36</slf4j.api.version>
28+
<opentelemetry.version>1.28.0</opentelemetry.version>
2729
</properties>
2830

2931
</project>

traceo-sdk-core/src/main/java/com/traceo/sdk/ClientOptions.java

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
package com.traceo.sdk;
22

3-
import com.traceo.sdk.http.HttpAsyncClient;
4-
import com.traceo.sdk.http.IHttpClient;
3+
import com.traceo.sdk.http.IHttpAsyncClient;
54

65
import java.util.ArrayList;
76
import java.util.List;
@@ -44,9 +43,9 @@ public class ClientOptions {
4443
private List<IHandler> handlers = new ArrayList<>();
4544

4645
/**
47-
* Http client used to requests.
46+
* Http client used to http requests.
4847
*/
49-
private IHttpClient<?,?> httpClient;
48+
private IHttpAsyncClient httpClient;
5049

5150
public ClientOptions() {}
5251

@@ -64,11 +63,11 @@ public void setHandlers(List<IHandler> handlers) {
6463
this.handlers = handlers;
6564
}
6665

67-
public IHttpClient<?, ?> getHttpClient() {
66+
public IHttpAsyncClient getHttpClient() {
6867
return httpClient;
6968
}
7069

71-
public void setHttpClient(IHttpClient<?, ?> httpClient) {
70+
public void setHttpClient(IHttpAsyncClient httpClient) {
7271
this.httpClient = httpClient;
7372
}
7473

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
package com.traceo.sdk.builder;
2+
3+
import com.traceo.sdk.ClientOptions;
4+
5+
/**
6+
* Builder for tests use case
7+
*/
8+
public class NoOpClientBuilder extends CoreBuilder<NoOpClientBuilder, ClientOptions> {
9+
protected NoOpClientBuilder(ClientOptions baseConfiguration) {
10+
super(baseConfiguration);
11+
}
12+
13+
public static NoOpClientBuilder standard() {
14+
return new NoOpClientBuilder(new ClientOptions());
15+
}
16+
17+
public static ClientOptions defaultClient() {
18+
return standard().build();
19+
}
20+
}

traceo-sdk-core/src/main/java/com/traceo/sdk/client/CoreClient.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
import com.traceo.sdk.ClientOptions;
44
import com.traceo.sdk.IHandler;
5-
import com.traceo.sdk.http.HttpAsyncClient;
5+
import com.traceo.sdk.http.HttpAsyncAsyncClient;
66
import com.traceo.sdk.handlers.IncidentHandler;
77
import com.traceo.sdk.handlers.UncaughtExceptionHandler;
88
import com.traceo.sdk.logging.internal.SDKLogger;
@@ -21,7 +21,7 @@ public class CoreClient<T extends ClientOptions> implements Closeable {
2121
private static volatile ClientOptions configuration;
2222

2323
/** Async http client implementation to use inside client. **/
24-
public static HttpAsyncClient httpClient;
24+
public static HttpAsyncAsyncClient httpClient;
2525

2626

2727
/** Handler for captured incidents. **/
@@ -50,7 +50,7 @@ public static synchronized <T extends ClientOptions> void init(T options) {
5050
LOGGER.log("You run Traceo SDK with enabled debug option.");
5151
}
5252

53-
httpClient = new HttpAsyncClient();
53+
httpClient = new HttpAsyncAsyncClient();
5454
options.setHttpClient(httpClient);
5555

5656
incidentHandler = new IncidentHandler(options);

0 commit comments

Comments
 (0)