首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >使用启动脚本通过命令行界面将Zipkin跟踪添加到WildFly

使用启动脚本通过命令行界面将Zipkin跟踪添加到WildFly
EN

Stack Overflow用户
提问于 2020-05-03 13:48:17
回答 3查看 541关注 0票数 2

我正尝试在Wildfly服务器上添加跟踪功能(特别是Keycloak Docker镜像)

遵循本文档https://docs.wildfly.org/19/Admin

我走了这么远

代码语言:javascript
复制
/extension=org.wildfly.extension.microprofile.opentracing-smallrye:add
/subsystem=microprofile-opentracing-smallrye:add

但我无法让下一部分工作来将其设置为指向zipkin:9411

指令中的下一个命令失败

代码语言:javascript
复制
[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/也会失败

代码语言:javascript
复制
Executing cli script: /opt/jboss/startup-scripts/enable-tracing.cli
No connection to the controller.

使用@ehsavoie回答,我得到了更多

代码语言:javascript
复制
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。

我也试过

代码语言:javascript
复制
/subsystem=microprofile-opentracing-smallrye/jaeger-tracer=my-tracer:write-attribute(name=sender-endpoint,value=http://tracing:9411/api/v1/spans)
EN

回答 3

Stack Overflow用户

发布于 2020-05-06 21:43:39

代码语言:javascript
复制
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图像执行该操作

票数 1
EN

Stack Overflow用户

发布于 2020-05-05 17:19:05

添加子系统后需要重新加载:

代码语言:javascript
复制
[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"}
票数 0
EN

Stack Overflow用户

发布于 2021-10-23 19:10:17

我推荐使用https://github.com/open-telemetry/opentelemetry-java-instrumentation进行跟踪。需要以javaagent启动,这样JAVA_OPTS_APPEND才能与Keycloak Docker官方镜像配合使用,例如:

代码语言:javascript
复制
JAVA_OPTS_APPEND: "-javaagent:/opentelemetry-javaagent-all.jar"

然后是agent can be configured via env variables,例如:

代码语言:javascript
复制
OTEL_SERVICE_NAME: keycloak
OTEL_TRACES_EXPORTER: jaeger
OTEL_EXPORTER_JAEGER_ENDPOINT: <jaeger endpoint>

它也适用于未来的Keycloak X版本,没有复杂的启动脚本。

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/61570149

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档