Skip to content

Commit

Permalink
edits per lauras review
Browse files Browse the repository at this point in the history
  • Loading branch information
dmuelle committed Nov 21, 2024
1 parent c9f81e8 commit 4a6e61d
Showing 1 changed file with 11 additions and 24 deletions.
35 changes: 11 additions & 24 deletions modules/ROOT/pages/microprofile-telemetry.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ To collect and export logs, metrics, and traces with OpenTelemetry in your Open
* `jvm.options` file
* `server.env` file
+
If you choose to use the `server.env` file, specify the `OTEL_SDK_DISABLED=false` environment variable instead of the `otel.sdk.disabled=false` configuration property.
If you choose to use the `server.env` file, specify the `OTEL_SDK_DISABLED=false` environment variable instead of the configuration property.

| <<#app, Application level>>
| Multiple applications in the same Liberty runtime
Expand All @@ -49,17 +49,9 @@ If you choose to use the `server.env` file, specify the `OTEL_SDK_DISABLED=false

When your Open Liberty runtime hosts only one application, you can enable OpenTelemetry at the runtime level to collect and export logs, metrics, and traces for both the runtime and the application.

* Enable the feature:mpTelemetry[display=MicroProfile Telemetry] feature version 2.0 or later in the `featureManager` element of your `server.xml` file.
+
[source,xml]
----
<featureManager>
<feature>mpTelemetry-2.0</feature>
...
</featureManager>
----
. Enable the feature:mpTelemetry[display=MicroProfile Telemetry] feature version 2.0 or later in the `featureManager` element of your `server.xml` file.

* Set `otel.sdk.disabled=false` as a runtime-level property, for example, in the xref:reference:config/server-configuration-overview.adoc#bootstrap-properties[bootstrap.properties] file:
. Set `otel.sdk.disabled=false` as a runtime-level property, for example, in the xref:reference:config/server-configuration-overview.adoc#bootstrap-properties[bootstrap.properties] file:
+
----
otel.sdk.disabled=false
Expand All @@ -72,17 +64,9 @@ After you enable the MicroProfile Telemetry feature and set this system property

When your Liberty runtime hosts multiple applications, you might choose to enable OpenTelemetry to collect logs, metrics, and traces at the application level for each application. Although this option does not collect runtime-level telemetry, it gives you fine-grained control of the data you collect for each application.

* Enable the feature:mpTelemetry[display=MicroProfile Telemetry] feature version 2.0 or later in the `featureManager` element of the `server.xml` file of each application that you want to collect telemetry for.
+
[source,xml]
----
<featureManager>
<feature>mpTelemetry-2.0</feature>
...
</featureManager>
----
. Enable the feature:mpTelemetry[display=MicroProfile Telemetry] feature version 2.0 or later in the `featureManager` element of the `server.xml` file of each application that you want to collect telemetry for.

* Set `otel.sdk.disabled=false` as an application-level property in the `microprofile-config.properties` file of each application.
. Set `otel.sdk.disabled=false` as an application-level property in the `microprofile-config.properties` file of each application.
+
The following examples show an application scenario where two applications on the same Open Liberty runtime are configured to collect and export telemetry data at the application level. These examples also set the `otel.service.name` property in each application to assign a service name to the telemetry data that is collected. This service name helps you identify the source of the data from each application when you send your data to monitoring and analytics tools.
+
Expand All @@ -102,8 +86,11 @@ otel.service.name=A2
+
This configuration creates all telemetry from Application 1 with the service name `A1`, and from Application 2 with the service name `A2`.

* You can also use a combination of runtime-level and application-level configuration, so that some settings apply to all applications on the runtime, while others are specific to each application. This strategy can save you from having to duplicate general configuration settings in multiple applications on the same runtime. Any runtime-level configuration takes precedence over application-level configuration. Therefore, you can enable OpenTelemetry and assign a service name individually for each application, but specify other settings at the runtime level to apply globally to all applications on the runtime. To combine runtime and application-level configuration, you must set the `otel.sdk.disabled=false` at the application level and not in a runtime-level configuration source.
+

You can also use a combination of runtime-level and application-level configuration, so that some settings apply to all applications on the runtime, while others are specific to each application. This strategy can save you from having to duplicate general configuration settings in multiple applications on the same runtime.

Any runtime-level configuration takes precedence over application-level configuration. Therefore, you can enable OpenTelemetry and assign a service name individually for each application, but specify other settings at the runtime level to apply globally to all applications on the runtime. To combine runtime and application-level configuration, you must set the `otel.sdk.disabled=false` property at the application level and not in a runtime-level configuration source.

For example, you might want to collect a unique set of telemetry data for each application in the runtime, but have all applications use the same OpenTelemetry logs exporter. You can set the OpenTelemetry logs exporter at the runtime-level by adding the following property in the `bootstrap.properties` file:
+
----
Expand All @@ -119,7 +106,7 @@ otel.service.name=<serviceName>
+
This configuration enables an application-level telemetry with a unique service name for each application, while all applications in the runtime use the `myExporter` logs exporter.

After you enable the MicroProfile Telemetry feature and set the `otel.sdk.disabled=false` property for each application on the runtime, your applications are ready to start collecting and exporting logs, metrics, and traces.
After you enable the MicroProfile Telemetry feature and set the system properties for each application on the runtime, your applications are ready to start collecting and exporting logs, metrics, and traces.

[#config]
== OpenTelemetry settings and configuration
Expand Down

0 comments on commit 4a6e61d

Please sign in to comment.