@@ -30,6 +30,7 @@ public class OtlpProtobufMetricExporterTests
3030 { "Dim3" , 3 } ,
3131 } ;
3232
33+ #if EXPOSE_EXPERIMENTAL_FEATURES
3334 private static readonly string [ ] TagKeys = new [ ]
3435 {
3536 "boolKey" ,
@@ -50,6 +51,7 @@ public class OtlpProtobufMetricExporterTests
5051 "ulongKey" ,
5152 "ushortKey" ,
5253 } ;
54+ #endif
5355
5456 private TagList exemplarTagList ;
5557
@@ -215,6 +217,7 @@ public void CounterSerializationSingleMetricPoint(string instrumentName, long? l
215217 if ( longValue != null )
216218 {
217219 var counter = meter . CreateCounter < long > ( instrumentName ) ;
220+ #if EXPOSE_EXPERIMENTAL_FEATURES
218221 if ( isExemplarsEnabled )
219222 {
220223 counter . Add ( longValue . Value , this . exemplarTagList ) ;
@@ -223,10 +226,14 @@ public void CounterSerializationSingleMetricPoint(string instrumentName, long? l
223226 {
224227 counter . Add ( longValue . Value , this . TagList ) ;
225228 }
229+ #else
230+ counter . Add ( longValue . Value , this . TagList ) ;
231+ #endif
226232 }
227233 else
228234 {
229235 var counter = meter . CreateCounter < double > ( instrumentName ) ;
236+ #if EXPOSE_EXPERIMENTAL_FEATURES
230237 if ( isExemplarsEnabled )
231238 {
232239 counter . Add ( doubleValue . Value , this . exemplarTagList ) ;
@@ -235,6 +242,9 @@ public void CounterSerializationSingleMetricPoint(string instrumentName, long? l
235242 {
236243 counter . Add ( doubleValue . Value , this . TagList ) ;
237244 }
245+ #else
246+ counter . Add ( doubleValue . Value , this . TagList ) ;
247+ #endif
238248 }
239249
240250 meterProvider . ForceFlush ( ) ;
@@ -805,6 +815,7 @@ public void HistogramSerializationSingleMetricPoint(double doubleValue, bool add
805815 var meterProvider = meterProviderBuilder . Build ( ) ;
806816
807817 var histogram = meter . CreateHistogram < double > ( "TestHistogram" ) ;
818+ #if EXPOSE_EXPERIMENTAL_FEATURES
808819 if ( isExemplarsEnabled )
809820 {
810821 histogram . Record ( doubleValue , this . exemplarTagList ) ;
@@ -813,6 +824,9 @@ public void HistogramSerializationSingleMetricPoint(double doubleValue, bool add
813824 {
814825 histogram . Record ( doubleValue , this . TagList ) ;
815826 }
827+ #else
828+ histogram . Record ( doubleValue , this . TagList ) ;
829+ #endif
816830
817831 meterProvider . ForceFlush ( ) ;
818832
@@ -1423,6 +1437,7 @@ public void ExponentialHistogramSerializationSingleMetricPoint(double? doubleVal
14231437 var instrumentName = "doubleExponentialHistogram" ;
14241438 var histogram = meter . CreateHistogram < double > ( instrumentName ) ;
14251439
1440+ #if EXPOSE_EXPERIMENTAL_FEATURES
14261441 if ( isExemplarsEnabled )
14271442 {
14281443 histogram . Record ( doubleValue . Value , this . exemplarTagList ) ;
@@ -1433,6 +1448,10 @@ public void ExponentialHistogramSerializationSingleMetricPoint(double? doubleVal
14331448 histogram . Record ( doubleValue . Value , this . TagList ) ;
14341449 histogram . Record ( 0 , this . TagList ) ;
14351450 }
1451+ #else
1452+ histogram . Record ( doubleValue . Value , this . TagList ) ;
1453+ histogram . Record ( 0 , this . TagList ) ;
1454+ #endif
14361455
14371456 meterProvider . ForceFlush ( ) ;
14381457
0 commit comments