@@ -354,7 +354,7 @@ Counter<long> MyFruitCounter = MyMeter.CreateCounter<long>("MyFruitCounter");
354354Counter < long > AnotherFruitCounter = MyMeter .CreateCounter <long >(" AnotherFruitCounter" );
355355
356356using var meterProvider = Sdk .CreateMeterProviderBuilder ()
357- .AddMeter (" * " )
357+ .AddMeter (" MyCompany.MyProduct.MyLibrary " )
358358 .AddConsoleExporter ()
359359 .SetMaxMetricStreams (1 ) // The default value is 1000
360360 .Build ();
@@ -367,11 +367,31 @@ MyFruitCounter.Add(1, new("name", "apple"), new("color", "red"));
367367AnotherFruitCounter .Add (1 , new (" name" , " apple" ), new (" color" , " red" ));
368368```
369369
370+ ### Changing the cardinality limit for a MeterProvider
371+
372+ To set the default [ cardinality limit] ( ../README.md#cardinality-limits ) for all
373+ metrics managed by a given ` MeterProvider ` , use the
374+ ` MeterProviderBuilder.SetMaxMetricPointsPerMetricStream ` extension:
375+
376+ > [ !CAUTION]
377+ > ` MeterProviderBuilder.SetMaxMetricPointsPerMetricStream ` is marked ` Obsolete `
378+ in pre-release builds and has been replaced by
379+ ` MetricStreamConfiguration.CardinalityLimit ` . For details see:
380+ [ OTEL1003] ( ../../diagnostics/experimental-apis/OTEL1003.md ) .
381+
382+ ``` csharp
383+ using var meterProvider = Sdk .CreateMeterProviderBuilder ()
384+ .AddMeter (" MyCompany.MyProduct.MyLibrary" )
385+ .SetMaxMetricPointsPerMetricStream (4000 ) // Note: The default value is 2000
386+ .AddConsoleExporter ()
387+ .Build ();
388+ ```
389+
370390### Changing the cardinality limit for a Metric
371391
372392To set the [ cardinality limit] ( ../README.md#cardinality-limits ) for an
373- individual metric, use ` MetricStreamConfiguration.CardinalityLimit ` setting on
374- the View API:
393+ individual metric, use the ` MetricStreamConfiguration.CardinalityLimit ` property
394+ on the View API:
375395
376396> [ !NOTE]
377397> ` MetricStreamConfiguration.CardinalityLimit ` is an experimental API only
0 commit comments