-
Notifications
You must be signed in to change notification settings - Fork 89
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Keycloak: Add opentelemetry tracing #40
Conversation
Great work! How about adding a section to the readme with a small description of the setup and how to demo? Clickable links would also be great! I think we have a dedicated ops domain like ops.acme.test intended for such use cases. |
Yeah, docs are still needed, especially on how to turn on tracing for some of the apps as well. Another missing detail is the support of TLS for both the Jaeger UI as well as the collection endpoints. |
I'll have to investigate, a quick search didn't yield a lot of results. Something I'd also like is for certain "Operations" to be grouped together. Currently, two requests to the openid-connect/auth endpoint are treated as different "operations" by jaeger because the GET parameters are different. There have been some changes to the otel-extension in newer Quarkus version, so a test with Keycloak 20 and Quarkus 2.13.3.Final (KC 19 uses 2.7.6.Final) might yield better results in general. The newer versions definitely come with MDC Injection, which the 2.7.6 Version still lacks, so there are no spanIds in logs for now. |
Perhaps this dicussion contains some hints about ignoring certain urls: open-telemetry/opentelemetry-java-instrumentation#1060 |
How about the following:
Then we have a more options for the showcase :) Note that after the Keycloak 20.0.1 upgrade, you need to start with a fresh h2 database - otherwise Keycloak 20.x will fail to start... There seem to be options to migrate an older h2 database to a newer one, but I did not try it. |
There's also https://quarkus.io/guides/opentelemetry#quarkus-opentelemetry_quarkus.opentelemetry.tracer.suppress-non-application-uris, which excludes quarkus /q endpoints by default. Maybe we can extend the extension here to allow additional exclude-urls based on path matching. |
6713e17
to
1f41d54
Compare
Looks quite a bit better with KC 20, we now have MDC injection for logging, in both JSON and plain: Setting the service name also works, and the "operations" are grouped by HTTP Request Method, rather than HTTP Request Method + Full URL. Excluding /resources URLs does not seem to be working, despite that being on by default. My guess here is that Quarkus does not recognize Kecloak resource URLs as resource URLs, and so they are not ignored. This might need some extra work in the quarkus extension to allow manual exclusion of certain URLs. The http.target tag still includes all Query Parameters, like: I'll try to get TLS working for everything, and then this should be ready to merge. The exclusions and better tagging are probably something to treat as future improvements for this setup. |
1f41d54
to
7e3dfe5
Compare
7e3dfe5
to
4f4ac88
Compare
LGTM |
No description provided.