Skip to content

Commit

Permalink
Fix setup
Browse files Browse the repository at this point in the history
  • Loading branch information
thiagohora committed Sep 17, 2024
1 parent e965f58 commit 4c5b43f
Show file tree
Hide file tree
Showing 12 changed files with 10 additions and 53 deletions.
3 changes: 0 additions & 3 deletions apps/opik-backend/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,3 @@ server:
enableVirtualThreads: ${ENABLE_VIRTUAL_THREADS:-false}
gzip:
enabled: true

openTelemetry:
disabled: ${OTEL_SDK_DISABLED:-true}
4 changes: 2 additions & 2 deletions apps/opik-backend/entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,10 @@ echo $(pwd)
jwebserver -d /opt/opik/redoc -b 0.0.0.0 -p 3003 &

echo "OPIK_VERSION=$OPIK_VERSION"
echo "OTEL_SDK_DISABLED=$OTEL_SDK_DISABLED"
echo "OPIK_OTEL_SDK_ENABLED=$OPIK_OTEL_SDK_ENABLED"
echo "OTEL_VERSION=$OTEL_VERSION"

if [[ "${OTEL_SDK_DISABLED}" == "false" ]];then
if [[ "${OPIK_OTEL_SDK_ENABLED}" == "true" ]];then
curl -L -o /tmp/opentelemetry-javaagent.jar https://github.com/open-telemetry/opentelemetry-java-instrumentation/releases/download/v${OTEL_VERSION}/opentelemetry-javaagent.jar
JAVA_OPTS="$JAVA_OPTS -javaagent:/tmp/opentelemetry-javaagent.jar"
fi
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
import com.comet.opik.infrastructure.bundle.LiquibaseBundle;
import com.comet.opik.infrastructure.db.DatabaseAnalyticsModule;
import com.comet.opik.infrastructure.db.IdGeneratorModule;
import com.comet.opik.infrastructure.instrumentation.OpenTelemetryModule;
import com.comet.opik.infrastructure.redis.RedisModule;
import com.comet.opik.utils.JsonBigDecimalDeserializer;
import com.fasterxml.jackson.annotation.JsonInclude;
Expand Down Expand Up @@ -59,7 +58,7 @@ public void initialize(Bootstrap<OpikConfiguration> bootstrap) {
bootstrap.addBundle(GuiceBundle.builder()
.bundles(JdbiBundle.<OpikConfiguration>forDatabase((conf, env) -> conf.getDatabase())
.withPlugins(new SqlObjectPlugin(), new Jackson2Plugin()))
.modules(new DatabaseAnalyticsModule(), new IdGeneratorModule(), new AuthModule(), new RedisModule(), new OpenTelemetryModule())
.modules(new DatabaseAnalyticsModule(), new IdGeneratorModule(), new AuthModule(), new RedisModule())
.enableAutoConfig()
.build());
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -748,7 +748,7 @@ public Mono<Void> deleteByTraceId(@NonNull UUID traceId, @NonNull Connection con
return deleteByTraceIds(Set.of(traceId), connection);
}

@Trace(dispatcher = true)
@WithSpan
public Mono<Void> deleteByTraceIds(Set<UUID> traceIds, @NonNull Connection connection) {
Preconditions.checkArgument(
CollectionUtils.isNotEmpty(traceIds), "Argument 'traceIds' must not be empty");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -811,7 +811,7 @@ private String getOrDefault(JsonNode value) {
return value != null ? value.toString() : "";
}

@com.newrelic.api.agent.Trace(dispatcher = true)
@WithSpan
public Flux<TraceCountResponse.WorkspaceTraceCount> countTracesPerWorkspace(Connection connection) {

var statement = connection.createStatement(TRACE_COUNT_BY_WORKSPACE_ID);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -291,7 +291,6 @@ public Mono<Void> delete(@NonNull UUID id) {

@Override
@WithSpan
@com.newrelic.api.agent.Trace(dispatcher = true)
public Mono<Void> delete(Set<UUID> ids) {
Preconditions.checkArgument(CollectionUtils.isNotEmpty(ids), "Argument 'ids' must not be empty");
log.info("Deleting traces, count '{}'", ids.size());
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,4 @@ public class OpikConfiguration extends Configuration {
@NotNull @JsonProperty
private DistributedLockConfig distributedLock = new DistributedLockConfig();

@Valid
@NotNull @JsonProperty
private OpenTelemetryConfig openTelemetry = new OpenTelemetryConfig();
}

This file was deleted.

3 changes: 0 additions & 3 deletions apps/opik-backend/src/test/resources/config-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,3 @@ server:
enableVirtualThreads: ${ENABLE_VIRTUAL_THREADS:-false}
gzip:
enabled: true

openTelemetry:
disabled: ${OTEL_SDK_DISABLED:-true}
4 changes: 4 additions & 0 deletions deployment/docker-compose/docker-compose.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,10 @@ services:
JAVA_OPTS: "-Dliquibase.propertySubstitutionEnabled=true"
REDIS_URL: redis://:opik@redis:6379/
ANALYTICS_DB_PASS: opik
OTEL_RESOURCE_ATTRIBUTES: "service.name=opik-backend,service.version=$OPIK_VERSION"
OTEL_TRACES_EXPORTER: otlp
OPIK_OTEL_SDK_ENABLED: false
OTEL_VERSION: 2.8.0
ports:
- "8080:8080"
- "3003:3003"
Expand Down
2 changes: 1 addition & 1 deletion deployment/helm_chart/opik/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ component:
STATE_DB_PASS: opik
OTEL_RESOURCE_ATTRIBUTES: "service.name=opik-backend,service.version=$OPIK_VERSION"
OTEL_TRACES_EXPORTER: otlp
OTEL_SDK_DISABLED: true
OPIK_OTEL_SDK_ENABLED: false
OTEL_VERSION: 2.8.0
envFrom:
- configMapRef:
Expand Down

0 comments on commit 4c5b43f

Please sign in to comment.