我正尝试在Wildfly服务器上添加跟踪功能(特别是Keycloak Docker镜像)
遵循本文档https://docs.wildfly.org/19/Admin
我走了这么远
/extension=org.wildfly.extension.microprofile.opentracing-smallrye:add
/subsystem=microprofile-opentracing-smallrye:add但我无法让下一部分工作来将其设置为指向zipkin:9411
指令中的下一个命令失败
[standalone@localhost:9990 /] /subsystem=microprofile-opentracing-smallrye/jaeger-tracer=my-tracer:add()
{
"outcome" => "failed",
"failure-description" => "WFLYCTL0030: No resource definition is registered for address [
(\"subsystem\" => \"microprofile-opentracing-smallrye\"),
(\"jaeger-tracer\" => \"my-tracer\")
]",
"rolled-back" => true
}但是,使用/opt/jboss/startup-scripts/也会失败
Executing cli script: /opt/jboss/startup-scripts/enable-tracing.cli
No connection to the controller.使用@ehsavoie回答,我得到了更多
embed-server --admin-only=true
/extension=org.wildfly.extension.microprofile.opentracing-smallrye:add()
/subsystem=microprofile-opentracing-smallrye:add()
/subsystem=microprofile-opentracing-smallrye/jaeger-tracer=my-tracer:add()
/subsystem=microprofile-opentracing-smallrye/jaeger-tracer=my-tracer:write-attribute(name=sender-endpoint,value=http://tracing:9411)
/subsystem=microprofile-opentracing-smallrye/jaeger-tracer=my-tracer:write-attribute(name=propagation,value=[B3])
/subsystem=microprofile-opentracing-smallrye/jaeger-tracer=my-tracer:write-attribute(name=reporter-log-spans,value=true)
/subsystem=microprofile-opentracing-smallrye:write-attribute(name=default-tracer,value=my-tracer)
stop-embedded-server但是仍然没有登录到使用B3的zipkin。
我也试过
/subsystem=microprofile-opentracing-smallrye/jaeger-tracer=my-tracer:write-attribute(name=sender-endpoint,value=http://tracing:9411/api/v1/spans)发布于 2020-05-06 21:43:39
embed-server --admin-only=true
/extension=org.wildfly.extension.microprofile.opentracing-smallrye:add()
/subsystem=microprofile-opentracing-smallrye:add()
/subsystem=microprofile-opentracing-smallrye/jaeger-tracer=my-tracer:add()
stop-embedded-server这个jboss-cli脚本应该在正确启动服务器之前启用opentracing。我不确定如何/何时可以使用keycloack图像执行该操作
发布于 2020-05-05 17:19:05
添加子系统后需要重新加载:
[standalone@localhost:9990 /] /extension=org.wildfly.extension.microprofile.opentracing-smallrye:add
{"outcome" => "success"}
[standalone@localhost:9990 /] /subsystem=microprofile-opentracing-smallrye:add
{
"outcome" => "success",
"response-headers" => {
"operation-requires-reload" => true,
"process-state" => "reload-required"
}
}
[standalone@localhost:9990 /] reload
[standalone@localhost:9990 /] /subsystem=microprofile-opentracing-smallrye/jaeger-tracer=my-tracer:add()
{"outcome" => "success"}发布于 2021-10-23 19:10:17
我推荐使用https://github.com/open-telemetry/opentelemetry-java-instrumentation进行跟踪。需要以javaagent启动,这样JAVA_OPTS_APPEND才能与Keycloak Docker官方镜像配合使用,例如:
JAVA_OPTS_APPEND: "-javaagent:/opentelemetry-javaagent-all.jar"然后是agent can be configured via env variables,例如:
OTEL_SERVICE_NAME: keycloak
OTEL_TRACES_EXPORTER: jaeger
OTEL_EXPORTER_JAEGER_ENDPOINT: <jaeger endpoint>它也适用于未来的Keycloak X版本,没有复杂的启动脚本。
https://stackoverflow.com/questions/61570149
复制相似问题