Skip to content

Commit 0e79cb3

Browse files
Merge pull request #11135 from zlogic/DES-7315_mxok-otel-instructions
Added documentation how to use OpenTelemetry in MxOK (no release date)
2 parents 4c73266 + 3061e69 commit 0e79cb3

1 file changed

Lines changed: 71 additions & 4 deletions

File tree

content/en/docs/refguide/runtime/tracing-in-runtime.md

Lines changed: 71 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -159,12 +159,79 @@ To use the OpenTelemetry Collector with Datadog, follow these steps:
159159
2. Install the `otelcol_contrib` package instead of `otelcol` to include Datadog support.
160160
3. Run the collector with the [appropriate configuration](https://docs.datadoghq.com/opentelemetry/setup/collector_exporter/install/#2---configure-the-datadog-exporter-and-connector) adapted for Datadog.
161161

162-
## Include Metrics and Logs in OpenTelemetry
162+
## Sending Traces from Mendix on Kubernetes
163+
164+
Mendix on Kubernetes can send OpenTelemetry traces to a standards-compliant OpenTelemetry collector.
165+
166+
Some cloud providers provide OpenTelemetry instrumentation agents and will not work with the Mendix Runtime. For example, [Azure Application Insights](https://learn.microsoft.com/en-us/azure/azure-monitor/app/opentelemetry-enable) is incompatible with the standard OpenTelemetry instrumentation agent bundled with the Mendix Runtime.
167+
168+
### Installing Jaeger from a Helm chart
169+
170+
To get an OpenTelemetry collector installed into a Kubernetes cluster, contact your cluster admin.
171+
172+
For quick experiments or non-production use cases, Jaeger can be installed using the [official Helm chart](https://github.com/jaegertracing/helm-charts/tree/jaeger-4.7.0/charts/jaeger).
173+
174+
{{% alert color="warning" %}}
175+
The default Jaeger configuration is not production-grade, because it does not have any authentication and stores all traces in memory. To get a production-grade OpenTelemetry collector installed into a Kubernetes cluster, contact your cluster admin.
176+
{{% /alert %}}
177+
178+
#### Kubernetes Cluster
179+
180+
To install Jaeger into a Kubernetes cluster (except OpenShift), run the following commands in a Bash prompt:
181+
182+
```shell
183+
HELM_RELEASE=mx-jaeger
184+
helm repo add jaegertracing https://jaegertracing.github.io/helm-charts
185+
helm install $HELM_RELEASE jaegertracing/jaeger --version='~4.7' \
186+
--set storage.type=memory
187+
```
188+
189+
#### OpenShift Cluster
190+
191+
To install Jaeger into an OpenShift cluster, run the following commands in a Bash prompt:
192+
193+
```shell
194+
HELM_RELEASE=mx-jaeger
195+
helm repo add jaegertracing https://jaegertracing.github.io/helm-charts
196+
helm install $HELM_RELEASE jaegertracing/jaeger --version='~4.7' \
197+
--set storage.type=memory \
198+
--set jaeger.podSecurityContext=null
199+
```
200+
201+
#### Accessing the Jaeger Web UI
163202

164-
You can also collect metrics data (CPU load, memory, etc.) and logs using OpenTelemetry.
203+
To access the Jaeger web UI, run the following command in a Bash prompt:
204+
205+
```shell
206+
HELM_RELEASE=mx-jaeger
207+
kubectl port-forward svc/${HELM_RELEASE} 16686:16686
208+
```
209+
210+
#### Sending Traces
211+
212+
To send traces to this OpenTelemetry Collector, use the following hostname format (where `${HELM_RELEASE}` is the value of `HELM_RELEASE` used during installation, and `${NAMESPACE}` is the namespace where the Jaeger Helm chart was installed):
213+
214+
```
215+
${HELM_RELEASE}.${NAMESPACE}.svc.cluster.local
216+
```
217+
218+
For example, `mx-jaeger.example-namespace.svc.cluster.local`.
219+
220+
### OpenTelemetry Collector
221+
222+
To send logs and traces from a Mendix on Kubernetes environment to an OpenTelemetry collector, set the _Custom JVM Options_ to the following:
223+
224+
```
225+
-javaagent:/opt/mendix/runtime/agents/opentelemetry-javaagent.jar -Dotel.javaagent.extensions=/opt/mendix/runtime/agents/mendix-opentelemetry-agent-extension.jar -Dotel.service.name=${APP_NAME} -Dotel.exporter.otlp.traces.endpoint=http://${OTEL_HOST}:4318/v1/traces -Dotel.exporter.otlp.traces.protocol=http/protobuf
226+
```
227+
228+
Replace `${APP_NAME}` with a meaninful identifier for your environment (service), and `${OTEL_HOST}` with the hostname of the OpenTelemetry Collector.
229+
230+
Depending on how the OpenTelemetry Collector is configured, the values of `-Dotel.exporter.otlp.traces.endpoint` and `-Dotel.exporter.otlp.traces.protocol` might need to be modified.
231+
232+
## Include Metrics and Logs in OpenTelemetry
165233

166-
* See the [OpenTelemetry](/refguide/metrics/#opentelemetry) section of *Metrics* for a guide on how to setup metrics with OpenTelemetry.
167-
* See [Request to Create New Log Subscriber in Open Telemetry Format](/refguide/monitoring-mendix-runtime/#new-log-sub-opentelemetry) in *Monitoring Mendix Runtime* for a guide on how to setup logs with OpenTelemetry.
234+
You can also use OpenTelemetry to collect logs and metrics data (CPU load, memory, and others). For more information about setting up metrics with OpenTelemetry, see the [OpenTelemetry](/refguide/metrics/#opentelemetry) section of *Metrics*. For a guide on how to set up logs with OpenTelemetry, see [Request to Create New Log Subscriber in Open Telemetry Format](/refguide/monitoring-mendix-runtime/#new-log-sub-opentelemetry) in *Monitoring Mendix Runtime*.
168235

169236
## Custom Spans in Java Actions
170237

0 commit comments

Comments
 (0)