initialize method
Initializes telemetry exporter.
Returns 1 on success to preserve legacy behavior.
Implementation
int initialize([String otlpEndpoint = '']) {
if (!_symbolsAvailable) {
return 0;
}
final endpointPtr = otlpEndpoint.toNativeUtf8();
try {
final result = _otelInitPtr!.asFunction<
int Function(
ffi.Pointer<ffi.Int8>,
ffi.Pointer<ffi.Uint8>,
ffi.Pointer<ffi.Uint8>,
)>()(
endpointPtr.cast<ffi.Int8>(),
ffi.nullptr,
ffi.nullptr,
);
if (result == 0) {
_initialized = true;
} else {
_captureNativeError();
}
return _legacySuccessCode(result);
} finally {
malloc.free(endpointPtr);
}
}