Skip to content
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
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,10 @@ When you are deploying your application to a server or Mendix Cloud, you will ha

## Configuration Settings

{{% alert color="info" %}}
The **OpenTelemetry** tab was named **Tracing** in Mendix versions below 11.12.0.
{{% /alert %}}

A configuration contains the following:

* Name – the name of the configuration
Expand All @@ -29,7 +33,7 @@ A configuration contains the following:
* [Constants](#constants)
* [Custom](#custom)
* [Headers](#headers)
* [Tracing](/refguide/tracing-in-runtime/#min-configuration)
* [OpenTelemetry](/refguide/tracing-in-runtime/#min-configuration)
Comment thread
MarkvanMents marked this conversation as resolved.

### Database {#database}

Expand Down Expand Up @@ -88,7 +92,7 @@ Only use this functionality if you know what you are doing. Wrong values can sto

Each header consists of a name and a value. By default, when configuring a custom header it can be selected from the drop-down menu. A custom header can be specified by selecting **Custom...** in the dropdown menu. In most cases, the header will be returned for all responses from the Mendix Runtime.

#### Special headers
#### Special Headers

The following headers are considered special and are handled differently from other custom headers.

Expand Down
30 changes: 21 additions & 9 deletions content/en/docs/refguide/runtime/tracing-in-runtime.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,11 @@ The runtime generates spans for the following:

### Minimal Configuration {#min-configuration}

You can enable tracing from the `App Settings` -> `Configuration` dialog. In the `Tracing` tab, you can enable tracing and specify an **Endpoint** and **Service Name**.
{{% alert color="info" %}}
The **OpenTelemetry** tab was named **Tracing** in Mendix versions below 11.12.0.
{{% /alert %}}

You can enable OpenTelemetry tracing and logging from the `App Settings` -> `Configuration` dialog. In the `OpenTelemetry` tab, you can enable tracing and logging and specify an **Endpoint** and **Service Name**.

{{< figure src="/attachments/refguide/runtime/tracing-in-runtime/tracing-configuration.png" >}}

Expand All @@ -65,17 +69,17 @@ You can filter out specific traces using the `mendix.tracing.filter` system prop

You can test the tracing using [Jaeger](https://www.jaegertracing.io/) or [Grafana](https://grafana.com).

For Jaeger, you can use the all-in-one binary or Docker image. Jaeger will listen to endpoint `http://localhost:4318/v1/traces` by default.
For Jaeger, you can use the all-in-one binary or Docker image. Jaeger will listen to endpoint `http://localhost:4318` by default.

For Grafana, you can use the all-in-one Docker image `grafana/otel-lgtm`. After starting it with the following command, it will listen to the endpoint `http://localhost:4318/v1/traces`.
For Grafana, you can use the all-in-one Docker image `grafana/otel-lgtm`. After starting it with the following command, it will listen to the endpoint `http://localhost:4318`.

```
docker run --name otel-grafana -d -p 3000:3000 -p 4317:4317 -p 4318:4318 grafana/otel-lgtm
```

Alternatively, you can set up the [OpenTelemetry collector](https://opentelemetry.io/docs/collector/), which will also listen to the default endpoint and can be configured to send to backends which support OpenTelemetry. Check with your APM vendor to confirm that OpenTelemetry is supported. The free online collector configuration tool [OTelBin](https://github.com/dash0hq/otelbin) can help with collector configuration.
Alternatively, you can set up the [OpenTelemetry collector](https://opentelemetry.io/docs/collector/), which will also listen to the default endpoint and can be configured to send to backends which support OpenTelemetry. Check with your Application Performance Monitoring (APM) vendor to confirm that OpenTelemetry is supported. The free online collector configuration tool [OTelBin](https://github.com/dash0hq/otelbin) can help with collector configuration.

### All settings
### All Settings

The following settings are supported by the Mendix runtime. See [Configure the SDK](https://opentelemetry.io/docs/languages/java/configuration/#environment-variables-and-system-properties) for more information about the settings that are prefixed with `otel.`.

Expand All @@ -86,8 +90,9 @@ You can configure the Java Agent through system properties which can be added to
| `otel.service.name` | The name of the service. | `runtimelauncher` |
| `otel.resource.attributes` | Extra resource attributes to include in every span. Example: `attribute1=value1,attribute2=value2` | |
| `otel.traces.exporter` | Comma-separated list of span exporters. Supported values are: `otlp`, `console`, `logging-otlp`, and `none`. | `otlp` |
| `otel.logs.exporter` | Comma-separated list of span exporters. Supported values are: `otlp`, `console`, `logging-otlp`, and `none`. | `otlp` |
| `otel.exporter.otlp.endpoint` | The endpoint to send all OTLP traces and logs to. It must be a URL with a scheme of either http or https, based on the use of TLS. | `http://localhost:4318` when the protocol is `http/protobuf`<br>`http://localhost:4317` when the protocol is `grpc` |
| `otel.exporter.otlp.traces.protocol` | The transport protocol to use on OTLP trace requests. Options include `grpc` and `http/protobuf`. | `http/protobuf` (Java Agent) |
| `otel.exporter.otlp.traces.endpoint` | The endpoint to send all OTLP traces to. It must be a URL with a scheme of either http or https, based on the use of TLS. | `http://localhost:4318/v1/traces` when the protocol is `http/protobuf`<br>`http://localhost:4317` when the protocol is `grpc` |
| `otel.exporter.otlp.traces.certificate` | The path to the file containing trusted certificates to use when verifying a trace server's TLS credentials. The file should contain one or more X.509 certificates in PEM format. | By default the host platform's trusted root certificates are used. |
| `otel.exporter.otlp.traces.client.key` | The path to the file containing the private client key to use when verifying a trace client's TLS credentials. The file should contain one private key in PKCS8 PEM format. | By default no client key file is used. |
| `otel.exporter.otlp.traces.client.certificate` | The path to the file containing trusted certificates to use when verifying a trace client's TLS credentials. The file should contain one or more X.509 certificates in PEM format. | By default no certificate file is used. |
Expand Down Expand Up @@ -225,13 +230,20 @@ To send logs and traces from a Mendix on Kubernetes environment to an OpenTeleme
-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
```

Replace `${APP_NAME}` with a meaninful identifier for your environment (service), and `${OTEL_HOST}` with the hostname of the OpenTelemetry Collector.
Replace `${APP_NAME}` with a meaningful identifier for your environment (service), and `${OTEL_HOST}` with the hostname of the OpenTelemetry Collector.

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.

## Include Metrics and Logs in OpenTelemetry
## Including Logs in OpenTelemetry

You can use OpenTelemetry to collect logs. For local development, enable logs in the [OpenTelemetry configuration](#min-configuration).
Once enabled, the logs will be sent to the configured endpoint.

For deployment, see [Request to Create New Log Subscriber in Open Telemetry Format](/refguide/monitoring-mendix-runtime/#new-log-sub-opentelemetry) in *Monitoring Mendix Runtime*.

## Including Metrics in OpenTelemetry

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*.
You can use OpenTelemetry to collect 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*.
Comment thread
atennapel marked this conversation as resolved.

## Custom Spans in Java Actions

Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading