Distributed Tracing
This topic describes how to turn on distributed tracing in GigaSpaces (XAP
GigaSpaces eXtreme Application Platform.
Provides a powerful solution for data processing, launching, and running digital services) and connect it to your observability backend to identify latency issues and performance bottlenecks.
Overview
Distributed tracing is a vendor-agnostic way to gather timing data and troubleshoot latency issues across your system architecture. GigaSpaces includes native support for the OpenTelemetry SDK (v1.62.0), allowing you to seamlessly trace Space
Where GigaSpaces data is stored. It is the logical cache that holds data objects in memory and might also hold them in layered in tiering. Data is hosted from multiple SoRs, consolidated as a unified data model. operations and export spans to your preferred observability backend (for example, Jaeger or the OpenTelemetry Collector) via OTLP.
Turning on Tracing: com.gs.tracing.exporter
By default, tracing is set to a no-op (which incurs almost no performance cost and sends nothing). To enable tracing, configure the com.gs.tracing.exporter property.
| Value | Result |
|---|---|
none (default) |
No-op: nothing is sent anywhere. |
logging
|
Spans are written to the process log, useful for local debugging. |
otlp
|
Spans are exported over OTLP/HTTP to your observability backend. |
You must set this in GS_OPTIONS_EXT (for example, inside setenv-overrides.sh) so that every JVM
Java Virtual Machine. A virtual machine that enables a computer to run Java programs as well as programs written in other languages that are also compiled to Java bytecode. gets the same configuration:
export GS_OPTIONS_EXT="-Dcom.gs.tracing.exporter=otlp \
-Dotel.exporter.otlp.endpoint=http://<backend>:4318 \
-Dotel.exporter.otlp.headers=<auth-header>=<value>" # optional, e.g. an API key
Once configured, restart your cluster:
./bin/gs.sh host kill-agent && ./bin/gs.sh host run-agent --auto --gsc=1 --restv3
Standard OpenTelemetry Configuration
Along with the XAP-specific com.gs.tracing.exporter property, the system relies on standard OpenTelemetry SDK configuration properties (otel.* system properties or OTEL_* environment variables). These are read once per JVM at startup when the exporter is set to otlp.
Naming Convention: Every property can be defined as a system property (-Dotel.exporter.otlp.endpoint) or an environment variable (OTEL_EXPORTER_OTLP_ENDPOINT). Use whichever best fits your deployment.
Precedence: -Dotel.* system property > OTEL_* environment variable > XAP's default values.
Known Restrictions
-
Supported Protocol: Only the OTLP/HTTP sender is shipped (defaults to
http/protobuf).otel.exporter.otlp.protocol=grpcwill not work. -
Exporters: Third-party exporters/samplers requiring extra jars (such as
zipkin,prometheus,b3,jaeger) are not shipped. You must useotlp,logging, ornone, alongsidetracecontext/baggage. -
Metrics: Enabling
otel.metrics.exporterorotel.logs.exporterwill send OpenTelemetry's internal metrics/logs, not GigaSpaces metrics. (GigaSpaces metrics use Micrometer and are configured independently.)
Where to Put Settings
Setup Recipes and Endpoint Rules
When specifying your endpoint, use your backend's OTLP/HTTP address (conventionally port 4318, not the 4317 gRPC port). Provide the base URL (for example, https://host:4318), and the SDK will automatically append /v1/traces.
Below are common setup recipes (to be used in addition to -Dcom.gs.tracing.exporter=otlp):
| Use Case | Additional Settings |
|---|---|
| Unsecured (local Jaeger/Collector) | -Dotel.exporter.otlp.endpoint=http://collector:4318
|
| TLS, public CA (SaaS, HTTPS) | -Dotel.exporter.otlp.endpoint=https://otlp.vendor.example (uses the JDK's default trust store) |
| TLS, private / self-signed CA | Add -Dotel.exporter.otlp.certificate=/path/ca.pem |
| Mutual TLS |
Add Add |
| API key / token header | OTEL_EXPORTER_OTLP_HEADERS="<header-name>=<key>"
|
| Bearer token | OTEL_EXPORTER_OTLP_HEADERS="Authorization=Bearer%20<token>"
|
Combined Secure Example: This example demonstrates TLS with a private CA, keeping the API key secret by passing it as an environment variable.
export OTEL_EXPORTER_OTLP_HEADERS="api-key=${TRACING_API_KEY}"
export GS_OPTIONS_EXT="-Dcom.gs.tracing.exporter=otlp \
-Dotel.exporter.otlp.endpoint=https://otel.internal.example:4318 \
-Dotel.exporter.otlp.certificate=/opt/certs/internal-ca.pem"
./bin/gs.sh host run-agent --auto --gsc=2 --restv3
What Gets Traced?
Context propagates automatically, but not every Space operation produces its own dedicated span.
-
Covered Operations (Generate Spans):
read,readByIds,readMultiple,take,takeIfExists(ById),takeById(Class variants only),takeMultiple,write,writeMultiple,change,aggregate. -
Not Covered (Participate in trace without creating a new span):
readById,readIfExists(ById),takeByIds,takeById(IdQuery …),count,clear,execute, async variants,iterator. -
Server-side (GSC): Currently, only single reads generate a server-side span (
gigaspaces:space_query). -
Client-side traces are broken down per partition so that slow partitions can be identified.
Do not enable the older ZipkinTracerBean together with com.gs.tracing.exporter. Both will attempt to own the process's global tracer and cause conflicts.
Troubleshooting
Export failures will never break GigaSpaces operations. If an export fails, the SDK simply logs the error and drops the batch. If spans aren't appearing, check your logs/…-restv3_….log or logs/…-gsc_….log for Failed to export spans:
| Log Message | Cause | Resolution |
|---|---|---|
SSLHandshakeException: … PKIX path building failed
|
Server certificate is not trusted (private CA). | Set otel.exporter.otlp.certificate=<ca.pem>. |
HTTP status code 401 or 403 |
Missing or incorrect authentication header. | Check OTEL_EXPORTER_OTLP_HEADERS formatting and values. |
| Handshake failure against an mTLS server | Missing or incorrect client certificate. | Set client.key (must be PKCS#8) and client.certificate. |
HTTP status code 404
|
Wrong path (for example, a traces-only endpoint missing /v1/traces). |
Use the base-URL property, or manually include the path. |
| Connection refused / timeout | Wrong host/port, or aimed at the gRPC port (4317). | Switch to the OTLP/HTTP address (4318). |
In-Memory Data Grid - achieve unparalleled speed, persistence, and accuracy.