public PitayaReporter(PrometheusReporter prometheusReporter) { var handle = GCHandle.Alloc(prometheusReporter, GCHandleType.Normal); var reporterPtr = GCHandle.ToIntPtr(handle); _registerCounterDelegate = RegisterCounterFn; _registerGaugeDelegate = RegisterGaugeFn; _registerHistogramDelegate = RegisterHistogramFn; _incCounterDelegate = IncCounterFn; _setGaugeDelegate = SetGaugeFn; _addGaugeFn = AddGaugeFn; _observeHistFn = ObserveHistFn; Ptr = PitayaCluster.pitaya_metrics_reporter_new( _registerCounterDelegate, _registerHistogramDelegate, _registerGaugeDelegate, _incCounterDelegate, _observeHistFn, _setGaugeDelegate, _addGaugeFn, reporterPtr); }