How to register with Eureka registry, export OpenTelemetry Tracings and Metrics?
When I configured the app as a Spring Cloud Netflix Eureka client, the same way I did with a Spring Boot app, it shows these warnings on ActiveJ, and it's not gonna register with the Eureka registry.

I also want to add OpenTelemetry OTLP exporter to export tracings and metrics to a GRPC endpoint (http://localhost:4317), it shows this and the app crashed.

I want to add Prometheus Metrics exporter and register at "/metrics" ActiveJ's app endpoint as well, tried using HttpMetricsExporter but the HttpResponse doesn't support the type.
These are what I want:
-
Registry the app with Netflix Eureka registry, so the client can be discovered by other services.

-
Export to GRPC endpoint of OpenTelemetry collector, so it can send tracing spans to Jaeger, and metrics to Prometheus.

-
Register a metrics handler at "/metrics" route, so it can be a target discovered by Prometheus, knowing it's UP or DOWN

Tried adding
<minimizeJar>true</minimizeJar>
<filters>
<filter>
<artifact>*:*</artifact>
<excludes>
<exclude>META-INF/*.SF</exclude>
<exclude>META-INF/*.DSA</exclude>
<exclude>META-INF/*.RSA</exclude>
</excludes>
</filter>
</filters>
to maven-shade-plugin configuration
Invalid signature file digest for Manifest main attributes problem is solved now... But the opentelemetry agent is not automatically exporting spans to GRPC endpoint and not showing anything in Jaeger, it works fine with manual instrumentation sdk.
This is the starting log:
OpenJDK 64-Bit Server VM warning: Sharing is only supported for boot loader classes because bootstrap classpath has been appended
[otel.javaagent 2023-03-30 17:33:34:376 +0000] [main] INFO io.opentelemetry.javaagent.tooling.VersionLogger - opentelemetry-javaagent - version: 1.24.0
17:33:37.434 [main] INFO org.example.WebApp - === INJECTING DEPENDENCIES
17:33:37.909 [main] INFO org.example.WebApp.0 - Effective Injector:
digraph {
rankdir=BT;
"()->java.util.Set<io.activej.inject.InstanceInjector<java.lang.Object>>" [label="Set<InstanceInjector<Object>>"];
"()->io.activej.inject.Injector" [label="Injector" style=bold];
"()->interface io.activej.launcher.annotation.Args java.lang.String[]" [label="@Args String[]"];
"()->@6c8dbf56 io.activej.launcher.LauncherService" [label="@6c8dbf56 LauncherService"];
"()->interface io.activej.launcher.annotation.OnRun java.util.concurrent.CompletionStage<java.lang.Void>" [label="@OnRun CompletionStage<Void>"];
"()->io.activej.inject.binding.OptionalDependency<io.activej.eventloop.inspector.ThrottlingController>" [label="OptionalDependency<ThrottlingController>"];
"()->io.activej.launcher.Launcher" [label="Launcher"];
"()->io.activej.service.ServiceGraph" [label="ServiceGraph"];
"()->io.activej.config.Config" [label="Config"];
"()->io.activej.inject.InstanceInjector<org.example.WebApp>" [label="InstanceInjector<WebApp>" style=dashed];
"()->io.activej.http.AsyncServlet" [label="AsyncServlet"];
"()->java.util.Set<io.activej.launcher.LauncherService>" [label="Set<LauncherService>"];
"()->io.activej.http.AsyncHttpServer" [label="AsyncHttpServer"];
"()->org.example.WebApp" [label="WebApp"];
"()->io.activej.eventloop.Eventloop" [label="Eventloop"];
"()->interface io.activej.launcher.annotation.OnComplete java.util.concurrent.CompletionStage<java.lang.Void>" [label="@OnComplete CompletionStage<Void>"];
"()->interface io.activej.launcher.annotation.OnStart java.util.concurrent.CompletionStage<java.lang.Void>" [label="@OnStart CompletionStage<Void>"];
"()->io.activej.inject.binding.OptionalDependency<java.util.Set<io.activej.common.initializer.Initializer<io.activej.service.ServiceGraphModuleSettings>>>" [label="OptionalDependency<Set<Initializer<ServiceGraphModuleSettings>>>"];
{ rank=same; "()->io.activej.inject.Injector" "()->io.activej.http.AsyncServlet" "()->interface io.activej.launcher.annotation.Args java.lang.String[]" "()->org.example.WebApp" "()->interface io.activej.launcher.annotation.OnRun java.util.concurrent.CompletionStage<java.lang.Void>" "()->interface io.activej.launcher.annotation.OnComplete java.util.concurrent.CompletionStage<java.lang.Void>" "()->interface io.activej.launcher.annotation.OnStart java.util.concurrent.CompletionStage<java.lang.Void>" "()->io.activej.inject.binding.OptionalDependency<java.util.Set<io.activej.common.initializer.Initializer<io.activej.service.ServiceGraphModuleSettings>>>" "()->io.activej.inject.binding.OptionalDependency<io.activej.eventloop.inspector.ThrottlingController>" }
"()->java.util.Set<io.activej.inject.InstanceInjector<java.lang.Object>>" -> "()->io.activej.inject.InstanceInjector<org.example.WebApp>" [];
"()->@6c8dbf56 io.activej.launcher.LauncherService" -> "()->io.activej.inject.binding.OptionalDependency<java.util.Set<io.activej.common.initializer.Initializer<io.activej.service.ServiceGraphModuleSettings>>>" [];
"()->@6c8dbf56 io.activej.launcher.LauncherService" -> "()->io.activej.service.ServiceGraph" [];
"()->io.activej.launcher.Launcher" -> "()->org.example.WebApp" [];
"()->io.activej.service.ServiceGraph" -> "()->io.activej.inject.Injector" [];
"()->io.activej.config.Config" -> "()->interface io.activej.launcher.annotation.OnStart java.util.concurrent.CompletionStage<java.lang.Void>" [];
"()->io.activej.inject.InstanceInjector<org.example.WebApp>" -> "()->io.activej.http.AsyncHttpServer" [];
"()->java.util.Set<io.activej.launcher.LauncherService>" -> "()->@6c8dbf56 io.activej.launcher.LauncherService" [];
"()->io.activej.http.AsyncHttpServer" -> "()->io.activej.config.Config" [];
"()->io.activej.http.AsyncHttpServer" -> "()->io.activej.http.AsyncServlet" [];
"()->io.activej.http.AsyncHttpServer" -> "()->io.activej.eventloop.Eventloop" [];
"()->io.activej.eventloop.Eventloop" -> "()->io.activej.config.Config" [];
"()->io.activej.eventloop.Eventloop" -> "()->io.activej.inject.binding.OptionalDependency<io.activej.eventloop.inspector.ThrottlingController>" [];
}
17:33:37.911 [main] INFO org.example.WebApp.0 - Created eager singletons
17:33:37.956 [main] WARN io.activej.config.Config - Can't load properties file: http-server.properties
17:33:38.103 [main] INFO org.example.WebApp.0 - Post-injected instances: [org.example.WebApp]
17:33:38.104 [main] INFO org.example.WebApp - === STARTING APPLICATION
17:33:38.104 [main] INFO org.example.WebApp.0 - Starting Root Services: [io.activej.service.ServiceGraphModule$1@65e22def]
17:33:38.104 [main] INFO org.example.WebApp.0 - Starting Root Service: io.activej.service.ServiceGraphModule$1@65e22def
17:33:38.116 [main] INFO io.activej.service.ServiceGraph - Starting services
17:33:38.145 [main] INFO io.activej.service.ServiceGraph - Started io.activej.eventloop.Eventloop in 19.28 ms
17:33:38.158 [eventloop: pool-6-thread-1] INFO io.activej.http.AsyncHttpServer - Listening on [/0.0.0.0:8080]: AsyncHttpServer{new:0 read/write:0 serving:0 keep-alive:0}
17:33:38.160 [main] INFO io.activej.service.ServiceGraph - Started io.activej.http.AsyncHttpServer in 14.92 ms
17:33:38.171 [main] INFO io.activej.service.ServiceGraphModule - Effective ServiceGraph:
digraph {
rankdir=LR
"io.activej.http.AsyncHttpServer" -> "io.activej.eventloop.Eventloop" [color=blue style=bold]
"io.activej.http.AsyncHttpServer" [ label="AsyncHttpServer\n15 millis" color=blue style=bold ]
"io.activej.eventloop.Eventloop" [ label="Eventloop\n17 millis" color=blue style=bold ]
{ rank=same; "io.activej.eventloop.Eventloop" }
}
17:33:38.175 [main] INFO io.activej.config.ConfigModule - Effective Config:
# eventloop.fatalErrorHandler =
# eventloop.idleInterval = 1 seconds
# eventloop.threadFatalErrorHandler =
# eventloop.threadPriority = 0
# http.acceptOnce = false
# http.keepAliveTimeout = 30 seconds
http.listenAddresses = 0.0.0.0:8080
# http.maxBodySize = 0
# http.readWriteTimeout = 0 seconds
# http.serverSocketSettings.backlog = 16384
# http.serverSocketSettings.receiveBufferSize =
# http.serverSocketSettings.reuseAddress =
# http.socketSettings.implReadBufferSize =
# http.socketSettings.implReadTimeout =
# http.socketSettings.implWriteTimeout =
# http.socketSettings.keepAlive =
# http.socketSettings.lingerTimeout =
# http.socketSettings.receiveBufferSize =
# http.socketSettings.reuseAddress =
# http.socketSettings.sendBufferSize =
# http.socketSettings.tcpNoDelay = true
17:33:38.176 [main] INFO org.example.WebApp - === RUNNING APPLICATION
17:33:38.193 [main] INFO org.example.WebApp - HTTP Server is now available at http://localhost:8080/
This is a portion of debug logging that looks relevant, looks like it doesn't support the engine used in ActiveJ
[otel.javaagent 2023-03-30 17:41:57:337 +0000] [main] DEBUG io.opentelemetry.javaagent.instrumentation.executors.AbstractExecutorInstrumentation - Skipping executor instrumentation for io.activej.eventloop.Eventloop
[otel.javaagent 2023-03-30 17:41:57:384 +0000] [main] DEBUG io.opentelemetry.javaagent.tooling.AgentInstaller$TransformLoggingListener - Transformed io.activej.eventloop.Eventloop -- jdk.internal.loader.ClassLoaders$AppClassLoader@6ae7deac
[otel.javaagent 2023-03-30 17:41:57:675 +0000] [main] DEBUG io.opentelemetry.javaagent.tooling.AgentInstaller$TransformLoggingListener - Transformed io.activej.service.ServiceGraphModule$$Lambda$401 -- jdk.internal.loader.ClassLoaders$AppClassLoader@6ae7deac
[otel.javaagent 2023-03-30 17:41:57:738 +0000] [main] DEBUG io.opentelemetry.javaagent.tooling.AgentInstaller$TransformLoggingListener - Transformed io.activej.config.ConfigModule$$Lambda$418 -- jdk.internal.loader.ClassLoaders$AppClassLoader@6ae7deac
[otel.javaagent 2023-03-30 17:41:57:739 +0000] [main] DEBUG io.opentelemetry.javaagent.instrumentation.executors.FutureInstrumentation - Skipping future instrumentation for java.util.concurrent.CompletableFuture$UniRun
[otel.javaagent 2023-03-30 17:41:57:744 +0000] [main] DEBUG io.opentelemetry.javaagent.tooling.AgentInstaller$TransformLoggingListener - Transformed java.util.concurrent.CompletableFuture$UniRun -- null
[otel.javaagent 2023-03-30 17:41:57:745 +0000] [main] DEBUG io.opentelemetry.javaagent.instrumentation.executors.FutureInstrumentation - Skipping future instrumentation for java.util.concurrent.CompletableFuture$UniCompletion
[otel.javaagent 2023-03-30 17:41:57:748 +0000] [main] DEBUG io.opentelemetry.javaagent.tooling.AgentInstaller$TransformLoggingListener - Transformed java.util.concurrent.CompletableFuture$UniCompletion -- null
[otel.javaagent 2023-03-30 17:41:57:891 +0000] [main] DEBUG io.opentelemetry.javaagent.tooling.AgentInstaller$TransformLoggingListener - Transformed io.activej.service.adapter.ServiceAdapters$10$$Lambda$477 -- jdk.internal.loader.ClassLoaders$AppClassLoader@6ae7deac
[otel.javaagent 2023-03-30 17:41:57:896 +0000] [main] DEBUG io.opentelemetry.javaagent.tooling.AgentInstaller$TransformLoggingListener - Transformed io.activej.service.ServiceGraphModule$CombinedService$$Lambda$478 -- jdk.internal.loader.ClassLoaders$AppClassLoader@6ae7deac
[otel.javaagent 2023-03-30 17:41:57:918 +0000] [main] DEBUG io.opentelemetry.javaagent.tooling.AgentInstaller$TransformLoggingListener - Transformed io.activej.service.adapter.ServiceAdapters$9$$Lambda$487 -- jdk.internal.loader.ClassLoaders$AppClassLoader@6ae7deac
[otel.javaagent 2023-03-30 17:41:57:921 +0000] [main] DEBUG io.opentelemetry.javaagent.tooling.AgentInstaller$TransformLoggingListener - Transformed io.activej.eventloop.util.RunnableWithContext -- jdk.internal.loader.ClassLoaders$AppClassLoader@6ae7deac
[otel.javaagent 2023-03-30 17:41:57:923 +0000] [main] DEBUG io.opentelemetry.javaagent.instrumentation.executors.FutureInstrumentation - Skipping future instrumentation for java.util.concurrent.CompletableFuture$UniWhenComplete
[otel.javaagent 2023-03-30 17:41:57:928 +0000] [main] DEBUG io.opentelemetry.javaagent.tooling.AgentInstaller$TransformLoggingListener - Transformed java.util.concurrent.CompletableFuture$UniWhenComplete -- null
[otel.javaagent 2023-03-30 17:41:57:930 +0000] [main] DEBUG io.opentelemetry.javaagent.instrumentation.executors.FutureInstrumentation - Skipping future instrumentation for java.util.concurrent.CompletableFuture$UniApply
"()->java.util.Set<io.activej.launcher.LauncherService>" -> "()->@3bf54172 io.activej.launcher.LauncherService" [];
"()->io.activej.http.AsyncHttpServer" -> "()->io.activej.eventloop.Eventloop" [];
"()->io.activej.http.AsyncHttpServer" -> "()->io.activej.config.Config" [];
"()->io.activej.http.AsyncHttpServer" -> "()->io.activej.http.AsyncServlet" [];
}
Hi, @bangbaew
Could you, please, provide a demo application? I'll try to help you.
Hi, @bangbaew
Could you, please, provide a demo application? I'll try to help you.
here is my demo repo: https://github.com/bangbaew/auth_services_otlp_eureka_demo
The spring version of opentelemetry instrumentation will automatically collect all the data, I don't have to do anything.
here is my demo repo: https://github.com/bangbaew/auth_services_otlp_eureka_demo
That link leads to 404 page. Maybe it's a private repository?
Hi, @bangbaew Could you, please, provide a demo application? I'll try to help you.
here is my demo repo: https://github.com/bangbaew/auth_services_otlp_eureka_demo
The spring version of opentelemetry instrumentation will automatically collect all the data, I don't have to do anything.
Can you update the repository permissions so we can view it?