Bug Report
List of all OpenTelemetry NuGet packages and version that you are using (e.g. OpenTelemetry 1.0.2):
OpenTelemetry.Exporter.Console: 1.2.0-rc3
OpenTelemetry.Exporter.InMemory: 1.2.0-rc3
OpenTelemetry.Exporter.OpenTelemetryProtocol: 1.2.0-rc3
OpenTelemetry.Extensions.Hosting: 1.0.0-rc10
Runtime version (e.g. net461, net48, netcoreapp3.1, net5.0 etc. You can
find this information from the *.csproj file):
Symptom
A clear and concise description of what the bug is.
What is the expected behavior?
Metrics being flushed automatically every 1 minute
What is the actual behavior?
Metrics were not being flushed and diagnostic logs don't provide any entries other than null.
However, as mitigation, I need to call ForceFlush to emit the metrics.
Reproduce
When constructing a meter provider as following, it used to automatically flush metrics:
var configuredMetricProvider = Sdk.CreateMeterProviderBuilder()
.AddMeter("Example.*")
.AddConsoleExporter()
.AddOtlpExporter(options =>
{
options.Endpoint = new Uri(collectorUri);
})
// We can only register global histogram buckets, not per histogram (for now)
// See https://github.com/open-telemetry/opentelemetry-dotnet/issues/2755
.AddView("*", new ExplicitBucketHistogramConfiguration { Boundaries = histogramBuckets })
.Build();
Additional Context
Add any other context about the problem here.
Bug Report
List of all OpenTelemetry NuGet packages and version that you are using (e.g.
OpenTelemetry 1.0.2):OpenTelemetry.Exporter.Console: 1.2.0-rc3OpenTelemetry.Exporter.InMemory: 1.2.0-rc3OpenTelemetry.Exporter.OpenTelemetryProtocol: 1.2.0-rc3OpenTelemetry.Extensions.Hosting: 1.0.0-rc10Runtime version (e.g.
net461,net48,netcoreapp3.1,net5.0etc. You canfind this information from the
*.csprojfile):net6.0Symptom
A clear and concise description of what the bug is.
What is the expected behavior?
Metrics being flushed automatically every 1 minute
What is the actual behavior?
Metrics were not being flushed and diagnostic logs don't provide any entries other than null.
However, as mitigation, I need to call
ForceFlushto emit the metrics.Reproduce
When constructing a meter provider as following, it used to automatically flush metrics:
Additional Context
Add any other context about the problem here.