Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Clean up tracing option from dev services for 15.0 #41098

Merged
merged 2 commits into from
Jun 11, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
63 changes: 57 additions & 6 deletions docs/src/main/asciidoc/infinispan-dev-services.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -116,13 +116,64 @@
quarkus.infinispan-client.conn-2.devservices.enabled=true
----

== Tracing with OpenTelemetry

Check warning on line 119 in docs/src/main/asciidoc/infinispan-dev-services.adoc

View workflow job for this annotation

GitHub Actions / Linting with Vale

[vale] reported by reviewdog 🐶 [Quarkus.Headings] Use sentence-style capitalization in 'Tracing with OpenTelemetry'. Raw Output: {"message": "[Quarkus.Headings] Use sentence-style capitalization in 'Tracing with OpenTelemetry'.", "location": {"path": "docs/src/main/asciidoc/infinispan-dev-services.adoc", "range": {"start": {"line": 119, "column": 4}}}, "severity": "INFO"}

Infinispan supports instrumentation of the server via OpenTelemetry. Enable tracing setting `quarkus.infinispan-client.devservices.tracing.enabled` to true.
The default otlp exporter endpoint is `http://localhost:4317`.
If you are running Jaeger in a container as explained in the xref:opentelemetry.adoc[OpenTelemetry guide], since the containers
are running in the default network, Infinispan container won't have access to localhost.
You need to get the IP running the following command and configure the `quarkus.infinispan-client.devservices.tracing.exporter.otlp.endpoint` property.
Infinispan supports server tracing using OpenTelemetry. Starting from Infinispan 15.0, you need

Check warning on line 121 in docs/src/main/asciidoc/infinispan-dev-services.adoc

View workflow job for this annotation

GitHub Actions / Linting with Vale

[vale] reported by reviewdog 🐶 [Quarkus.TermsSuggestions] Depending on the context, consider using 'by using' or 'that uses' rather than 'using'. Raw Output: {"message": "[Quarkus.TermsSuggestions] Depending on the context, consider using 'by using' or 'that uses' rather than 'using'.", "location": {"path": "docs/src/main/asciidoc/infinispan-dev-services.adoc", "range": {"start": {"line": 121, "column": 35}}}, "severity": "INFO"}
to configure tracing in the server's settings.
To enable tracing in Dev Services, you need to add extra settings using the

Check warning on line 123 in docs/src/main/asciidoc/infinispan-dev-services.adoc

View workflow job for this annotation

GitHub Actions / Linting with Vale

[vale] reported by reviewdog 🐶 [Quarkus.Fluff] Depending on the context, consider using 'Rewrite the sentence, or use 'must', instead of' rather than 'need to'. Raw Output: {"message": "[Quarkus.Fluff] Depending on the context, consider using 'Rewrite the sentence, or use 'must', instead of' rather than 'need to'.", "location": {"path": "docs/src/main/asciidoc/infinispan-dev-services.adoc", "range": {"start": {"line": 123, "column": 40}}}, "severity": "INFO"}

Check warning on line 123 in docs/src/main/asciidoc/infinispan-dev-services.adoc

View workflow job for this annotation

GitHub Actions / Linting with Vale

[vale] reported by reviewdog 🐶 [Quarkus.TermsSuggestions] Depending on the context, consider using 'by using' or 'that uses' rather than 'using'. Raw Output: {"message": "[Quarkus.TermsSuggestions] Depending on the context, consider using 'by using' or 'that uses' rather than 'using'.", "location": {"path": "docs/src/main/asciidoc/infinispan-dev-services.adoc", "range": {"start": {"line": 123, "column": 66}}}, "severity": "INFO"}
`quarkus.infinispan-client.devservices.config-files` property.

[source, yaml]
----
infinispan:
cacheContainer:
tracing:
collector-endpoint: "http://jaeger:4318" <1>
enabled: true <2>
exporter-protocol: "OTLP" <3>
service-name: "infinispan-server" <4>
security: false <5>
----
<1> Collector endpoint. Assuming a container service name 'jaeger' is running.
<2> Enables tracing.
<3> Exporter protocol. OLTP is the OpenTelemetry protocol.
<4> The service name that will be registered in the tracing collector, Jaeger in this case.
<5> Enables 'security' category tracing.

See below the equivalent in XML and JSON.

[source, xml]
----
<infinispan>
<cache-container statistics="true">
<tracing collector-endpoint="http://jaeger:4318"
enabled="true"
exporter-protocol="OTLP"
service-name="infinispan-server"
security="false" />
</cache-container>
</infinispan>
----

[source, json]
----
{
"infinispan" : {
"cache-container" : {
"statistics" : true,
"tracing" : {
"collector-endpoint" : "http://jaeger:4318",
"enabled" : true,
"exporter-protocol" : "OTLP",
"service-name" : "infinispan-server",
"security" : false
}
}
}
}
----

You need to name the Jaeger service or get the IP running the following command to configure the exporter endpoint.

Check warning on line 176 in docs/src/main/asciidoc/infinispan-dev-services.adoc

View workflow job for this annotation

GitHub Actions / Linting with Vale

[vale] reported by reviewdog 🐶 [Quarkus.Fluff] Depending on the context, consider using 'Rewrite the sentence, or use 'must', instead of' rather than 'need to'. Raw Output: {"message": "[Quarkus.Fluff] Depending on the context, consider using 'Rewrite the sentence, or use 'must', instead of' rather than 'need to'.", "location": {"path": "docs/src/main/asciidoc/infinispan-dev-services.adoc", "range": {"start": {"line": 176, "column": 5}}}, "severity": "INFO"}

[source,bash]
----
Expand Down Expand Up @@ -155,4 +206,4 @@
The default service name is `infinispan`.

Sharing is enabled by default in dev mode, but disabled in test mode.
You can disable the sharing with `quarkus.infinispan-client.devservices.shared=false`
You can disable the sharing with `quarkus.infinispan-client.devservices.shared=false`
Original file line number Diff line number Diff line change
Expand Up @@ -200,11 +200,11 @@ private RunningDevService startContainer(String clientName, DockerStatusBuildIte

if (!dockerStatusBuildItem.isDockerAvailable()) {
log.warn(
"Please configure 'quarkus.infinispan-client.hosts' or 'quarkus.infinispan-client.uri' or get a working docker instance");
"Please configure 'quarkus.infinispan-client.hosts' or 'quarkus.infinispan-client.uri' or get a working Docker instance");
return null;
}
log.infof("Starting Dev Service for connection %s", clientName);
log.infof("Apply Dev Services config %s", devServicesConfig);
log.infof("Starting Dev Services for connection %s", clientName);
log.infof("Applying Dev Services config %s", devServicesConfig);

Supplier<RunningDevService> infinispanServerSupplier = () -> {
QuarkusInfinispanContainer infinispanContainer = new QuarkusInfinispanContainer(clientName, devServicesConfig,
Expand Down Expand Up @@ -283,14 +283,24 @@ public QuarkusInfinispanContainer(String clientName, InfinispanDevServicesConfig
return " -c " + userConfigFile;
}).collect(Collectors.joining())).orElse("");

if (config.tracing.orElse(false)) {
log.warn(
"Starting with Infinispan 15.0, Infinispan support for instrumentation of the server via OpenTelemetry has evolved. Enabling tracing by setting `quarkus.infinispan-client.devservices.tracing.enabled=true` doesn't work anymore.\n"
+
"You need to use the `quarkus.infinispan-client.devservices.tracing.enabled` property and provide a JSON, XML or YAML file as follows. Check https://quarkus.io/guides/infinispan-dev-services for more information");
log.warn("infinispan:\n" +
" cacheContainer:\n" +
" tracing:\n" +
" collector-endpoint: \"http://jaeger:4318\"\n" +
" enabled: true\n" +
" exporter-protocol: \"OTLP\"\n" +
" service-name: \"infinispan-server\"\n" +
" security: false");
}

if (config.mcastPort.isPresent()) {
command = command + " -Djgroups.mcast_port=" + config.mcastPort.getAsInt();
}
if (config.tracing.isPresent()) {
command = command + " -Dinfinispan.tracing.enabled=" + config.tracing.get();
command = command + " -Dotel.exporter.otlp.endpoint=" + config.exporterOtlpEndpoint.get();
command = command + " -Dotel.service.name=infinispan-server-service -Dotel.metrics.exporter=none";
}

config.artifacts.ifPresent(a -> withArtifacts(a.toArray(new String[0])));

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -113,12 +113,14 @@ public class InfinispanDevServicesConfig {
* Runs the Infinispan Server container with tracing enabled. Traces are disabled by default
*/
@ConfigItem(name = "tracing.enabled", defaultValue = "false")
@Deprecated(forRemoval = true)
public Optional<Boolean> tracing;

/**
* Sets Infinispan Server otlp endpoint. Default value is http://localhost:4317
*/
@ConfigItem(name = "tracing.exporter.otlp.endpoint", defaultValue = "http://localhost:4317")
@Deprecated(forRemoval = true)
public Optional<String> exporterOtlpEndpoint;

/**
Expand Down