[OTel] Provide general options for telemetry settings (#41705)

* [OTel] Provide general options for telemetry settings

Closes #41263

Co-authored-by: Ryan Emerson <remerson@redhat.com>
Signed-off-by: Martin Bartoš <mabartos@redhat.com>

* Update docs/guides/observability/telemetry.adoc

Co-authored-by: Václav Muzikář <vaclav@muzikari.cz>
Signed-off-by: Martin Bartoš <mabartos@redhat.com>

* Provide release notes and deprecation note

Signed-off-by: Martin Bartoš <mabartos@redhat.com>

* Ignore link to the telemetry guide for now

Signed-off-by: Martin Bartoš <mabartos@redhat.com>

---------

Signed-off-by: Martin Bartoš <mabartos@redhat.com>
Co-authored-by: Ryan Emerson <remerson@redhat.com>
Co-authored-by: Václav Muzikář <vaclav@muzikari.cz>
This commit is contained in:
Martin Bartoš
2025-12-10 13:03:46 +01:00
committed by GitHub
parent be22a4bd62
commit 8def691053
24 changed files with 740 additions and 104 deletions

View File

@@ -129,7 +129,7 @@ public class Profile {
OID4VC_VCI("Support for the OID4VCI protocol as part of OID4VC.", Type.EXPERIMENTAL),
OPENTELEMETRY("OpenTelemetry Tracing", Type.DEFAULT),
OPENTELEMETRY("OpenTelemetry support", Type.DEFAULT),
DECLARATIVE_UI("declarative ui spi", Type.EXPERIMENTAL),

View File

@@ -129,3 +129,13 @@ MDC enables Keycloak to enrich log entries with contextual information such as r
For more details, see the https://www.keycloak.org/server/logging#_adding_context_for_log_messages[Adding context for log messages] guide.
== New centralized telemetry options
{project_name} now provides centralized telemetry configuration options that can be shared across all telemetry (OpenTelemetry) components - traces, with future support planned for logs and metrics.
Individual components can override these global settings when needed.
New options: `telemetry-endpoint`, `telemetry-protocol`, `telemetry-service-name`, and `telemetry-resource-attributes`.
*Deprecation:* The `tracing-service-name` and `tracing-resource-attributes` options are now deprecated in favor of `telemetry-service-name` and `telemetry-resource-attributes`.
For more details, see the link:{telemetryguide_link}[{telemetryguide_name}] guide.

View File

@@ -44,4 +44,7 @@ https://saml.xml.org*
# To be removed once KC 26.4.2 is released
https://www.keycloak.org/server/db#multiple-datasources
https://www.keycloak.org/server/logging#http-access-logging
https://www.keycloak.org/server/logging#mdc
https://www.keycloak.org/server/logging#mdc
# To be removed once KC 26.5.0 is release
https://www.keycloak.org/observability/telemetry

View File

@@ -89,6 +89,8 @@
:operatorguide_link: https://www.keycloak.org/guides#operator
:tracingguide_name: Root cause analysis with tracing
:tracingguide_link: https://www.keycloak.org/observability/tracing
:telemetryguide_name: Centralize your observability stack with OpenTelemetry
:telemetryguide_link: https://www.keycloak.org/observability/telemetry
:upgradingguide_name: Upgrading Guide
:upgradingguide_name_short: Upgrading
:upgradingguide_link: {project_doc_base_url}/upgrading/

View File

@@ -181,6 +181,20 @@ It is still triggered in this {project_name} version, but will be removed in a f
Fine-Grained Admin Permissions (FGAP) v1 is now deprecated. This version no longer receives enhancements and improvements and will be removed in future
release. Please migrate to FGAP v2 to ensure continued support.
=== Tracing options `tracing-service-name` and `tracing-resource-attributes`
The `tracing-service-name` and `tracing-resource-attributes` options are now deprecated in favor of the new centralized telemetry options `telemetry-service-name` and `telemetry-resource-attributes`.
The service name and resource attributes are not directly related to the OpenTelemetry Tracing itself, but to the whole OpenTelemetry settings.
The deprecated options will continue to work, but the new telemetry options take precedence.
Migration path:
[source]
----
tracing-service-name --> telemetry-service-name
tracing-resource-attributes --> telemetry-resource-attributes
----
// ------------------------ Removed features ------------------------ //
== Removed features

View File

@@ -1,3 +1,4 @@
telemetry
health
configuration-metrics
event-metrics

View File

@@ -0,0 +1,65 @@
<#import "/templates/guide.adoc" as tmpl>
<#import "/templates/kc.adoc" as kc>
<#import "/templates/options.adoc" as opts>
<#import "/templates/links.adoc" as links>
<@tmpl.guide
title="Centralize your observability stack with OpenTelemetry"
summary="Learn about OpenTelemetry integration for centralized observability and telemetry data.">
https://opentelemetry.io/docs/what-is-opentelemetry/[OpenTelemetry] (OTel) is an open-source observability framework designed to provide consistent and reliable ways to collect telemetry data across distributed systems.
It is a project under the https://www.cncf.io/projects/opentelemetry/[Cloud Native Computing Foundation (CNCF)] as an incubating project.
Its goal is to provide a unified standard and toolset for instrumenting, generating, and exporting telemetry data from modern applications, making it easier to monitor, debug, and understand complex services.
The goal of {project_name} is to support OpenTelemetry Logs, Metrics, and Traces to create a centralized observability stack without any additional deployment overhead.
== General options
{project_name} provides support for global settings of telemetry data export.
It means that you can configure connection parameters to a single https://opentelemetry.io/docs/collector/[OpenTelemetry collector] that will be used for all supported components.
In order to have OpenTelemetry enabled, at least one component needs to be turned on, for example <<traces, Traces>>.
NOTE: The OpenTelemetry feature is _enabled_ by default. Disable the feature in order to disable OpenTelemetry components.
=== Endpoint
You can configure the OpenTelemetry collector's global endpoint that is shared across all components by using the `telemetry-endpoint` option.
The default value is `+http://localhost:4317+`.
You can change the endpoint via CLI as follows:
<@kc.start parameters="--telemetry-endpoint=http://my-otel-endpoint:4317"/>
=== Service name
You can configure the global OpenTelemetry service name used for identifying the exporter of the telemetry data.
The default service name is `keycloak`, specified via the `telemetry-service-name` property, which takes precedence over `service.name` defined in the `telemetry-resource-attributes` property.
You can change the service name via CLI as follows:
<@kc.start parameters="--telemetry-service-name=my-keycloak-iam"/>
=== Protocol
You can configure the global OpenTelemetry transport protocol used as a communication channel between {project_name} and the OpenTelemetry collector.
The default value is `grpc`.
{project_name} supports these communication protocols:
<@opts.expectedValues option="telemetry-protocol"/>
You can change the protocol via CLI as follows:
<@kc.start parameters="--telemetry-protocol=http/protobuf"/>
== Traces
See the https://www.keycloak.org/observability/tracing[Root cause analysis with tracing guide].
You can override the global OpenTelemetry settings via the Tracing options if you want to export traces to a different OpenTelemetry collector.
<@opts.printRelevantOptions includedOptions="telemetry-*">
=== Traces
<@opts.includeOptions includedOptions="tracing-enabled tracing-endpoint tracing-protocol tracing-service-name tracing-resource-attributes"/>
</@opts.printRelevantOptions>
</@tmpl.guide>

View File

@@ -26,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.
WARNING: Properties `tracing-service-name` and `tracing-resource-attributes` are *deprecated*, and you should use the `telemetry-service-name` and `telemetry-resource-attributes`, respectively.
NOTE: Tracing can be enabled only when the `opentelemetry` feature is *enabled* (by default).
For more tracing settings, see all possible configurations below.

View File

@@ -17,8 +17,9 @@ public enum OptionCategory {
PROXY("Proxy", 90, ConfigSupportLevel.SUPPORTED),
VAULT("Vault", 100, ConfigSupportLevel.SUPPORTED),
LOGGING("Logging", 110, ConfigSupportLevel.SUPPORTED),
TRACING("Tracing", 111, ConfigSupportLevel.SUPPORTED),
EVENTS("Events", 112, ConfigSupportLevel.SUPPORTED),
TELEMETRY("Telemetry (OpenTelemetry)", 112, ConfigSupportLevel.SUPPORTED),
TRACING("Tracing", 113, ConfigSupportLevel.SUPPORTED),
EVENTS("Events", 114, ConfigSupportLevel.SUPPORTED),
TRUSTSTORE("Truststore", 115, ConfigSupportLevel.SUPPORTED),
SECURITY("Security", 120, ConfigSupportLevel.SUPPORTED),
EXPORT("Export", 130, ConfigSupportLevel.SUPPORTED),

View File

@@ -0,0 +1,36 @@
package org.keycloak.config;
import java.util.List;
public class TelemetryOptions {
public static final Option<Boolean> TELEMETRY_ENABLED = new OptionBuilder<>("telemetry-enabled", Boolean.class)
.category(OptionCategory.TELEMETRY)
.buildTime(true)
.hidden()
.build();
public static final Option<String> TELEMETRY_ENDPOINT = new OptionBuilder<>("telemetry-endpoint", String.class)
.category(OptionCategory.TELEMETRY)
.description("OpenTelemetry endpoint to connect to.")
.defaultValue("http://localhost:4317")
.build();
public static final Option<String> TELEMETRY_SERVICE_NAME = new OptionBuilder<>("telemetry-service-name", String.class)
.category(OptionCategory.TELEMETRY)
.description("OpenTelemetry service name. Takes precedence over 'service.name' defined in the 'telemetry-resource-attributes' property.")
.defaultValue("keycloak")
.build();
public static final Option<String> TELEMETRY_PROTOCOL = new OptionBuilder<>("telemetry-protocol", String.class)
.category(OptionCategory.TELEMETRY)
.description("OpenTelemetry protocol used for the communication between server and OpenTelemetry collector.")
.defaultValue("grpc")
.expectedValues("grpc", "http/protobuf")
.build();
public static final Option<List<String>> TELEMETRY_RESOURCE_ATTRIBUTES = OptionBuilder.listOptionBuilder("telemetry-resource-attributes", String.class)
.category(OptionCategory.TELEMETRY)
.description("OpenTelemetry resource attributes characterize the telemetry producer. Values in format 'key1=val1,key2=val2'.")
.build();
}

View File

@@ -33,7 +33,7 @@ public class TracingOptions {
public static final Option<String> TRACING_ENDPOINT = new OptionBuilder<>("tracing-endpoint", String.class)
.category(OptionCategory.TRACING)
.description("OpenTelemetry endpoint to connect to.")
.description("OpenTelemetry endpoint to connect to for traces. If not given, the value is inherited from the '%s' option.".formatted(TelemetryOptions.TELEMETRY_ENDPOINT.getKey()))
.defaultValue("http://localhost:4317")
.build();
@@ -44,19 +44,32 @@ public class TracingOptions {
.buildTime(true)
.build();
/**
* @deprecated use the {@link TelemetryOptions#TELEMETRY_SERVICE_NAME}
*/
@Deprecated
public static final Option<String> TRACING_SERVICE_NAME = new OptionBuilder<>("tracing-service-name", String.class)
.category(OptionCategory.TRACING)
.description("OpenTelemetry service name. Takes precedence over 'service.name' defined in the 'tracing-resource-attributes' property.")
.deprecated()
.deprecatedMetadata(DeprecatedMetadata.deprecateOption("Service name is not directly related to Tracing and you should use the Telemetry option which takes precedence.", TelemetryOptions.TELEMETRY_SERVICE_NAME.getKey()))
.description("OpenTelemetry service name. Takes precedence over 'service.name' defined in the 'tracing-resource-attributes' property. If not given, the value is inherited from the '%s' option.".formatted(TelemetryOptions.TELEMETRY_SERVICE_NAME.getKey()))
.defaultValue("keycloak")
.build();
/**
* @deprecated use the {@link TelemetryOptions#TELEMETRY_RESOURCE_ATTRIBUTES}
*/
@Deprecated
public static final Option<List<String>> TRACING_RESOURCE_ATTRIBUTES = OptionBuilder.listOptionBuilder("tracing-resource-attributes", String.class)
.category(OptionCategory.TRACING)
.description("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.")
.deprecated()
.deprecatedMetadata(DeprecatedMetadata.deprecateOption("Resource attributes are not directly related to Tracing and you should use the Telemetry option which takes precedence.", TelemetryOptions.TELEMETRY_RESOURCE_ATTRIBUTES.getKey()))
.description("OpenTelemetry resource attributes present in the exported trace to characterize the telemetry producer. Values in format 'key1=val1,key2=val2'. If not given, the value is inherited from the '%s' option. For more information, check the Tracing guide.".formatted(TelemetryOptions.TELEMETRY_RESOURCE_ATTRIBUTES.getKey()))
.build();
public static final Option<String> TRACING_PROTOCOL = new OptionBuilder<>("tracing-protocol", String.class)
.category(OptionCategory.TRACING)
.description("OpenTelemetry protocol used for the telemetry data.")
.description("OpenTelemetry protocol used for the telemetry data. If not given, the value is inherited from the '%s' option.".formatted(TelemetryOptions.TELEMETRY_PROTOCOL.getKey()))
.defaultValue("grpc")
.expectedValues("grpc", "http/protobuf")
.build();

View File

@@ -54,7 +54,7 @@ public final class PropertyMappers {
new FeaturePropertyMappers(), new ImportPropertyMappers(), new ManagementPropertyMappers(),
new MetricsPropertyMappers(), new OpenApiPropertyMappers(), new LoggingPropertyMappers(), new ProxyPropertyMappers(),
new VaultPropertyMappers(), new TracingPropertyMappers(), new TransactionPropertyMappers(),
new SecurityPropertyMappers(), new TruststorePropertyMappers());
new SecurityPropertyMappers(), new TruststorePropertyMappers(), new TelemetryPropertyMappers());
}
public static List<PropertyMapperGrouping> getPropertyMapperGroupings() {

View File

@@ -0,0 +1,94 @@
package org.keycloak.quarkus.runtime.configuration.mappers;
import java.net.MalformedURLException;
import java.net.URISyntaxException;
import java.net.URL;
import java.util.List;
import org.keycloak.common.Profile;
import org.keycloak.config.TracingOptions;
import org.keycloak.quarkus.runtime.cli.PropertyException;
import org.keycloak.quarkus.runtime.configuration.Configuration;
import org.keycloak.utils.StringUtil;
import io.smallrye.config.ConfigSourceInterceptorContext;
import static org.keycloak.config.TelemetryOptions.TELEMETRY_ENABLED;
import static org.keycloak.config.TelemetryOptions.TELEMETRY_ENDPOINT;
import static org.keycloak.config.TelemetryOptions.TELEMETRY_PROTOCOL;
import static org.keycloak.config.TelemetryOptions.TELEMETRY_RESOURCE_ATTRIBUTES;
import static org.keycloak.config.TelemetryOptions.TELEMETRY_SERVICE_NAME;
import static org.keycloak.quarkus.runtime.configuration.mappers.PropertyMapper.fromOption;
public class TelemetryPropertyMappers implements PropertyMapperGrouping{
private static final String OTEL_FEATURE_ENABLED_MSG = "'opentelemetry' feature is enabled";
private static final String OTEL_COLLECTOR_ENABLED_MSG = "any of available OpenTelemetry components (Traces) is turned on";
@Override
public List<? extends PropertyMapper<?>> getPropertyMappers() {
return List.of(
fromOption(TELEMETRY_ENABLED)
.isEnabled(TelemetryPropertyMappers::isFeatureEnabled, OTEL_FEATURE_ENABLED_MSG)
.transformer(TelemetryPropertyMappers::checkIfDependantsAreEnabled)
.to("quarkus.otel.enabled")
.build(),
fromOption(TELEMETRY_ENDPOINT)
.isEnabled(TelemetryPropertyMappers::isTelemetryEnabled, OTEL_COLLECTOR_ENABLED_MSG)
.to("quarkus.otel.exporter.otlp.endpoint")
.paramLabel("url")
.validator(TelemetryPropertyMappers::validateEndpoint)
.build(),
fromOption(TELEMETRY_SERVICE_NAME)
.mapFrom(TracingOptions.TRACING_SERVICE_NAME) // the tracing option is deprecated, but we need to be backward compatible
.isEnabled(TelemetryPropertyMappers::isTelemetryEnabled, OTEL_COLLECTOR_ENABLED_MSG)
.to("quarkus.otel.service.name")
.paramLabel("name")
.build(),
fromOption(TELEMETRY_PROTOCOL)
.isEnabled(TelemetryPropertyMappers::isTelemetryEnabled, OTEL_COLLECTOR_ENABLED_MSG)
.to("quarkus.otel.exporter.otlp.protocol")
.paramLabel("protocol")
.build(),
fromOption(TELEMETRY_RESOURCE_ATTRIBUTES)
.mapFrom(TracingOptions.TRACING_RESOURCE_ATTRIBUTES) // the tracing option is deprecated, but we need to be backward compatible
.isEnabled(TelemetryPropertyMappers::isTelemetryEnabled, OTEL_COLLECTOR_ENABLED_MSG)
.to("quarkus.otel.resource.attributes")
.paramLabel("attributes")
.build()
);
}
private static String checkIfDependantsAreEnabled(String value, ConfigSourceInterceptorContext context) {
if (Configuration.isTrue(TracingOptions.TRACING_ENABLED)) {
return Boolean.TRUE.toString();
}
return Boolean.FALSE.toString();
}
private static boolean isFeatureEnabled() {
return Profile.isFeatureEnabled(Profile.Feature.OPENTELEMETRY);
}
public static boolean isTelemetryEnabled() {
return Configuration.isTrue("quarkus.otel.enabled");
}
static void validateEndpoint(String value) {
if (StringUtil.isBlank(value)) {
throw new PropertyException("Specified Endpoint URL must not be empty.");
}
if (!isValidUrl(value)) {
throw new PropertyException("Specified Endpoint URL is invalid.");
}
}
static boolean isValidUrl(String url) {
try {
new URL(url).toURI();
return true;
} catch (MalformedURLException | URISyntaxException e) {
return false;
}
}
}

View File

@@ -17,15 +17,13 @@
package org.keycloak.quarkus.runtime.configuration.mappers;
import java.net.MalformedURLException;
import java.net.URISyntaxException;
import java.net.URL;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.stream.Collectors;
import org.keycloak.common.Profile;
import org.keycloak.config.TelemetryOptions;
import org.keycloak.config.TracingOptions;
import org.keycloak.quarkus.runtime.cli.PropertyException;
import org.keycloak.quarkus.runtime.configuration.Configuration;
@@ -62,26 +60,28 @@ public class TracingPropertyMappers implements PropertyMapperGrouping {
return List.of(
fromOption(TRACING_ENABLED)
.isEnabled(TracingPropertyMappers::isFeatureEnabled, OTEL_FEATURE_ENABLED_MSG)
.to("quarkus.otel.enabled") // enable/disable whole OTel, tracing is enabled by default
.to("quarkus.otel.traces.enabled")
.build(),
fromOption(TRACING_ENDPOINT)
.isEnabled(TracingPropertyMappers::isTracingEnabled, TRACING_ENABLED_MSG)
.mapFrom(TelemetryOptions.TELEMETRY_ENDPOINT)
.to("quarkus.otel.exporter.otlp.traces.endpoint")
.paramLabel("url")
.validator(TracingPropertyMappers::validateEndpoint)
.validator(TelemetryPropertyMappers::validateEndpoint)
.build(),
fromOption(TRACING_SERVICE_NAME)
// mapped to 'telemetry-service-name'
.isEnabled(TracingPropertyMappers::isTracingEnabled, TRACING_ENABLED_MSG)
.to("quarkus.otel.service.name")
.paramLabel("name")
.build(),
fromOption(TRACING_RESOURCE_ATTRIBUTES)
// mapped to 'telemetry-resource-attributes'
.isEnabled(TracingPropertyMappers::isTracingEnabled, TRACING_ENABLED_MSG)
.to("quarkus.otel.resource.attributes")
.paramLabel("attributes")
.build(),
fromOption(TRACING_PROTOCOL)
.isEnabled(TracingPropertyMappers::isTracingEnabled, TRACING_ENABLED_MSG)
.mapFrom(TelemetryOptions.TELEMETRY_PROTOCOL)
.to("quarkus.otel.exporter.otlp.traces.protocol")
.paramLabel("protocol")
.build(),
@@ -125,16 +125,6 @@ public class TracingPropertyMappers implements PropertyMapperGrouping {
);
}
private static void validateEndpoint(String value) {
if (StringUtil.isBlank(value)) {
throw new PropertyException("URL specified in 'tracing-endpoint' option must not be empty.");
}
if (!isValidUrl(value)) {
throw new PropertyException("URL specified in 'tracing-endpoint' option is invalid.");
}
}
private static void validateRatio(String value) {
if (StringUtil.isBlank(value)) {
throw new PropertyException("Ratio in 'tracing-sampler-ratio' option must not be empty.");
@@ -184,13 +174,4 @@ public class TracingPropertyMappers implements PropertyMapperGrouping {
public static boolean isTracingAndEmbeddedInfinispanEnabled() {
return Configuration.isTrue(TRACING_ENABLED) && CachingPropertyMappers.cacheSetToInfinispan();
}
private static boolean isValidUrl(String url) {
try {
new URL(url).toURI();
return true;
} catch (MalformedURLException | URISyntaxException e) {
return false;
}
}
}

View File

@@ -47,6 +47,7 @@ import picocli.CommandLine;
import picocli.CommandLine.Help;
import static org.hamcrest.MatcherAssert.assertThat;
import static org.hamcrest.Matchers.anyOf;
import static org.hamcrest.Matchers.containsString;
import static org.hamcrest.Matchers.is;
import static org.hamcrest.Matchers.not;
@@ -1231,4 +1232,142 @@ public class PicocliTest extends AbstractConfigurationTest {
assertEquals(CommandLine.ExitCode.USAGE, nonRunningPicocli.exitCode);
assertThat(nonRunningPicocli.getErrString(), containsString("Wrong value for feature 'dpop': wrong. You can specify either 'enabled', 'disabled', or specific version (lowercase) that will be enabled"));
}
@Test
public void otelTracing() {
// tracing options
NonRunningPicocli nonRunningPicocli = pseudoLaunch("start-dev", "--tracing-enabled=true", "--tracing-service-name=service");
assertEquals(CommandLine.ExitCode.OK, nonRunningPicocli.exitCode);
assertThat(nonRunningPicocli.config.getConfigValue("quarkus.otel.enabled").getValue(), is("true"));
assertThat(nonRunningPicocli.config.getConfigValue("quarkus.otel.traces.enabled").getValue(), is("true"));
assertThat(nonRunningPicocli.config.getConfigValue("quarkus.otel.service.name").getValue(), is("service"));
assertThat(nonRunningPicocli.getOutString(), containsString("The following used options or option values are DEPRECATED"));
assertThat(nonRunningPicocli.getOutString(), containsString("tracing-service-name: Service name is not directly related to Tracing and you should use the Telemetry option which takes precedence. Use telemetry-service-name"));
onAfter();
// tracing enabled option + telemetry
nonRunningPicocli = pseudoLaunch("start-dev", "--tracing-enabled=true", "--telemetry-endpoint=http://endpoint:3232");
assertEquals(CommandLine.ExitCode.OK, nonRunningPicocli.exitCode);
assertThat(nonRunningPicocli.config.getConfigValue("quarkus.otel.enabled").getValue(), is("true"));
assertThat(nonRunningPicocli.config.getConfigValue("quarkus.otel.traces.enabled").getValue(), is("true"));
assertThat(nonRunningPicocli.config.getConfigValue("quarkus.otel.exporter.otlp.traces.endpoint").getValue(), is("http://endpoint:3232"));
onAfter();
// combined service name
nonRunningPicocli = pseudoLaunch("start-dev", "--tracing-enabled=true", "--telemetry-service-name=service123", "--tracing-service-name=service456");
assertEquals(CommandLine.ExitCode.OK, nonRunningPicocli.exitCode);
assertThat(nonRunningPicocli.config.getConfigValue("quarkus.otel.enabled").getValue(), is("true"));
assertThat(nonRunningPicocli.config.getConfigValue("quarkus.otel.traces.enabled").getValue(), is("true"));
assertThat(nonRunningPicocli.config.getConfigValue("quarkus.otel.service.name").getValue(), is("service123"));
onAfter();
// combined service name + disabled tracing
nonRunningPicocli = pseudoLaunch("start-dev", "--telemetry-service-name=service123", "--tracing-service-name=service456");
assertEquals(CommandLine.ExitCode.USAGE, nonRunningPicocli.exitCode);
assertThat(nonRunningPicocli.getErrString(), anyOf(
containsString("Disabled option: '--tracing-service-name'. Available only when Tracing is enabled"),
containsString("Disabled option: '--telemetry-service-name'. Available only when any of available OpenTelemetry components (Traces) is turned on")
));
assertThat(nonRunningPicocli.config.getConfigValue("quarkus.otel.enabled").getValue(), is("false"));
assertThat(nonRunningPicocli.config.getConfigValue("quarkus.otel.traces.enabled").getValue(), is("false"));
assertThat(nonRunningPicocli.config.getConfigValue("quarkus.otel.service.name").getValue(), is(nullValue()));
onAfter();
// disabled tracing
nonRunningPicocli = pseudoLaunch("start-dev", "--telemetry-service-name=service123");
assertEquals(CommandLine.ExitCode.USAGE, nonRunningPicocli.exitCode);
assertThat(nonRunningPicocli.getErrString(), containsString("Disabled option: '--telemetry-service-name'. Available only when any of available OpenTelemetry components (Traces) is turned on"));
assertThat(nonRunningPicocli.config.getConfigValue("quarkus.otel.enabled").getValue(), is("false"));
assertThat(nonRunningPicocli.config.getConfigValue("quarkus.otel.traces.enabled").getValue(), is("false"));
assertThat(nonRunningPicocli.config.getConfigValue("quarkus.otel.service.name").getValue(), is(nullValue()));
onAfter();
// combined resource attributes
nonRunningPicocli = pseudoLaunch("start-dev", "--tracing-enabled=true", "--telemetry-resource-attributes=otel1=val1", "--tracing-resource-attributes=tracing1=val2");
assertEquals(CommandLine.ExitCode.OK, nonRunningPicocli.exitCode);
assertThat(nonRunningPicocli.config.getConfigValue("quarkus.otel.enabled").getValue(), is("true"));
assertThat(nonRunningPicocli.config.getConfigValue("quarkus.otel.traces.enabled").getValue(), is("true"));
assertThat(nonRunningPicocli.config.getConfigValue("quarkus.otel.resource.attributes").getValue(), is("otel1=val1")); // Telemetry option takes precedence
assertThat(nonRunningPicocli.getOutString(), containsString("The following used options or option values are DEPRECATED"));
assertThat(nonRunningPicocli.getOutString(), containsString("tracing-resource-attributes: Resource attributes are not directly related to Tracing and you should use the Telemetry option which takes precedence. Use telemetry-resource-attributes."));
onAfter();
// combined resource attributes
nonRunningPicocli = pseudoLaunch("start-dev", "--tracing-enabled=true", "--telemetry-resource-attributes=otel1=val1", "--tracing-resource-attributes=tracing1=val2");
assertEquals(CommandLine.ExitCode.OK, nonRunningPicocli.exitCode);
assertThat(nonRunningPicocli.config.getConfigValue("quarkus.otel.enabled").getValue(), is("true"));
assertThat(nonRunningPicocli.config.getConfigValue("quarkus.otel.traces.enabled").getValue(), is("true"));
assertThat(nonRunningPicocli.config.getConfigValue("quarkus.otel.resource.attributes").getValue(), is("otel1=val1")); // Telemetry option takes precedence
assertThat(nonRunningPicocli.getOutString(), containsString("The following used options or option values are DEPRECATED"));
assertThat(nonRunningPicocli.getOutString(), containsString("tracing-resource-attributes: Resource attributes are not directly related to Tracing and you should use the Telemetry option which takes precedence. Use telemetry-resource-attributes."));
onAfter();
// wrong protocol
nonRunningPicocli = pseudoLaunch("start-dev", "--tracing-enabled=true", "--telemetry-protocol=wrong");
assertEquals(CommandLine.ExitCode.USAGE, nonRunningPicocli.exitCode);
assertThat(nonRunningPicocli.getErrString(), containsString("Invalid value for option '--telemetry-protocol': wrong. Expected values are: grpc, http/protobuf"));
onAfter();
// combined protocol
nonRunningPicocli = pseudoLaunch("start-dev", "--tracing-enabled=true", "--telemetry-protocol=grpc", "--tracing-protocol=http/protobuf");
assertEquals(CommandLine.ExitCode.OK, nonRunningPicocli.exitCode);
assertThat(nonRunningPicocli.config.getConfigValue("quarkus.otel.enabled").getValue(), is("true"));
assertThat(nonRunningPicocli.config.getConfigValue("quarkus.otel.exporter.otlp.protocol").getValue(), is("grpc"));
assertThat(nonRunningPicocli.config.getConfigValue("quarkus.otel.exporter.otlp.traces.protocol").getValue(), is("http/protobuf")); // Tracing options take precedence
onAfter();
// telemetry protocol
nonRunningPicocli = pseudoLaunch("start-dev", "--tracing-enabled=true", "--telemetry-protocol=http/protobuf");
assertEquals(CommandLine.ExitCode.OK, nonRunningPicocli.exitCode);
assertThat(nonRunningPicocli.config.getConfigValue("quarkus.otel.enabled").getValue(), is("true"));
assertThat(nonRunningPicocli.config.getConfigValue("quarkus.otel.exporter.otlp.protocol").getValue(), is("http/protobuf"));
assertThat(nonRunningPicocli.config.getConfigValue("quarkus.otel.exporter.otlp.traces.protocol").getValue(), is("http/protobuf"));
onAfter();
// parent + child protocol
nonRunningPicocli = pseudoLaunch("start-dev", "--tracing-enabled=true", "--tracing-protocol=http/protobuf", "--telemetry-protocol=grpc");
assertEquals(CommandLine.ExitCode.OK, nonRunningPicocli.exitCode);
assertThat(nonRunningPicocli.config.getConfigValue("quarkus.otel.enabled").getValue(), is("true"));
assertThat(nonRunningPicocli.config.getConfigValue("quarkus.otel.exporter.otlp.protocol").getValue(), is("grpc"));
assertThat(nonRunningPicocli.config.getConfigValue("quarkus.otel.exporter.otlp.traces.protocol").getValue(), is("http/protobuf"));
onAfter();
// wrong endpoint - telemetry option
nonRunningPicocli = pseudoLaunch("start-dev", "--tracing-enabled=true", "--telemetry-endpoint=not-url");
assertEquals(CommandLine.ExitCode.USAGE, nonRunningPicocli.exitCode);
assertThat(nonRunningPicocli.getErrString(), containsString("Specified Endpoint URL is invalid"));
onAfter();
// wrong endpoint - tracing option
nonRunningPicocli = pseudoLaunch("start-dev", "--tracing-enabled=true", "--tracing-endpoint=not-url");
assertEquals(CommandLine.ExitCode.USAGE, nonRunningPicocli.exitCode);
assertThat(nonRunningPicocli.getErrString(), containsString("Specified Endpoint URL is invalid"));
onAfter();
// combined endpoint
nonRunningPicocli = pseudoLaunch("start-dev", "--tracing-enabled=true", "--telemetry-endpoint=http://keycloak.org", "--tracing-endpoint=http://keycloak2.org");
assertEquals(CommandLine.ExitCode.OK, nonRunningPicocli.exitCode);
assertThat(nonRunningPicocli.config.getConfigValue("quarkus.otel.exporter.otlp.endpoint").getValue(), is("http://keycloak.org")); // Tracing option takes precedence
assertThat(nonRunningPicocli.config.getConfigValue("quarkus.otel.exporter.otlp.traces.endpoint").getValue(), is("http://keycloak2.org")); // Tracing option takes precedence
onAfter();
// telemetry endpoint
nonRunningPicocli = pseudoLaunch("start-dev", "--tracing-enabled=true", "--telemetry-endpoint=http://keycloak.org");
assertEquals(CommandLine.ExitCode.OK, nonRunningPicocli.exitCode);
assertThat(nonRunningPicocli.config.getConfigValue("quarkus.otel.exporter.otlp.traces.endpoint").getValue(), is("http://keycloak.org"));
onAfter();
// parent + child endpoint
nonRunningPicocli = pseudoLaunch("start-dev", "--tracing-enabled=true", "--telemetry-endpoint=http://keycloak-keycloak-keycloak.org:3455", "--tracing-endpoint=http://keycloak.org");
assertEquals(CommandLine.ExitCode.OK, nonRunningPicocli.exitCode);
assertThat(nonRunningPicocli.config.getConfigValue("quarkus.otel.exporter.otlp.endpoint").getValue(), is("http://keycloak-keycloak-keycloak.org:3455"));
assertThat(nonRunningPicocli.config.getConfigValue("quarkus.otel.exporter.otlp.traces.endpoint").getValue(), is("http://keycloak.org"));
onAfter();
// parent endpoint
nonRunningPicocli = pseudoLaunch("start-dev", "--tracing-enabled=true", "--telemetry-endpoint=http://keycloak-keycloak-keycloak.org:3455");
assertEquals(CommandLine.ExitCode.OK, nonRunningPicocli.exitCode);
assertThat(nonRunningPicocli.config.getConfigValue("quarkus.otel.exporter.otlp.endpoint").getValue(), is("http://keycloak-keycloak-keycloak.org:3455")); // value inherited
assertThat(nonRunningPicocli.config.getConfigValue("quarkus.otel.exporter.otlp.traces.endpoint").getValue(), is("http://keycloak-keycloak-keycloak.org:3455")); // value inherited
}
}

View File

@@ -0,0 +1,71 @@
package org.keycloak.quarkus.runtime.configuration;
import java.util.Map;
import org.junit.Test;
public class TelemetryConfigurationTest extends AbstractConfigurationTest {
@Test
public void rootDefaults() {
initConfig();
assertConfig(Map.of(
"telemetry-enabled", "false",
"telemetry-endpoint", "http://localhost:4317",
"telemetry-service-name", "keycloak",
"telemetry-protocol", "grpc"
));
assertConfigNull("telemetry-resource-attributes");
assertExternalConfig(Map.of(
"quarkus.otel.enabled", "false",
"quarkus.otel.exporter.otlp.endpoint", "http://localhost:4317",
"quarkus.otel.service.name", "keycloak",
"quarkus.otel.exporter.otlp.traces.protocol", "grpc"
));
assertExternalConfigNull("quarkus.otel.resource.attributes");
}
@Test
public void tracesDeprecated() {
// propagate to Quarkus props
ConfigArgsConfigSource.setCliArgs("--tracing-service-name=something", "--tracing-resource-attributes=val1=hello");
initConfig();
assertConfig(Map.of(
"tracing-service-name", "something",
"tracing-resource-attributes", "val1=hello"
));
assertExternalConfig(Map.of(
"quarkus.otel.service.name", "something",
"quarkus.otel.resource.attributes", "val1=hello"
));
onAfter();
// use recommended OTel properties
ConfigArgsConfigSource.setCliArgs("--telemetry-service-name=something2", "--telemetry-resource-attributes=val2=hello2");
initConfig();
assertConfig(Map.of(
"telemetry-service-name", "something2",
"telemetry-resource-attributes", "val2=hello2"
));
assertExternalConfig(Map.of(
"quarkus.otel.service.name", "something2",
"quarkus.otel.resource.attributes", "val2=hello2"
));
onAfter();
// check priority of options
ConfigArgsConfigSource.setCliArgs("--telemetry-service-name=something3", "--telemetry-resource-attributes=val3=hello3",
"--tracing-service-name=something", "--tracing-resource-attributes=val1=hello");
initConfig();
assertConfig(Map.of(
"telemetry-service-name", "something3",
"telemetry-resource-attributes", "val3=hello3",
"tracing-service-name", "something",
"tracing-resource-attributes", "val1=hello"
));
assertExternalConfig(Map.of(
"quarkus.otel.service.name", "something3",
"quarkus.otel.resource.attributes", "val3=hello3"
));
}
}

View File

@@ -33,18 +33,18 @@ import org.junit.jupiter.api.TestMethodOrder;
@RawDistOnly(reason = "Containers are immutable")
public class TracingDistTest {
private void assertTracingEnabled(CLIResult result) {
static void assertTracingEnabled(CLIResult result) {
result.assertMessage("opentelemetry");
result.assertMessage("service.name=\"keycloak\"");
}
private void assertTracingDisabled(CLIResult result) {
static void assertTracingDisabled(CLIResult result) {
result.assertMessage("opentelemetry");
result.assertNoMessage("service.name=\"keycloak\"");
assertSamplingDisabled(result);
}
private void assertSamplingDisabled(CLIResult result) {
private static void assertSamplingDisabled(CLIResult result) {
result.assertNoMessage("Failed to export spans.");
result.assertNoMessage("Connection refused: localhost/127.0.0.1:4317");
}
@@ -130,7 +130,7 @@ public class TracingDistTest {
void emptyEndpoint(LaunchResult result) {
CLIResult cliResult = (CLIResult) result;
cliResult.assertError("URL specified in 'tracing-endpoint' option must not be empty.");
cliResult.assertError("Specified Endpoint URL must not be empty.");
}
@Test
@@ -138,7 +138,7 @@ public class TracingDistTest {
void invalidUrl(LaunchResult result) {
CLIResult cliResult = (CLIResult) result;
cliResult.assertError("URL specified in 'tracing-endpoint' option is invalid.");
cliResult.assertError("Specified Endpoint URL is invalid.");
}
@Test
@@ -188,6 +188,7 @@ public class TracingDistTest {
void differentServiceName(LaunchResult result) {
CLIResult cliResult = (CLIResult) result;
cliResult.assertMessage("- tracing-service-name: Service name is not directly related to Tracing and you should use the Telemetry option which takes precedence. Use telemetry-service-name.");
cliResult.assertMessage("opentelemetry");
cliResult.assertMessage("service.name=\"my-service\"");
@@ -211,7 +212,7 @@ public class TracingDistTest {
CLIResult cliResult = (CLIResult) result;
assertTracingEnabled(cliResult);
cliResult.assertMessage("- tracing-resource-attributes: Resource attributes are not directly related to Tracing and you should use the Telemetry option which takes precedence. Use telemetry-resource-attributes.");
cliResult.assertMessage("some.key1=\"some.val1\"");
cliResult.assertMessage("some.key2=\"some.val2\"");

View File

@@ -309,6 +309,26 @@ Logging:
Set the Syslog type used to format the sent message. Possible values are:
rfc5424, rfc3164. Default: rfc5424. Available only when Syslog is activated.
Telemetry (OpenTelemetry):
--telemetry-endpoint <url>
OpenTelemetry endpoint to connect to. Default: http://localhost:4317.
Available only when any of available OpenTelemetry components (Traces) is
turned on.
--telemetry-protocol <protocol>
OpenTelemetry protocol used for the communication between server and
OpenTelemetry collector. Possible values are: grpc, http/protobuf. Default:
grpc. Available only when any of available OpenTelemetry components (Traces)
is turned on.
--telemetry-resource-attributes <attributes>
OpenTelemetry resource attributes characterize the telemetry producer. Values
in format 'key1=val1,key2=val2'. Available only when any of available
OpenTelemetry components (Traces) is turned on.
--telemetry-service-name <name>
OpenTelemetry service name. Takes precedence over 'service.name' defined in
the 'telemetry-resource-attributes' property. Default: keycloak. Available
only when any of available OpenTelemetry components (Traces) is turned on.
Tracing:
--tracing-compression <method>
@@ -319,8 +339,9 @@ Tracing:
Enables the OpenTelemetry tracing. Default: false. Available only when
'opentelemetry' feature is enabled.
--tracing-endpoint <url>
OpenTelemetry endpoint to connect to. Default: http://localhost:4317.
Available only when Tracing is enabled.
OpenTelemetry endpoint to connect to for traces. If not given, the value is
inherited from the 'telemetry-endpoint' option. Default: http://localhost:
4317. Available only when Tracing is enabled.
--tracing-header-<header> <value>
OpenTelemetry header that will be part of the exporter request (mainly useful
for providing Authorization header). Check the documentation on how to set
@@ -333,13 +354,18 @@ Tracing:
Enables the OpenTelemetry JDBC tracing. Default: true. Available only when
Tracing is enabled.
--tracing-protocol <protocol>
OpenTelemetry protocol used for the telemetry data. Possible values are: grpc,
OpenTelemetry protocol used for the telemetry data. If not given, the value is
inherited from the 'telemetry-protocol' option. Possible values are: grpc,
http/protobuf. Default: grpc. Available only when Tracing is enabled.
--tracing-resource-attributes <attributes>
OpenTelemetry resource attributes present in the exported trace to
DEPRECATED. 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 Tracing
is enabled.
If not given, the value is inherited from the
'telemetry-resource-attributes' option. For more information, check the
Tracing guide. Available only when Tracing is enabled. Resource attributes
are not directly related to Tracing and you should use the Telemetry option
which takes precedence. Use the following option instead:
telemetry-resource-attributes.
--tracing-sampler-ratio <ratio>
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
@@ -350,9 +376,12 @@ Tracing:
parentbased_traceidratio. Default: traceidratio. Available only when Tracing
is enabled.
--tracing-service-name <name>
OpenTelemetry service name. Takes precedence over 'service.name' defined in
the 'tracing-resource-attributes' property. Default: keycloak. Available
only when Tracing is enabled.
DEPRECATED. OpenTelemetry service name. Takes precedence over 'service.name'
defined in the 'tracing-resource-attributes' property. If not given, the
value is inherited from the 'telemetry-service-name' option. Default:
keycloak. Available only when Tracing is enabled. Service name is not
directly related to Tracing and you should use the Telemetry option which
takes precedence. Use the following option instead: telemetry-service-name.
Events:

View File

@@ -309,6 +309,26 @@ Logging:
Set the Syslog type used to format the sent message. Possible values are:
rfc5424, rfc3164. Default: rfc5424. Available only when Syslog is activated.
Telemetry (OpenTelemetry):
--telemetry-endpoint <url>
OpenTelemetry endpoint to connect to. Default: http://localhost:4317.
Available only when any of available OpenTelemetry components (Traces) is
turned on.
--telemetry-protocol <protocol>
OpenTelemetry protocol used for the communication between server and
OpenTelemetry collector. Possible values are: grpc, http/protobuf. Default:
grpc. Available only when any of available OpenTelemetry components (Traces)
is turned on.
--telemetry-resource-attributes <attributes>
OpenTelemetry resource attributes characterize the telemetry producer. Values
in format 'key1=val1,key2=val2'. Available only when any of available
OpenTelemetry components (Traces) is turned on.
--telemetry-service-name <name>
OpenTelemetry service name. Takes precedence over 'service.name' defined in
the 'telemetry-resource-attributes' property. Default: keycloak. Available
only when any of available OpenTelemetry components (Traces) is turned on.
Tracing:
--tracing-compression <method>
@@ -319,8 +339,9 @@ Tracing:
Enables the OpenTelemetry tracing. Default: false. Available only when
'opentelemetry' feature is enabled.
--tracing-endpoint <url>
OpenTelemetry endpoint to connect to. Default: http://localhost:4317.
Available only when Tracing is enabled.
OpenTelemetry endpoint to connect to for traces. If not given, the value is
inherited from the 'telemetry-endpoint' option. Default: http://localhost:
4317. Available only when Tracing is enabled.
--tracing-header-<header> <value>
OpenTelemetry header that will be part of the exporter request (mainly useful
for providing Authorization header). Check the documentation on how to set
@@ -333,13 +354,18 @@ Tracing:
Enables the OpenTelemetry JDBC tracing. Default: true. Available only when
Tracing is enabled.
--tracing-protocol <protocol>
OpenTelemetry protocol used for the telemetry data. Possible values are: grpc,
OpenTelemetry protocol used for the telemetry data. If not given, the value is
inherited from the 'telemetry-protocol' option. Possible values are: grpc,
http/protobuf. Default: grpc. Available only when Tracing is enabled.
--tracing-resource-attributes <attributes>
OpenTelemetry resource attributes present in the exported trace to
DEPRECATED. 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 Tracing
is enabled.
If not given, the value is inherited from the
'telemetry-resource-attributes' option. For more information, check the
Tracing guide. Available only when Tracing is enabled. Resource attributes
are not directly related to Tracing and you should use the Telemetry option
which takes precedence. Use the following option instead:
telemetry-resource-attributes.
--tracing-sampler-ratio <ratio>
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
@@ -350,9 +376,12 @@ Tracing:
parentbased_traceidratio. Default: traceidratio. Available only when Tracing
is enabled.
--tracing-service-name <name>
OpenTelemetry service name. Takes precedence over 'service.name' defined in
the 'tracing-resource-attributes' property. Default: keycloak. Available
only when Tracing is enabled.
DEPRECATED. OpenTelemetry service name. Takes precedence over 'service.name'
defined in the 'tracing-resource-attributes' property. If not given, the
value is inherited from the 'telemetry-service-name' option. Default:
keycloak. Available only when Tracing is enabled. Service name is not
directly related to Tracing and you should use the Telemetry option which
takes precedence. Use the following option instead: telemetry-service-name.
Events:

View File

@@ -636,6 +636,26 @@ Logging:
Set the Syslog type used to format the sent message. Possible values are:
rfc5424, rfc3164. Default: rfc5424. Available only when Syslog is activated.
Telemetry (OpenTelemetry):
--telemetry-endpoint <url>
OpenTelemetry endpoint to connect to. Default: http://localhost:4317.
Available only when any of available OpenTelemetry components (Traces) is
turned on.
--telemetry-protocol <protocol>
OpenTelemetry protocol used for the communication between server and
OpenTelemetry collector. Possible values are: grpc, http/protobuf. Default:
grpc. Available only when any of available OpenTelemetry components (Traces)
is turned on.
--telemetry-resource-attributes <attributes>
OpenTelemetry resource attributes characterize the telemetry producer. Values
in format 'key1=val1,key2=val2'. Available only when any of available
OpenTelemetry components (Traces) is turned on.
--telemetry-service-name <name>
OpenTelemetry service name. Takes precedence over 'service.name' defined in
the 'telemetry-resource-attributes' property. Default: keycloak. Available
only when any of available OpenTelemetry components (Traces) is turned on.
Tracing:
--tracing-compression <method>
@@ -646,8 +666,9 @@ Tracing:
Enables the OpenTelemetry tracing. Default: false. Available only when
'opentelemetry' feature is enabled.
--tracing-endpoint <url>
OpenTelemetry endpoint to connect to. Default: http://localhost:4317.
Available only when Tracing is enabled.
OpenTelemetry endpoint to connect to for traces. If not given, the value is
inherited from the 'telemetry-endpoint' option. Default: http://localhost:
4317. Available only when Tracing is enabled.
--tracing-header-<header> <value>
OpenTelemetry header that will be part of the exporter request (mainly useful
for providing Authorization header). Check the documentation on how to set
@@ -660,13 +681,18 @@ Tracing:
Enables the OpenTelemetry JDBC tracing. Default: true. Available only when
Tracing is enabled.
--tracing-protocol <protocol>
OpenTelemetry protocol used for the telemetry data. Possible values are: grpc,
OpenTelemetry protocol used for the telemetry data. If not given, the value is
inherited from the 'telemetry-protocol' option. Possible values are: grpc,
http/protobuf. Default: grpc. Available only when Tracing is enabled.
--tracing-resource-attributes <attributes>
OpenTelemetry resource attributes present in the exported trace to
DEPRECATED. 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 Tracing
is enabled.
If not given, the value is inherited from the
'telemetry-resource-attributes' option. For more information, check the
Tracing guide. Available only when Tracing is enabled. Resource attributes
are not directly related to Tracing and you should use the Telemetry option
which takes precedence. Use the following option instead:
telemetry-resource-attributes.
--tracing-sampler-ratio <ratio>
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
@@ -677,9 +703,12 @@ Tracing:
parentbased_traceidratio. Default: traceidratio. Available only when Tracing
is enabled.
--tracing-service-name <name>
OpenTelemetry service name. Takes precedence over 'service.name' defined in
the 'tracing-resource-attributes' property. Default: keycloak. Available
only when Tracing is enabled.
DEPRECATED. OpenTelemetry service name. Takes precedence over 'service.name'
defined in the 'tracing-resource-attributes' property. If not given, the
value is inherited from the 'telemetry-service-name' option. Default:
keycloak. Available only when Tracing is enabled. Service name is not
directly related to Tracing and you should use the Telemetry option which
takes precedence. Use the following option instead: telemetry-service-name.
Events:

View File

@@ -637,6 +637,26 @@ Logging:
Set the Syslog type used to format the sent message. Possible values are:
rfc5424, rfc3164. Default: rfc5424. Available only when Syslog is activated.
Telemetry (OpenTelemetry):
--telemetry-endpoint <url>
OpenTelemetry endpoint to connect to. Default: http://localhost:4317.
Available only when any of available OpenTelemetry components (Traces) is
turned on.
--telemetry-protocol <protocol>
OpenTelemetry protocol used for the communication between server and
OpenTelemetry collector. Possible values are: grpc, http/protobuf. Default:
grpc. Available only when any of available OpenTelemetry components (Traces)
is turned on.
--telemetry-resource-attributes <attributes>
OpenTelemetry resource attributes characterize the telemetry producer. Values
in format 'key1=val1,key2=val2'. Available only when any of available
OpenTelemetry components (Traces) is turned on.
--telemetry-service-name <name>
OpenTelemetry service name. Takes precedence over 'service.name' defined in
the 'telemetry-resource-attributes' property. Default: keycloak. Available
only when any of available OpenTelemetry components (Traces) is turned on.
Tracing:
--tracing-compression <method>
@@ -647,8 +667,9 @@ Tracing:
Enables the OpenTelemetry tracing. Default: false. Available only when
'opentelemetry' feature is enabled.
--tracing-endpoint <url>
OpenTelemetry endpoint to connect to. Default: http://localhost:4317.
Available only when Tracing is enabled.
OpenTelemetry endpoint to connect to for traces. If not given, the value is
inherited from the 'telemetry-endpoint' option. Default: http://localhost:
4317. Available only when Tracing is enabled.
--tracing-header-<header> <value>
OpenTelemetry header that will be part of the exporter request (mainly useful
for providing Authorization header). Check the documentation on how to set
@@ -661,13 +682,18 @@ Tracing:
Enables the OpenTelemetry JDBC tracing. Default: true. Available only when
Tracing is enabled.
--tracing-protocol <protocol>
OpenTelemetry protocol used for the telemetry data. Possible values are: grpc,
OpenTelemetry protocol used for the telemetry data. If not given, the value is
inherited from the 'telemetry-protocol' option. Possible values are: grpc,
http/protobuf. Default: grpc. Available only when Tracing is enabled.
--tracing-resource-attributes <attributes>
OpenTelemetry resource attributes present in the exported trace to
DEPRECATED. 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 Tracing
is enabled.
If not given, the value is inherited from the
'telemetry-resource-attributes' option. For more information, check the
Tracing guide. Available only when Tracing is enabled. Resource attributes
are not directly related to Tracing and you should use the Telemetry option
which takes precedence. Use the following option instead:
telemetry-resource-attributes.
--tracing-sampler-ratio <ratio>
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
@@ -678,9 +704,12 @@ Tracing:
parentbased_traceidratio. Default: traceidratio. Available only when Tracing
is enabled.
--tracing-service-name <name>
OpenTelemetry service name. Takes precedence over 'service.name' defined in
the 'tracing-resource-attributes' property. Default: keycloak. Available
only when Tracing is enabled.
DEPRECATED. OpenTelemetry service name. Takes precedence over 'service.name'
defined in the 'tracing-resource-attributes' property. If not given, the
value is inherited from the 'telemetry-service-name' option. Default:
keycloak. Available only when Tracing is enabled. Service name is not
directly related to Tracing and you should use the Telemetry option which
takes precedence. Use the following option instead: telemetry-service-name.
Events:

View File

@@ -563,6 +563,26 @@ Logging:
Set the Syslog type used to format the sent message. Possible values are:
rfc5424, rfc3164. Default: rfc5424. Available only when Syslog is activated.
Telemetry (OpenTelemetry):
--telemetry-endpoint <url>
OpenTelemetry endpoint to connect to. Default: http://localhost:4317.
Available only when any of available OpenTelemetry components (Traces) is
turned on.
--telemetry-protocol <protocol>
OpenTelemetry protocol used for the communication between server and
OpenTelemetry collector. Possible values are: grpc, http/protobuf. Default:
grpc. Available only when any of available OpenTelemetry components (Traces)
is turned on.
--telemetry-resource-attributes <attributes>
OpenTelemetry resource attributes characterize the telemetry producer. Values
in format 'key1=val1,key2=val2'. Available only when any of available
OpenTelemetry components (Traces) is turned on.
--telemetry-service-name <name>
OpenTelemetry service name. Takes precedence over 'service.name' defined in
the 'telemetry-resource-attributes' property. Default: keycloak. Available
only when any of available OpenTelemetry components (Traces) is turned on.
Tracing:
--tracing-compression <method>
@@ -570,8 +590,9 @@ Tracing:
compression is disabled. Possible values are: gzip, none. Default: none.
Available only when Tracing is enabled.
--tracing-endpoint <url>
OpenTelemetry endpoint to connect to. Default: http://localhost:4317.
Available only when Tracing is enabled.
OpenTelemetry endpoint to connect to for traces. If not given, the value is
inherited from the 'telemetry-endpoint' option. Default: http://localhost:
4317. Available only when Tracing is enabled.
--tracing-header-<header> <value>
OpenTelemetry header that will be part of the exporter request (mainly useful
for providing Authorization header). Check the documentation on how to set
@@ -581,21 +602,29 @@ Tracing:
Enables the OpenTelemetry tracing for embedded Infinispan. Default: true.
Available only when tracing and embedded Infinispan is enabled.
--tracing-protocol <protocol>
OpenTelemetry protocol used for the telemetry data. Possible values are: grpc,
OpenTelemetry protocol used for the telemetry data. If not given, the value is
inherited from the 'telemetry-protocol' option. Possible values are: grpc,
http/protobuf. Default: grpc. Available only when Tracing is enabled.
--tracing-resource-attributes <attributes>
OpenTelemetry resource attributes present in the exported trace to
DEPRECATED. 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 Tracing
is enabled.
If not given, the value is inherited from the
'telemetry-resource-attributes' option. For more information, check the
Tracing guide. Available only when Tracing is enabled. Resource attributes
are not directly related to Tracing and you should use the Telemetry option
which takes precedence. Use the following option instead:
telemetry-resource-attributes.
--tracing-sampler-ratio <ratio>
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 <name>
OpenTelemetry service name. Takes precedence over 'service.name' defined in
the 'tracing-resource-attributes' property. Default: keycloak. Available
only when Tracing is enabled.
DEPRECATED. OpenTelemetry service name. Takes precedence over 'service.name'
defined in the 'tracing-resource-attributes' property. If not given, the
value is inherited from the 'telemetry-service-name' option. Default:
keycloak. Available only when Tracing is enabled. Service name is not
directly related to Tracing and you should use the Telemetry option which
takes precedence. Use the following option instead: telemetry-service-name.
Events:

View File

@@ -636,6 +636,26 @@ Logging:
Set the Syslog type used to format the sent message. Possible values are:
rfc5424, rfc3164. Default: rfc5424. Available only when Syslog is activated.
Telemetry (OpenTelemetry):
--telemetry-endpoint <url>
OpenTelemetry endpoint to connect to. Default: http://localhost:4317.
Available only when any of available OpenTelemetry components (Traces) is
turned on.
--telemetry-protocol <protocol>
OpenTelemetry protocol used for the communication between server and
OpenTelemetry collector. Possible values are: grpc, http/protobuf. Default:
grpc. Available only when any of available OpenTelemetry components (Traces)
is turned on.
--telemetry-resource-attributes <attributes>
OpenTelemetry resource attributes characterize the telemetry producer. Values
in format 'key1=val1,key2=val2'. Available only when any of available
OpenTelemetry components (Traces) is turned on.
--telemetry-service-name <name>
OpenTelemetry service name. Takes precedence over 'service.name' defined in
the 'telemetry-resource-attributes' property. Default: keycloak. Available
only when any of available OpenTelemetry components (Traces) is turned on.
Tracing:
--tracing-compression <method>
@@ -646,8 +666,9 @@ Tracing:
Enables the OpenTelemetry tracing. Default: false. Available only when
'opentelemetry' feature is enabled.
--tracing-endpoint <url>
OpenTelemetry endpoint to connect to. Default: http://localhost:4317.
Available only when Tracing is enabled.
OpenTelemetry endpoint to connect to for traces. If not given, the value is
inherited from the 'telemetry-endpoint' option. Default: http://localhost:
4317. Available only when Tracing is enabled.
--tracing-header-<header> <value>
OpenTelemetry header that will be part of the exporter request (mainly useful
for providing Authorization header). Check the documentation on how to set
@@ -660,13 +681,18 @@ Tracing:
Enables the OpenTelemetry JDBC tracing. Default: true. Available only when
Tracing is enabled.
--tracing-protocol <protocol>
OpenTelemetry protocol used for the telemetry data. Possible values are: grpc,
OpenTelemetry protocol used for the telemetry data. If not given, the value is
inherited from the 'telemetry-protocol' option. Possible values are: grpc,
http/protobuf. Default: grpc. Available only when Tracing is enabled.
--tracing-resource-attributes <attributes>
OpenTelemetry resource attributes present in the exported trace to
DEPRECATED. 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 Tracing
is enabled.
If not given, the value is inherited from the
'telemetry-resource-attributes' option. For more information, check the
Tracing guide. Available only when Tracing is enabled. Resource attributes
are not directly related to Tracing and you should use the Telemetry option
which takes precedence. Use the following option instead:
telemetry-resource-attributes.
--tracing-sampler-ratio <ratio>
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
@@ -677,9 +703,12 @@ Tracing:
parentbased_traceidratio. Default: traceidratio. Available only when Tracing
is enabled.
--tracing-service-name <name>
OpenTelemetry service name. Takes precedence over 'service.name' defined in
the 'tracing-resource-attributes' property. Default: keycloak. Available
only when Tracing is enabled.
DEPRECATED. OpenTelemetry service name. Takes precedence over 'service.name'
defined in the 'tracing-resource-attributes' property. If not given, the
value is inherited from the 'telemetry-service-name' option. Default:
keycloak. Available only when Tracing is enabled. Service name is not
directly related to Tracing and you should use the Telemetry option which
takes precedence. Use the following option instead: telemetry-service-name.
Events:

View File

@@ -634,6 +634,26 @@ Logging:
Set the Syslog type used to format the sent message. Possible values are:
rfc5424, rfc3164. Default: rfc5424. Available only when Syslog is activated.
Telemetry (OpenTelemetry):
--telemetry-endpoint <url>
OpenTelemetry endpoint to connect to. Default: http://localhost:4317.
Available only when any of available OpenTelemetry components (Traces) is
turned on.
--telemetry-protocol <protocol>
OpenTelemetry protocol used for the communication between server and
OpenTelemetry collector. Possible values are: grpc, http/protobuf. Default:
grpc. Available only when any of available OpenTelemetry components (Traces)
is turned on.
--telemetry-resource-attributes <attributes>
OpenTelemetry resource attributes characterize the telemetry producer. Values
in format 'key1=val1,key2=val2'. Available only when any of available
OpenTelemetry components (Traces) is turned on.
--telemetry-service-name <name>
OpenTelemetry service name. Takes precedence over 'service.name' defined in
the 'telemetry-resource-attributes' property. Default: keycloak. Available
only when any of available OpenTelemetry components (Traces) is turned on.
Tracing:
--tracing-compression <method>
@@ -644,8 +664,9 @@ Tracing:
Enables the OpenTelemetry tracing. Default: false. Available only when
'opentelemetry' feature is enabled.
--tracing-endpoint <url>
OpenTelemetry endpoint to connect to. Default: http://localhost:4317.
Available only when Tracing is enabled.
OpenTelemetry endpoint to connect to for traces. If not given, the value is
inherited from the 'telemetry-endpoint' option. Default: http://localhost:
4317. Available only when Tracing is enabled.
--tracing-header-<header> <value>
OpenTelemetry header that will be part of the exporter request (mainly useful
for providing Authorization header). Check the documentation on how to set
@@ -658,13 +679,18 @@ Tracing:
Enables the OpenTelemetry JDBC tracing. Default: true. Available only when
Tracing is enabled.
--tracing-protocol <protocol>
OpenTelemetry protocol used for the telemetry data. Possible values are: grpc,
OpenTelemetry protocol used for the telemetry data. If not given, the value is
inherited from the 'telemetry-protocol' option. Possible values are: grpc,
http/protobuf. Default: grpc. Available only when Tracing is enabled.
--tracing-resource-attributes <attributes>
OpenTelemetry resource attributes present in the exported trace to
DEPRECATED. 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 Tracing
is enabled.
If not given, the value is inherited from the
'telemetry-resource-attributes' option. For more information, check the
Tracing guide. Available only when Tracing is enabled. Resource attributes
are not directly related to Tracing and you should use the Telemetry option
which takes precedence. Use the following option instead:
telemetry-resource-attributes.
--tracing-sampler-ratio <ratio>
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
@@ -675,9 +701,12 @@ Tracing:
parentbased_traceidratio. Default: traceidratio. Available only when Tracing
is enabled.
--tracing-service-name <name>
OpenTelemetry service name. Takes precedence over 'service.name' defined in
the 'tracing-resource-attributes' property. Default: keycloak. Available
only when Tracing is enabled.
DEPRECATED. OpenTelemetry service name. Takes precedence over 'service.name'
defined in the 'tracing-resource-attributes' property. If not given, the
value is inherited from the 'telemetry-service-name' option. Default:
keycloak. Available only when Tracing is enabled. Service name is not
directly related to Tracing and you should use the Telemetry option which
takes precedence. Use the following option instead: telemetry-service-name.
Events: