Package glide.ffi.resolvers
Class OpenTelemetryResolver
- java.lang.Object
-
- glide.ffi.resolvers.OpenTelemetryResolver
-
public class OpenTelemetryResolver extends java.lang.ObjectResolver class for OpenTelemetry operations in Valkey GLIDE. This class provides native methods to interact with OpenTelemetry functionality implemented in the Rust core library.
-
-
Constructor Summary
Constructors Constructor Description OpenTelemetryResolver()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static longcreateLeakedOtelSpan(java.lang.String spanName)Creates a new OpenTelemetry span with the given name that will not be automatically dropped by the Rust core.static voiddropOtelSpan(long spanPtr)Drops an OpenTelemetry span that was created withcreateLeakedOtelSpan(String), releasing its resources.static intinitOpenTelemetry(java.lang.String tracesEndpoint, int tracesSamplePercentage, java.lang.String metricsEndpoint, long flushIntervalMs)Initializes OpenTelemetry with the provided configuration.
-
-
-
Method Detail
-
initOpenTelemetry
public static int initOpenTelemetry(java.lang.String tracesEndpoint, int tracesSamplePercentage, java.lang.String metricsEndpoint, long flushIntervalMs)Initializes OpenTelemetry with the provided configuration.- Parameters:
tracesEndpoint- The endpoint for traces exporter (can be null if not used)tracesSamplePercentage- The percentage of requests to sample (0 for default)metricsEndpoint- The endpoint for metrics exporter (can be null if not used)flushIntervalMs- The interval in milliseconds between consecutive exports (0 for default)- Returns:
- 0 on success, error code otherwise: 1 - Missing configuration (both traces and metrics are null) 2 - Invalid traces endpoint 3 - Invalid metrics endpoint 4 - Runtime initialization failure 5 - OpenTelemetry initialization failure
-
createLeakedOtelSpan
public static long createLeakedOtelSpan(java.lang.String spanName)
Creates a new OpenTelemetry span with the given name that will not be automatically dropped by the Rust core. The caller is responsible for dropping this span usingdropOtelSpan(long).- Parameters:
spanName- The name of the span to create- Returns:
- A pointer to the created span, or 0 if creation failed
-
dropOtelSpan
public static void dropOtelSpan(long spanPtr)
Drops an OpenTelemetry span that was created withcreateLeakedOtelSpan(String), releasing its resources.- Parameters:
spanPtr- The pointer to the span to drop
-
-