From 8f2c82583518d78be9875a3257ae12ed2ad23a56 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20Barto=C5=A1?= Date: Wed, 11 Dec 2024 17:53:14 +0100 Subject: [PATCH] Enable opentelemetry feature by default (#35756) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Closes #35753 Signed-off-by: Martin Bartoš --- .../java/org/keycloak/common/Profile.java | 2 +- .../release_notes/topics/26_1_0.adoc | 15 ++++++ docs/guides/observability/tracing.adoc | 9 ++-- .../org/keycloak/config/OptionCategory.java | 2 +- .../mappers/TracingPropertyMappers.java | 2 +- .../keycloak/it/cli/dist/TracingDistTest.java | 12 ++--- ...CommandDistTest.testBuildHelp.approved.txt | 6 +++ ...ommandDistTest.testExportHelp.approved.txt | 6 +++ ...andDistTest.testExportHelpAll.approved.txt | 49 +++++++++---------- ...ommandDistTest.testImportHelp.approved.txt | 6 +++ ...andDistTest.testImportHelpAll.approved.txt | 49 +++++++++---------- ...mandDistTest.testStartDevHelp.approved.txt | 6 +++ ...dDistTest.testStartDevHelpAll.approved.txt | 49 +++++++++---------- ...CommandDistTest.testStartHelp.approved.txt | 6 +++ ...mandDistTest.testStartHelpAll.approved.txt | 49 +++++++++---------- ...est.testStartOptimizedHelpAll.approved.txt | 33 ++++++------- .../tracing/OTelTracingProviderTest.java | 3 -- 17 files changed, 170 insertions(+), 134 deletions(-) diff --git a/common/src/main/java/org/keycloak/common/Profile.java b/common/src/main/java/org/keycloak/common/Profile.java index 123276126ea..09e0ca6866c 100755 --- a/common/src/main/java/org/keycloak/common/Profile.java +++ b/common/src/main/java/org/keycloak/common/Profile.java @@ -116,7 +116,7 @@ public class Profile { OID4VC_VCI("Support for the OID4VCI protocol as part of OID4VC.", Type.EXPERIMENTAL), - OPENTELEMETRY("OpenTelemetry Tracing", Type.PREVIEW), + OPENTELEMETRY("OpenTelemetry Tracing", Type.DEFAULT), DECLARATIVE_UI("declarative ui spi", Type.EXPERIMENTAL), diff --git a/docs/documentation/release_notes/topics/26_1_0.adoc b/docs/documentation/release_notes/topics/26_1_0.adoc index a8e984abb9a..b0e0dbe6b6d 100644 --- a/docs/documentation/release_notes/topics/26_1_0.adoc +++ b/docs/documentation/release_notes/topics/26_1_0.adoc @@ -114,6 +114,21 @@ The key providers that allow to import externally generated keys (`rsa` and `jav The default `generated` key providers generate a certificate valid for 10 years (the types that have or can have an associated certificate). Because of the long validity and the recommendation to rotate keys frequently, the generated providers do not perform this check. += OpenTelemetry Tracing supported + +In the previous release, the OpenTelemetry Tracing feature was preview and is *fully supported* now. +It means the `opentelemetry` feature is enabled by default. + +There were made multiple improvements to the tracing capabilities in {project_name} such as: + +* *Custom spans* for: +** Incoming/outgoing HTTP requests including Identity Providers brokerage +** Database operations and connections +** LDAP requests +** Time-consuming operations (passwords hashing, persistent sessions operations, ...) + +For more information, see the link:{tracingguide_link}[{tracingguide_name}] guide. + = Sign out all active sessions in admin console now effectively removes all sessions In previous versions, clicking on *Sign out all active sessions* in the admin console resulted in the removal of regular sessions only. Offline sessions would still be displayed despite being effectively invalidated. diff --git a/docs/guides/observability/tracing.adoc b/docs/guides/observability/tracing.adoc index 2769fb68b04..8fb68fd91f0 100644 --- a/docs/guides/observability/tracing.adoc +++ b/docs/guides/observability/tracing.adoc @@ -5,7 +5,6 @@ <#import "/templates/profile.adoc" as profile> <@tmpl.guide title="Enabling Tracing" -preview="true" summary="Learn how to enable distributed tracing in {project_name}" includedOptions="tracing-* log-*-include-trace"> @@ -17,9 +16,9 @@ It also provides valuable insights into performance bottlenecks and can help opt == Enable tracing -It is possible to enable exposing traces using the build time option `tracing-enabled`, and enabling `opentelemetry` feature as follows: +It is possible to enable exposing traces using the build time option `tracing-enabled` as follows: -<@kc.start parameters="--tracing-enabled=true --features=opentelemetry"/> +<@kc.start parameters="--tracing-enabled=true"/> By default, the trace exporters send out data in batches, using the `gRPC` protocol and endpoint `+http://localhost:4317+`. @@ -27,6 +26,8 @@ The default service name is `keycloak`, specified via the `tracing-service-name` For more information about resource attributes that can be provided via the `tracing-resource-attributes` property, see the https://quarkus.io/guides/opentelemetry#resource[Quarkus OpenTelemetry Resource] guide. +NOTE: Tracing can be enabled only when the `opentelemetry` feature is *enabled* (by default). + For more tracing settings, see all possible configurations below. == Development setup @@ -117,7 +118,7 @@ The format of the log records may start as follows: You can hide trace IDs in specific log handlers by specifying their associated {project_name} option `log--include-trace`, where `` is the name of the log handler. For instance, to disable trace info in the `console` log, you can turn it off as follows: -<@kc.start parameters="--tracing-enabled=true --features=opentelemetry --log=console --log-console-include-trace=false"/> +<@kc.start parameters="--tracing-enabled=true --log=console --log-console-include-trace=false"/> NOTE: When you explicitly override the log format for the particular log handlers, the `*-include-trace` options do not have any effect, and no tracing is included. diff --git a/quarkus/config-api/src/main/java/org/keycloak/config/OptionCategory.java b/quarkus/config-api/src/main/java/org/keycloak/config/OptionCategory.java index 4a0c9c6ac01..27998ebc17f 100644 --- a/quarkus/config-api/src/main/java/org/keycloak/config/OptionCategory.java +++ b/quarkus/config-api/src/main/java/org/keycloak/config/OptionCategory.java @@ -15,7 +15,7 @@ public enum OptionCategory { PROXY("Proxy", 90, ConfigSupportLevel.SUPPORTED), VAULT("Vault", 100, ConfigSupportLevel.SUPPORTED), LOGGING("Logging", 110, ConfigSupportLevel.SUPPORTED), - TRACING("Tracing", 111, ConfigSupportLevel.PREVIEW), + TRACING("Tracing", 111, ConfigSupportLevel.SUPPORTED), EVENTS("Events", 112, ConfigSupportLevel.PREVIEW), TRUSTSTORE("Truststore", 115, ConfigSupportLevel.SUPPORTED), SECURITY("Security", 120, ConfigSupportLevel.SUPPORTED), diff --git a/quarkus/runtime/src/main/java/org/keycloak/quarkus/runtime/configuration/mappers/TracingPropertyMappers.java b/quarkus/runtime/src/main/java/org/keycloak/quarkus/runtime/configuration/mappers/TracingPropertyMappers.java index 421e386958e..439e50d04d5 100644 --- a/quarkus/runtime/src/main/java/org/keycloak/quarkus/runtime/configuration/mappers/TracingPropertyMappers.java +++ b/quarkus/runtime/src/main/java/org/keycloak/quarkus/runtime/configuration/mappers/TracingPropertyMappers.java @@ -40,7 +40,7 @@ import static org.keycloak.quarkus.runtime.configuration.mappers.PropertyMapper. public class TracingPropertyMappers { private static final String OTEL_FEATURE_ENABLED_MSG = "'opentelemetry' feature is enabled"; - private static final String TRACING_ENABLED_MSG = "'opentelemetry' feature and Tracing is enabled"; + private static final String TRACING_ENABLED_MSG = "Tracing is enabled"; private TracingPropertyMappers() { } diff --git a/quarkus/tests/integration/src/test/java/org/keycloak/it/cli/dist/TracingDistTest.java b/quarkus/tests/integration/src/test/java/org/keycloak/it/cli/dist/TracingDistTest.java index 654521ef8b1..f304e70af49 100644 --- a/quarkus/tests/integration/src/test/java/org/keycloak/it/cli/dist/TracingDistTest.java +++ b/quarkus/tests/integration/src/test/java/org/keycloak/it/cli/dist/TracingDistTest.java @@ -35,7 +35,6 @@ public class TracingDistTest { private void assertTracingEnabled(CLIResult result) { result.assertMessage("opentelemetry"); result.assertMessage("service.name=\"keycloak\""); - result.assertMessage("Preview features enabled: opentelemetry"); } private void assertTracingDisabled(CLIResult result) { @@ -43,7 +42,6 @@ public class TracingDistTest { result.assertNoMessage("service.name=\"keycloak\""); result.assertNoMessage("Failed to export spans."); result.assertNoMessage("Connection refused: localhost/127.0.0.1:4317"); - result.assertNoMessage("Preview features enabled: opentelemetry"); } @Test @@ -62,12 +60,12 @@ public class TracingDistTest { void disabledOption(LaunchResult result) { CLIResult cliResult = (CLIResult) result; - cliResult.assertError("Disabled option: '--tracing-service-name'. Available only when 'opentelemetry' feature and Tracing is enabled"); + cliResult.assertError("Disabled option: '--tracing-service-name'. Available only when Tracing is enabled"); } @Test @Order(3) - @Launch({"start-dev", "--tracing-enabled=true"}) + @Launch({"start-dev", "--features-disabled=opentelemetry", "--tracing-enabled=true"}) void disabledFeature(LaunchResult result) { CLIResult cliResult = (CLIResult) result; @@ -76,16 +74,16 @@ public class TracingDistTest { @Test @Order(4) - @Launch({"start-dev", "--features=opentelemetry", "--tracing-enabled=false", "--tracing-endpoint=something"}) + @Launch({"start-dev", "--tracing-enabled=false", "--tracing-endpoint=something"}) void disabledTracing(LaunchResult result) { CLIResult cliResult = (CLIResult) result; - cliResult.assertError("Disabled option: '--tracing-endpoint'. Available only when 'opentelemetry' feature and Tracing is enabled"); + cliResult.assertError("Disabled option: '--tracing-endpoint'. Available only when Tracing is enabled"); } @Test @Order(5) - @Launch({"build", "--tracing-enabled=true", "--features=opentelemetry"}) + @Launch({"build", "--tracing-enabled=true"}) void buildTracingEnabled(LaunchResult result) { CLIResult cliResult = (CLIResult) result; diff --git a/quarkus/tests/integration/src/test/resources/org/keycloak/it/cli/dist/approvals/cli/help/HelpCommandDistTest.testBuildHelp.approved.txt b/quarkus/tests/integration/src/test/resources/org/keycloak/it/cli/dist/approvals/cli/help/HelpCommandDistTest.testBuildHelp.approved.txt index a1fdbba983a..5754d0312fb 100644 --- a/quarkus/tests/integration/src/test/resources/org/keycloak/it/cli/dist/approvals/cli/help/HelpCommandDistTest.testBuildHelp.approved.txt +++ b/quarkus/tests/integration/src/test/resources/org/keycloak/it/cli/dist/approvals/cli/help/HelpCommandDistTest.testBuildHelp.approved.txt @@ -78,6 +78,12 @@ Vault: --vault Enables a vault provider. Possible values are: file, keystore. +Tracing: + +--tracing-enabled + Enables the OpenTelemetry tracing. Default: false. Available only when + 'opentelemetry' feature is enabled. + Security: --fips-mode Sets the FIPS mode. If 'non-strict' is set, FIPS is enabled but on diff --git a/quarkus/tests/integration/src/test/resources/org/keycloak/it/cli/dist/approvals/cli/help/HelpCommandDistTest.testExportHelp.approved.txt b/quarkus/tests/integration/src/test/resources/org/keycloak/it/cli/dist/approvals/cli/help/HelpCommandDistTest.testExportHelp.approved.txt index 4ea5d3cb61c..718502ce37c 100644 --- a/quarkus/tests/integration/src/test/resources/org/keycloak/it/cli/dist/approvals/cli/help/HelpCommandDistTest.testExportHelp.approved.txt +++ b/quarkus/tests/integration/src/test/resources/org/keycloak/it/cli/dist/approvals/cli/help/HelpCommandDistTest.testExportHelp.approved.txt @@ -147,6 +147,12 @@ Logging: Possible values are (case insensitive): off, fatal, error, warn, info, debug, trace, all. +Tracing: + +--tracing-enabled + Enables the OpenTelemetry tracing. Default: false. Available only when + 'opentelemetry' feature is enabled. + Truststore: --tls-hostname-verifier diff --git a/quarkus/tests/integration/src/test/resources/org/keycloak/it/cli/dist/approvals/cli/help/HelpCommandDistTest.testExportHelpAll.approved.txt b/quarkus/tests/integration/src/test/resources/org/keycloak/it/cli/dist/approvals/cli/help/HelpCommandDistTest.testExportHelpAll.approved.txt index 251dc7a0267..d62a88efd19 100644 --- a/quarkus/tests/integration/src/test/resources/org/keycloak/it/cli/dist/approvals/cli/help/HelpCommandDistTest.testExportHelpAll.approved.txt +++ b/quarkus/tests/integration/src/test/resources/org/keycloak/it/cli/dist/approvals/cli/help/HelpCommandDistTest.testExportHelpAll.approved.txt @@ -207,43 +207,42 @@ Logging: Set the Syslog type used to format the sent message. Possible values are: rfc5424, rfc3164. Default: rfc5424. Available only when Syslog is activated. -Tracing (Preview): +Tracing: --tracing-compression - Preview: OpenTelemetry compression method used to compress payloads. If unset, + OpenTelemetry compression method used to compress payloads. If unset, compression is disabled. Possible values are: gzip, none. Default: none. - Available only when 'opentelemetry' feature and Tracing is enabled. + Available only when Tracing is enabled. --tracing-enabled - Preview: Enables the OpenTelemetry tracing. Default: false. Available only - when 'opentelemetry' feature is enabled. + Enables the OpenTelemetry tracing. Default: false. Available only when + 'opentelemetry' feature is enabled. --tracing-endpoint - Preview: OpenTelemetry endpoint to connect to. Default: http://localhost:4317. - Available only when 'opentelemetry' feature and Tracing is enabled. + OpenTelemetry endpoint to connect to. Default: http://localhost:4317. + Available only when Tracing is enabled. --tracing-jdbc-enabled - Preview: Enables the OpenTelemetry JDBC tracing. Default: true. Available only - when 'opentelemetry' feature and Tracing is enabled. + Enables the OpenTelemetry JDBC tracing. Default: true. Available only when + Tracing is enabled. --tracing-protocol - Preview: OpenTelemetry protocol used for the telemetry data. Possible values - are: grpc, http/protobuf. Default: grpc. Available only when 'opentelemetry' - feature and Tracing is enabled. + OpenTelemetry protocol used for the telemetry data. Possible values are: grpc, + http/protobuf. Default: grpc. Available only when Tracing is enabled. --tracing-resource-attributes - Preview: OpenTelemetry resource attributes present in the exported trace to + OpenTelemetry resource attributes present in the exported trace to characterize the telemetry producer. Values in format 'key1=val1,key2=val2'. - For more information, check the Tracing guide. Available only when - 'opentelemetry' feature and Tracing is enabled. + For more information, check the Tracing guide. Available only when Tracing + is enabled. --tracing-sampler-ratio - Preview: OpenTelemetry sampler ratio. Probability that a span will be sampled. - Expected double value in interval <0,1). Default: 1.0. Available only when - 'opentelemetry' feature and Tracing is enabled. + OpenTelemetry sampler ratio. Probability that a span will be sampled. Expected + double value in interval <0,1). Default: 1.0. Available only when Tracing is + enabled. --tracing-sampler-type - Preview: OpenTelemetry sampler to use for tracing. Possible values are: - always_on, always_off, traceidratio, parentbased_always_on, - parentbased_always_off, parentbased_traceidratio. Default: traceidratio. - Available only when 'opentelemetry' feature and Tracing is enabled. + OpenTelemetry sampler to use for tracing. Possible values are: always_on, + always_off, traceidratio, parentbased_always_on, parentbased_always_off, + parentbased_traceidratio. Default: traceidratio. Available only when Tracing + is enabled. --tracing-service-name - Preview: OpenTelemetry service name. Takes precedence over 'service.name' - defined in the 'tracing-resource-attributes' property. Default: keycloak. - Available only when 'opentelemetry' feature and Tracing is enabled. + OpenTelemetry service name. Takes precedence over 'service.name' defined in + the 'tracing-resource-attributes' property. Default: keycloak. Available + only when Tracing is enabled. Events (Preview): diff --git a/quarkus/tests/integration/src/test/resources/org/keycloak/it/cli/dist/approvals/cli/help/HelpCommandDistTest.testImportHelp.approved.txt b/quarkus/tests/integration/src/test/resources/org/keycloak/it/cli/dist/approvals/cli/help/HelpCommandDistTest.testImportHelp.approved.txt index bd01b0e5aa4..fa53a3ef102 100644 --- a/quarkus/tests/integration/src/test/resources/org/keycloak/it/cli/dist/approvals/cli/help/HelpCommandDistTest.testImportHelp.approved.txt +++ b/quarkus/tests/integration/src/test/resources/org/keycloak/it/cli/dist/approvals/cli/help/HelpCommandDistTest.testImportHelp.approved.txt @@ -147,6 +147,12 @@ Logging: Possible values are (case insensitive): off, fatal, error, warn, info, debug, trace, all. +Tracing: + +--tracing-enabled + Enables the OpenTelemetry tracing. Default: false. Available only when + 'opentelemetry' feature is enabled. + Truststore: --tls-hostname-verifier diff --git a/quarkus/tests/integration/src/test/resources/org/keycloak/it/cli/dist/approvals/cli/help/HelpCommandDistTest.testImportHelpAll.approved.txt b/quarkus/tests/integration/src/test/resources/org/keycloak/it/cli/dist/approvals/cli/help/HelpCommandDistTest.testImportHelpAll.approved.txt index 6004869e179..690d155f495 100644 --- a/quarkus/tests/integration/src/test/resources/org/keycloak/it/cli/dist/approvals/cli/help/HelpCommandDistTest.testImportHelpAll.approved.txt +++ b/quarkus/tests/integration/src/test/resources/org/keycloak/it/cli/dist/approvals/cli/help/HelpCommandDistTest.testImportHelpAll.approved.txt @@ -207,43 +207,42 @@ Logging: Set the Syslog type used to format the sent message. Possible values are: rfc5424, rfc3164. Default: rfc5424. Available only when Syslog is activated. -Tracing (Preview): +Tracing: --tracing-compression - Preview: OpenTelemetry compression method used to compress payloads. If unset, + OpenTelemetry compression method used to compress payloads. If unset, compression is disabled. Possible values are: gzip, none. Default: none. - Available only when 'opentelemetry' feature and Tracing is enabled. + Available only when Tracing is enabled. --tracing-enabled - Preview: Enables the OpenTelemetry tracing. Default: false. Available only - when 'opentelemetry' feature is enabled. + Enables the OpenTelemetry tracing. Default: false. Available only when + 'opentelemetry' feature is enabled. --tracing-endpoint - Preview: OpenTelemetry endpoint to connect to. Default: http://localhost:4317. - Available only when 'opentelemetry' feature and Tracing is enabled. + OpenTelemetry endpoint to connect to. Default: http://localhost:4317. + Available only when Tracing is enabled. --tracing-jdbc-enabled - Preview: Enables the OpenTelemetry JDBC tracing. Default: true. Available only - when 'opentelemetry' feature and Tracing is enabled. + Enables the OpenTelemetry JDBC tracing. Default: true. Available only when + Tracing is enabled. --tracing-protocol - Preview: OpenTelemetry protocol used for the telemetry data. Possible values - are: grpc, http/protobuf. Default: grpc. Available only when 'opentelemetry' - feature and Tracing is enabled. + OpenTelemetry protocol used for the telemetry data. Possible values are: grpc, + http/protobuf. Default: grpc. Available only when Tracing is enabled. --tracing-resource-attributes - Preview: OpenTelemetry resource attributes present in the exported trace to + OpenTelemetry resource attributes present in the exported trace to characterize the telemetry producer. Values in format 'key1=val1,key2=val2'. - For more information, check the Tracing guide. Available only when - 'opentelemetry' feature and Tracing is enabled. + For more information, check the Tracing guide. Available only when Tracing + is enabled. --tracing-sampler-ratio - Preview: OpenTelemetry sampler ratio. Probability that a span will be sampled. - Expected double value in interval <0,1). Default: 1.0. Available only when - 'opentelemetry' feature and Tracing is enabled. + OpenTelemetry sampler ratio. Probability that a span will be sampled. Expected + double value in interval <0,1). Default: 1.0. Available only when Tracing is + enabled. --tracing-sampler-type - Preview: OpenTelemetry sampler to use for tracing. Possible values are: - always_on, always_off, traceidratio, parentbased_always_on, - parentbased_always_off, parentbased_traceidratio. Default: traceidratio. - Available only when 'opentelemetry' feature and Tracing is enabled. + OpenTelemetry sampler to use for tracing. Possible values are: always_on, + always_off, traceidratio, parentbased_always_on, parentbased_always_off, + parentbased_traceidratio. Default: traceidratio. Available only when Tracing + is enabled. --tracing-service-name - Preview: OpenTelemetry service name. Takes precedence over 'service.name' - defined in the 'tracing-resource-attributes' property. Default: keycloak. - Available only when 'opentelemetry' feature and Tracing is enabled. + OpenTelemetry service name. Takes precedence over 'service.name' defined in + the 'tracing-resource-attributes' property. Default: keycloak. Available + only when Tracing is enabled. Events (Preview): diff --git a/quarkus/tests/integration/src/test/resources/org/keycloak/it/cli/dist/approvals/cli/help/HelpCommandDistTest.testStartDevHelp.approved.txt b/quarkus/tests/integration/src/test/resources/org/keycloak/it/cli/dist/approvals/cli/help/HelpCommandDistTest.testStartDevHelp.approved.txt index 5ac1b16b54d..6630bb72b8d 100644 --- a/quarkus/tests/integration/src/test/resources/org/keycloak/it/cli/dist/approvals/cli/help/HelpCommandDistTest.testStartDevHelp.approved.txt +++ b/quarkus/tests/integration/src/test/resources/org/keycloak/it/cli/dist/approvals/cli/help/HelpCommandDistTest.testStartDevHelp.approved.txt @@ -313,6 +313,12 @@ Logging: Possible values are (case insensitive): off, fatal, error, warn, info, debug, trace, all. +Tracing: + +--tracing-enabled + Enables the OpenTelemetry tracing. Default: false. Available only when + 'opentelemetry' feature is enabled. + Truststore: --tls-hostname-verifier diff --git a/quarkus/tests/integration/src/test/resources/org/keycloak/it/cli/dist/approvals/cli/help/HelpCommandDistTest.testStartDevHelpAll.approved.txt b/quarkus/tests/integration/src/test/resources/org/keycloak/it/cli/dist/approvals/cli/help/HelpCommandDistTest.testStartDevHelpAll.approved.txt index 608b0ac6fae..1b6ddb5bf51 100644 --- a/quarkus/tests/integration/src/test/resources/org/keycloak/it/cli/dist/approvals/cli/help/HelpCommandDistTest.testStartDevHelpAll.approved.txt +++ b/quarkus/tests/integration/src/test/resources/org/keycloak/it/cli/dist/approvals/cli/help/HelpCommandDistTest.testStartDevHelpAll.approved.txt @@ -408,43 +408,42 @@ Logging: Set the Syslog type used to format the sent message. Possible values are: rfc5424, rfc3164. Default: rfc5424. Available only when Syslog is activated. -Tracing (Preview): +Tracing: --tracing-compression - Preview: OpenTelemetry compression method used to compress payloads. If unset, + OpenTelemetry compression method used to compress payloads. If unset, compression is disabled. Possible values are: gzip, none. Default: none. - Available only when 'opentelemetry' feature and Tracing is enabled. + Available only when Tracing is enabled. --tracing-enabled - Preview: Enables the OpenTelemetry tracing. Default: false. Available only - when 'opentelemetry' feature is enabled. + Enables the OpenTelemetry tracing. Default: false. Available only when + 'opentelemetry' feature is enabled. --tracing-endpoint - Preview: OpenTelemetry endpoint to connect to. Default: http://localhost:4317. - Available only when 'opentelemetry' feature and Tracing is enabled. + OpenTelemetry endpoint to connect to. Default: http://localhost:4317. + Available only when Tracing is enabled. --tracing-jdbc-enabled - Preview: Enables the OpenTelemetry JDBC tracing. Default: true. Available only - when 'opentelemetry' feature and Tracing is enabled. + Enables the OpenTelemetry JDBC tracing. Default: true. Available only when + Tracing is enabled. --tracing-protocol - Preview: OpenTelemetry protocol used for the telemetry data. Possible values - are: grpc, http/protobuf. Default: grpc. Available only when 'opentelemetry' - feature and Tracing is enabled. + OpenTelemetry protocol used for the telemetry data. Possible values are: grpc, + http/protobuf. Default: grpc. Available only when Tracing is enabled. --tracing-resource-attributes - Preview: OpenTelemetry resource attributes present in the exported trace to + OpenTelemetry resource attributes present in the exported trace to characterize the telemetry producer. Values in format 'key1=val1,key2=val2'. - For more information, check the Tracing guide. Available only when - 'opentelemetry' feature and Tracing is enabled. + For more information, check the Tracing guide. Available only when Tracing + is enabled. --tracing-sampler-ratio - Preview: OpenTelemetry sampler ratio. Probability that a span will be sampled. - Expected double value in interval <0,1). Default: 1.0. Available only when - 'opentelemetry' feature and Tracing is enabled. + OpenTelemetry sampler ratio. Probability that a span will be sampled. Expected + double value in interval <0,1). Default: 1.0. Available only when Tracing is + enabled. --tracing-sampler-type - Preview: OpenTelemetry sampler to use for tracing. Possible values are: - always_on, always_off, traceidratio, parentbased_always_on, - parentbased_always_off, parentbased_traceidratio. Default: traceidratio. - Available only when 'opentelemetry' feature and Tracing is enabled. + OpenTelemetry sampler to use for tracing. Possible values are: always_on, + always_off, traceidratio, parentbased_always_on, parentbased_always_off, + parentbased_traceidratio. Default: traceidratio. Available only when Tracing + is enabled. --tracing-service-name - Preview: OpenTelemetry service name. Takes precedence over 'service.name' - defined in the 'tracing-resource-attributes' property. Default: keycloak. - Available only when 'opentelemetry' feature and Tracing is enabled. + OpenTelemetry service name. Takes precedence over 'service.name' defined in + the 'tracing-resource-attributes' property. Default: keycloak. Available + only when Tracing is enabled. Events (Preview): diff --git a/quarkus/tests/integration/src/test/resources/org/keycloak/it/cli/dist/approvals/cli/help/HelpCommandDistTest.testStartHelp.approved.txt b/quarkus/tests/integration/src/test/resources/org/keycloak/it/cli/dist/approvals/cli/help/HelpCommandDistTest.testStartHelp.approved.txt index e4e37a3d2e2..35977191fc7 100644 --- a/quarkus/tests/integration/src/test/resources/org/keycloak/it/cli/dist/approvals/cli/help/HelpCommandDistTest.testStartHelp.approved.txt +++ b/quarkus/tests/integration/src/test/resources/org/keycloak/it/cli/dist/approvals/cli/help/HelpCommandDistTest.testStartHelp.approved.txt @@ -320,6 +320,12 @@ Logging: Possible values are (case insensitive): off, fatal, error, warn, info, debug, trace, all. +Tracing: + +--tracing-enabled + Enables the OpenTelemetry tracing. Default: false. Available only when + 'opentelemetry' feature is enabled. + Truststore: --tls-hostname-verifier diff --git a/quarkus/tests/integration/src/test/resources/org/keycloak/it/cli/dist/approvals/cli/help/HelpCommandDistTest.testStartHelpAll.approved.txt b/quarkus/tests/integration/src/test/resources/org/keycloak/it/cli/dist/approvals/cli/help/HelpCommandDistTest.testStartHelpAll.approved.txt index 538720e5643..4f808854feb 100644 --- a/quarkus/tests/integration/src/test/resources/org/keycloak/it/cli/dist/approvals/cli/help/HelpCommandDistTest.testStartHelpAll.approved.txt +++ b/quarkus/tests/integration/src/test/resources/org/keycloak/it/cli/dist/approvals/cli/help/HelpCommandDistTest.testStartHelpAll.approved.txt @@ -409,43 +409,42 @@ Logging: Set the Syslog type used to format the sent message. Possible values are: rfc5424, rfc3164. Default: rfc5424. Available only when Syslog is activated. -Tracing (Preview): +Tracing: --tracing-compression - Preview: OpenTelemetry compression method used to compress payloads. If unset, + OpenTelemetry compression method used to compress payloads. If unset, compression is disabled. Possible values are: gzip, none. Default: none. - Available only when 'opentelemetry' feature and Tracing is enabled. + Available only when Tracing is enabled. --tracing-enabled - Preview: Enables the OpenTelemetry tracing. Default: false. Available only - when 'opentelemetry' feature is enabled. + Enables the OpenTelemetry tracing. Default: false. Available only when + 'opentelemetry' feature is enabled. --tracing-endpoint - Preview: OpenTelemetry endpoint to connect to. Default: http://localhost:4317. - Available only when 'opentelemetry' feature and Tracing is enabled. + OpenTelemetry endpoint to connect to. Default: http://localhost:4317. + Available only when Tracing is enabled. --tracing-jdbc-enabled - Preview: Enables the OpenTelemetry JDBC tracing. Default: true. Available only - when 'opentelemetry' feature and Tracing is enabled. + Enables the OpenTelemetry JDBC tracing. Default: true. Available only when + Tracing is enabled. --tracing-protocol - Preview: OpenTelemetry protocol used for the telemetry data. Possible values - are: grpc, http/protobuf. Default: grpc. Available only when 'opentelemetry' - feature and Tracing is enabled. + OpenTelemetry protocol used for the telemetry data. Possible values are: grpc, + http/protobuf. Default: grpc. Available only when Tracing is enabled. --tracing-resource-attributes - Preview: OpenTelemetry resource attributes present in the exported trace to + OpenTelemetry resource attributes present in the exported trace to characterize the telemetry producer. Values in format 'key1=val1,key2=val2'. - For more information, check the Tracing guide. Available only when - 'opentelemetry' feature and Tracing is enabled. + For more information, check the Tracing guide. Available only when Tracing + is enabled. --tracing-sampler-ratio - Preview: OpenTelemetry sampler ratio. Probability that a span will be sampled. - Expected double value in interval <0,1). Default: 1.0. Available only when - 'opentelemetry' feature and Tracing is enabled. + OpenTelemetry sampler ratio. Probability that a span will be sampled. Expected + double value in interval <0,1). Default: 1.0. Available only when Tracing is + enabled. --tracing-sampler-type - Preview: OpenTelemetry sampler to use for tracing. Possible values are: - always_on, always_off, traceidratio, parentbased_always_on, - parentbased_always_off, parentbased_traceidratio. Default: traceidratio. - Available only when 'opentelemetry' feature and Tracing is enabled. + OpenTelemetry sampler to use for tracing. Possible values are: always_on, + always_off, traceidratio, parentbased_always_on, parentbased_always_off, + parentbased_traceidratio. Default: traceidratio. Available only when Tracing + is enabled. --tracing-service-name - Preview: OpenTelemetry service name. Takes precedence over 'service.name' - defined in the 'tracing-resource-attributes' property. Default: keycloak. - Available only when 'opentelemetry' feature and Tracing is enabled. + OpenTelemetry service name. Takes precedence over 'service.name' defined in + the 'tracing-resource-attributes' property. Default: keycloak. Available + only when Tracing is enabled. Events (Preview): diff --git a/quarkus/tests/integration/src/test/resources/org/keycloak/it/cli/dist/approvals/cli/help/HelpCommandDistTest.testStartOptimizedHelpAll.approved.txt b/quarkus/tests/integration/src/test/resources/org/keycloak/it/cli/dist/approvals/cli/help/HelpCommandDistTest.testStartOptimizedHelpAll.approved.txt index 7da7d4e45c2..1bbfaad488e 100644 --- a/quarkus/tests/integration/src/test/resources/org/keycloak/it/cli/dist/approvals/cli/help/HelpCommandDistTest.testStartOptimizedHelpAll.approved.txt +++ b/quarkus/tests/integration/src/test/resources/org/keycloak/it/cli/dist/approvals/cli/help/HelpCommandDistTest.testStartOptimizedHelpAll.approved.txt @@ -360,32 +360,31 @@ Logging: Set the Syslog type used to format the sent message. Possible values are: rfc5424, rfc3164. Default: rfc5424. Available only when Syslog is activated. -Tracing (Preview): +Tracing: --tracing-compression - Preview: OpenTelemetry compression method used to compress payloads. If unset, + OpenTelemetry compression method used to compress payloads. If unset, compression is disabled. Possible values are: gzip, none. Default: none. - Available only when 'opentelemetry' feature and Tracing is enabled. + Available only when Tracing is enabled. --tracing-endpoint - Preview: OpenTelemetry endpoint to connect to. Default: http://localhost:4317. - Available only when 'opentelemetry' feature and Tracing is enabled. + OpenTelemetry endpoint to connect to. Default: http://localhost:4317. + Available only when Tracing is enabled. --tracing-protocol - Preview: OpenTelemetry protocol used for the telemetry data. Possible values - are: grpc, http/protobuf. Default: grpc. Available only when 'opentelemetry' - feature and Tracing is enabled. + OpenTelemetry protocol used for the telemetry data. Possible values are: grpc, + http/protobuf. Default: grpc. Available only when Tracing is enabled. --tracing-resource-attributes - Preview: OpenTelemetry resource attributes present in the exported trace to + OpenTelemetry resource attributes present in the exported trace to characterize the telemetry producer. Values in format 'key1=val1,key2=val2'. - For more information, check the Tracing guide. Available only when - 'opentelemetry' feature and Tracing is enabled. + For more information, check the Tracing guide. Available only when Tracing + is enabled. --tracing-sampler-ratio - Preview: OpenTelemetry sampler ratio. Probability that a span will be sampled. - Expected double value in interval <0,1). Default: 1.0. Available only when - 'opentelemetry' feature and Tracing is enabled. + OpenTelemetry sampler ratio. Probability that a span will be sampled. Expected + double value in interval <0,1). Default: 1.0. Available only when Tracing is + enabled. --tracing-service-name - Preview: OpenTelemetry service name. Takes precedence over 'service.name' - defined in the 'tracing-resource-attributes' property. Default: keycloak. - Available only when 'opentelemetry' feature and Tracing is enabled. + OpenTelemetry service name. Takes precedence over 'service.name' defined in + the 'tracing-resource-attributes' property. Default: keycloak. Available + only when Tracing is enabled. Events (Preview): diff --git a/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/tracing/OTelTracingProviderTest.java b/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/tracing/OTelTracingProviderTest.java index 0acb832e410..2cc0681e6f0 100644 --- a/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/tracing/OTelTracingProviderTest.java +++ b/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/tracing/OTelTracingProviderTest.java @@ -32,11 +32,9 @@ import org.junit.Before; import org.junit.FixMethodOrder; import org.junit.Test; import org.junit.runners.MethodSorters; -import org.keycloak.common.Profile; import org.keycloak.representations.idm.RealmRepresentation; import org.keycloak.testsuite.AbstractTestRealmKeycloakTest; import org.keycloak.testsuite.arquillian.annotation.AuthServerContainerExclude; -import org.keycloak.testsuite.arquillian.annotation.EnableFeature; import org.keycloak.testsuite.arquillian.containers.AbstractQuarkusDeployableContainer; import org.keycloak.tracing.NoopTracingProvider; import org.keycloak.tracing.TracingProvider; @@ -52,7 +50,6 @@ import static org.hamcrest.Matchers.not; import static org.hamcrest.Matchers.notNullValue; @AuthServerContainerExclude(value = AuthServerContainerExclude.AuthServer.UNDERTOW) -@EnableFeature(value = Profile.Feature.OPENTELEMETRY, skipRestart = true) @FixMethodOrder(MethodSorters.NAME_ASCENDING) public class OTelTracingProviderTest extends AbstractTestRealmKeycloakTest {