in rocketmq-client-csharp/Producer.cs [46:74]
public override async Task Start()
{
await base.Start();
// More initialization
// TODO: Add authentication header
_meterProvider = Sdk.CreateMeterProviderBuilder()
.AddMeter("Apache.RocketMQ.Client")
.AddOtlpExporter(delegate(OtlpExporterOptions options, MetricReaderOptions readerOptions)
{
options.Protocol = OtlpExportProtocol.Grpc;
options.Endpoint = new Uri(_accessPoint.TargetUrl());
options.TimeoutMilliseconds = (int) _clientSettings.RequestTimeout.ToTimeSpan().TotalMilliseconds;
readerOptions.PeriodicExportingMetricReaderOptions.ExportIntervalMilliseconds = 60 * 1000;
})
.AddView((instrument) =>
{
if (instrument.Meter.Name == MeterName && instrument.Name == SendLatencyName)
{
return new ExplicitBucketHistogramConfiguration()
{
Boundaries = new double[] {1, 5, 10, 20, 50, 200, 500},
};
}
return null;
})
.Build();
}