Skip to content

Commit 4da3451

Browse files
[Exporter.Geneva] 1.9.0-alpha.1 release prep (open-telemetry#1834)
1 parent 200d66d commit 4da3451

File tree

7 files changed

+11
-118
lines changed

7 files changed

+11
-118
lines changed

src/OpenTelemetry.Exporter.Geneva/CHANGELOG.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,13 @@
22

33
## Unreleased
44

5+
## 1.9.0-alpha.1
6+
7+
Released 2024-May-22
8+
9+
* Update OpenTelemetry SDK version to `1.9.0-alpha.1`.
10+
([#1834](https://github.com/open-telemetry/opentelemetry-dotnet-contrib/pull/1834))
11+
512
## 1.8.0
613

714
Released 2024-May-15

src/OpenTelemetry.Exporter.Geneva/Common.GenevaExporter.props

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<Project>
22
<PropertyGroup>
3-
<OTelSdkVersion>$(OpenTelemetryCoreLatestVersion)</OTelSdkVersion>
3+
<OTelSdkVersion>$(OpenTelemetryCoreLatestPrereleaseVersion)</OTelSdkVersion>
44
</PropertyGroup>
55

66
<PropertyGroup Condition="$(OTelSdkVersion.Contains('alpha')) OR $(OTelSdkVersion.Contains('beta')) OR $(OTelSdkVersion.Contains('rc'))">

src/OpenTelemetry.Exporter.Geneva/Metrics/OtlpProtobuf/OtlpProtobufSerializer.cs

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -394,15 +394,13 @@ private void SerializeMetric(byte[] buffer, ref int cursor, Metric metric)
394394
}
395395
}
396396

397-
#if EXPOSE_EXPERIMENTAL_FEATURES
398397
if (metricPoint.TryGetExemplars(out var exemplars))
399398
{
400399
foreach (ref readonly var exemplar in exemplars)
401400
{
402401
this.SerializeExemplar(buffer, ref cursor, in exemplar, exemplar.DoubleValue, FieldNumberConstants.HistogramDataPoint_exemplars);
403402
}
404403
}
405-
#endif
406404

407405
var metricPointStartPosition = this.metricPointTagAndLengthIndex;
408406

@@ -489,15 +487,13 @@ private void SerializeMetric(byte[] buffer, ref int cursor, Metric metric)
489487
// write Bucket
490488
ProtobufSerializerHelper.WriteTagAndLengthPrefix(buffer, ref positiveBucketIndex, cursor - positiveBucketValueIndex, FieldNumberConstants.ExponentialHistogramDataPoint_positive, WireType.LEN);
491489

492-
#if EXPOSE_EXPERIMENTAL_FEATURES
493490
if (metricPoint.TryGetExemplars(out var exemplars))
494491
{
495492
foreach (ref readonly var exemplar in exemplars)
496493
{
497494
this.SerializeExemplar(buffer, ref cursor, in exemplar, exemplar.DoubleValue, FieldNumberConstants.ExponentialHistogramDataPoint_exemplars);
498495
}
499496
}
500-
#endif
501497

502498
var metricPointStartPosition = this.metricPointTagAndLengthIndex;
503499

@@ -549,7 +545,6 @@ private void WriteNumberDataPoint<T>(byte[] buffer, ref int cursor, int fieldNum
549545
cursor += this.prepopulatedNumberDataPointAttributesLength;
550546
}
551547

552-
#if EXPOSE_EXPERIMENTAL_FEATURES
553548
if (metricPoint.TryGetExemplars(out var exemplars))
554549
{
555550
foreach (ref readonly var exemplar in exemplars)
@@ -564,15 +559,13 @@ private void WriteNumberDataPoint<T>(byte[] buffer, ref int cursor, int fieldNum
564559
}
565560
}
566561
}
567-
#endif
568562

569563
var metricPointStartPosition = this.metricPointTagAndLengthIndex;
570564

571565
// Write numberdatapoint {Repeated field}
572566
ProtobufSerializerHelper.WriteTagAndLengthPrefix(buffer, ref metricPointStartPosition, cursor - this.metricPointValueIndex, fieldNumber, WireType.LEN);
573567
}
574568

575-
#if EXPOSE_EXPERIMENTAL_FEATURES
576569
private void SerializeExemplar<T>(byte[] buffer, ref int cursor, in Exemplar exemplar, T value, int fieldNumber)
577570
{
578571
int exemplarTagAndLengthIndex = cursor;
@@ -617,7 +610,6 @@ private void SerializeExemplarTags(byte[] buffer, ref int cursor, ReadOnlyFilter
617610
SerializeTag(buffer, ref cursor, tag.Key, tag.Value, FieldNumberConstants.Exemplar_attributes);
618611
}
619612
}
620-
#endif
621613

622614
private void WriteIndividualMessageTagsAndLength(byte[] buffer, ref int cursor, MetricType metricType)
623615
{

src/OpenTelemetry.Exporter.Geneva/Metrics/TlvMetricExporter.cs

Lines changed: 1 addition & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -87,9 +87,8 @@ internal ExportResult Export(in Batch<Metric> batch)
8787
{
8888
try
8989
{
90-
#if EXPOSE_EXPERIMENTAL_FEATURES
9190
metricPoint.TryGetExemplars(out var exemplars);
92-
#endif
91+
9392
var metricType = metric.MetricType;
9493
switch (metricType)
9594
{
@@ -103,10 +102,8 @@ internal ExportResult Export(in Batch<Metric> batch)
103102
metricPoint.EndTime.ToFileTime(), // Using the endTime here as the timestamp as Geneva Metrics only allows for one field for timestamp
104103
metricPoint.Tags,
105104
metricData,
106-
#if EXPOSE_EXPERIMENTAL_FEATURES
107105
metricType,
108106
exemplars,
109-
#endif
110107
out monitoringAccount,
111108
out metricNamespace);
112109
this.metricDataTransport.Send(MetricEventType.TLV, this.buffer, bodyLength);
@@ -126,10 +123,8 @@ internal ExportResult Export(in Batch<Metric> batch)
126123
metricPoint.EndTime.ToFileTime(),
127124
metricPoint.Tags,
128125
metricData,
129-
#if EXPOSE_EXPERIMENTAL_FEATURES
130126
metricType,
131127
exemplars,
132-
#endif
133128
out monitoringAccount,
134129
out metricNamespace);
135130
this.metricDataTransport.Send(MetricEventType.TLV, this.buffer, bodyLength);
@@ -149,10 +144,8 @@ internal ExportResult Export(in Batch<Metric> batch)
149144
metricPoint.EndTime.ToFileTime(),
150145
metricPoint.Tags,
151146
metricData,
152-
#if EXPOSE_EXPERIMENTAL_FEATURES
153147
metricType,
154148
exemplars,
155-
#endif
156149
out monitoringAccount,
157150
out metricNamespace);
158151
this.metricDataTransport.Send(MetricEventType.TLV, this.buffer, bodyLength);
@@ -170,10 +163,8 @@ internal ExportResult Export(in Batch<Metric> batch)
170163
metricPoint.EndTime.ToFileTime(),
171164
metricPoint.Tags,
172165
metricData,
173-
#if EXPOSE_EXPERIMENTAL_FEATURES
174166
metricType,
175167
exemplars,
176-
#endif
177168
out monitoringAccount,
178169
out metricNamespace);
179170
this.metricDataTransport.Send(MetricEventType.TLV, this.buffer, bodyLength);
@@ -190,10 +181,8 @@ internal ExportResult Export(in Batch<Metric> batch)
190181
metricPoint.EndTime.ToFileTime(),
191182
metricPoint.Tags,
192183
metricData,
193-
#if EXPOSE_EXPERIMENTAL_FEATURES
194184
metricType,
195185
exemplars,
196-
#endif
197186
out monitoringAccount,
198187
out metricNamespace);
199188
this.metricDataTransport.Send(MetricEventType.TLV, this.buffer, bodyLength);
@@ -219,10 +208,8 @@ internal ExportResult Export(in Batch<Metric> batch)
219208
count,
220209
min,
221210
max,
222-
#if EXPOSE_EXPERIMENTAL_FEATURES
223211
metricType,
224212
exemplars,
225-
#endif
226213
out monitoringAccount,
227214
out metricNamespace);
228215
this.metricDataTransport.Send(MetricEventType.TLV, this.buffer, bodyLength);
@@ -271,10 +258,8 @@ internal unsafe ushort SerializeMetricWithTLV(
271258
long timestamp,
272259
in ReadOnlyTagCollection tags,
273260
MetricData value,
274-
#if EXPOSE_EXPERIMENTAL_FEATURES
275261
MetricType metricType,
276262
ReadOnlyExemplarCollection exemplars,
277-
#endif
278263
out string monitoringAccount,
279264
out string metricNamespace)
280265
{
@@ -301,9 +286,7 @@ internal unsafe ushort SerializeMetricWithTLV(
301286
out monitoringAccount,
302287
out metricNamespace);
303288

304-
#if EXPOSE_EXPERIMENTAL_FEATURES
305289
SerializeExemplars(exemplars, metricType, this.buffer, ref bufferIndex);
306-
#endif
307290

308291
SerializeMonitoringAccount(monitoringAccount, this.buffer, ref bufferIndex);
309292

@@ -336,10 +319,8 @@ internal unsafe ushort SerializeHistogramMetricWithTLV(
336319
uint count,
337320
double min,
338321
double max,
339-
#if EXPOSE_EXPERIMENTAL_FEATURES
340322
MetricType metricType,
341323
ReadOnlyExemplarCollection exemplars,
342-
#endif
343324
out string monitoringAccount,
344325
out string metricNamespace)
345326
{
@@ -366,9 +347,7 @@ internal unsafe ushort SerializeHistogramMetricWithTLV(
366347
out monitoringAccount,
367348
out metricNamespace);
368349

369-
#if EXPOSE_EXPERIMENTAL_FEATURES
370350
SerializeExemplars(exemplars, metricType, this.buffer, ref bufferIndex);
371-
#endif
372351

373352
SerializeMonitoringAccount(monitoringAccount, this.buffer, ref bufferIndex);
374353

@@ -413,7 +392,6 @@ private static void SerializeMonitoringAccount(string monitoringAccount, byte[]
413392
MetricSerializer.SerializeString(buffer, ref bufferIndex, monitoringAccount);
414393
}
415394

416-
#if EXPOSE_EXPERIMENTAL_FEATURES
417395
[MethodImpl(MethodImplOptions.AggressiveInlining)]
418396
private static void SerializeExemplars(in ReadOnlyExemplarCollection exemplars, MetricType metricType, byte[] buffer, ref int bufferIndex)
419397
{
@@ -516,7 +494,6 @@ private static void SerializeSingleExemplar(Exemplar exemplar, MetricType metric
516494
var exemplarLength = bufferIndex - bufferIndexForLength + 1;
517495
MetricSerializer.SerializeByte(buffer, ref bufferIndexForLength, (byte)exemplarLength);
518496
}
519-
#endif
520497

521498
[MethodImpl(MethodImplOptions.AggressiveInlining)]
522499
private static void SerializeNonHistogramMetricData(MetricEventType eventType, MetricData value, long timestamp, byte[] buffer, ref int bufferIndex)

test/OpenTelemetry.Exporter.Geneva.Benchmarks/Exporter/MetricExporterBenchmarks.cs

Lines changed: 1 addition & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -574,39 +574,32 @@ public void InstrumentWithWithGenevaCounterMetricExporter4Dimensions()
574574
[Benchmark]
575575
public void SerializeCounterMetricItemWith3Dimensions()
576576
{
577-
#if EXPOSE_EXPERIMENTAL_FEATURES
578577
this.counterMetricPointWith3Dimensions.TryGetExemplars(out var exemplars);
579-
#endif
578+
580579
this.tlvMetricsExporter.SerializeMetricWithTLV(
581580
MetricEventType.ULongMetric,
582581
this.counterMetricWith3Dimensions.Name,
583582
this.counterMetricPointWith3Dimensions.EndTime.ToFileTime(),
584583
this.counterMetricPointWith3Dimensions.Tags,
585584
this.counterMetricDataWith3Dimensions,
586-
#if EXPOSE_EXPERIMENTAL_FEATURES
587585
MetricType.LongSum,
588586
exemplars,
589-
#endif
590587
out _,
591588
out _);
592589
}
593590

594591
[Benchmark]
595592
public void SerializeCounterMetricItemWith4Dimensions()
596593
{
597-
#if EXPOSE_EXPERIMENTAL_FEATURES
598594
this.counterMetricPointWith4Dimensions.TryGetExemplars(out var exemplars);
599-
#endif
600595
this.tlvMetricsExporter.SerializeMetricWithTLV(
601596
MetricEventType.ULongMetric,
602597
this.counterMetricWith4Dimensions.Name,
603598
this.counterMetricPointWith4Dimensions.EndTime.ToFileTime(),
604599
this.counterMetricPointWith4Dimensions.Tags,
605600
this.counterMetricDataWith4Dimensions,
606-
#if EXPOSE_EXPERIMENTAL_FEATURES
607601
MetricType.LongSum,
608602
exemplars,
609-
#endif
610603
out _,
611604
out _);
612605
}
@@ -626,9 +619,7 @@ public void ExportCounterMetricItemWith4Dimensions()
626619
[Benchmark]
627620
public void SerializeHistogramMetricItemWith3Dimensions()
628621
{
629-
#if EXPOSE_EXPERIMENTAL_FEATURES
630622
this.histogramMetricPointWith3Dimensions.TryGetExemplars(out var exemplars);
631-
#endif
632623
this.tlvMetricsExporter.SerializeHistogramMetricWithTLV(
633624
this.histogramMetricWith3Dimensions.Name,
634625
this.histogramMetricPointWith3Dimensions.EndTime.ToFileTime(),
@@ -638,20 +629,16 @@ public void SerializeHistogramMetricItemWith3Dimensions()
638629
this.histogramCountWith3Dimensions,
639630
this.histogramMinWith3Dimensions,
640631
this.histogramMaxWith3Dimensions,
641-
#if EXPOSE_EXPERIMENTAL_FEATURES
642632
MetricType.Histogram,
643633
exemplars,
644-
#endif
645634
out _,
646635
out _);
647636
}
648637

649638
[Benchmark]
650639
public void SerializeHistogramMetricItemWith4Dimensions()
651640
{
652-
#if EXPOSE_EXPERIMENTAL_FEATURES
653641
this.histogramMetricPointWith4Dimensions.TryGetExemplars(out var exemplars);
654-
#endif
655642
this.tlvMetricsExporter.SerializeHistogramMetricWithTLV(
656643
this.histogramMetricWith4Dimensions.Name,
657644
this.histogramMetricPointWith4Dimensions.EndTime.ToFileTime(),
@@ -661,10 +648,8 @@ public void SerializeHistogramMetricItemWith4Dimensions()
661648
this.histogramCountWith4Dimensions,
662649
this.histogramMinWith4Dimensions,
663650
this.histogramMaxWith4Dimensions,
664-
#if EXPOSE_EXPERIMENTAL_FEATURES
665651
MetricType.Histogram,
666652
exemplars,
667-
#endif
668653
out _,
669654
out _);
670655
}

0 commit comments

Comments
 (0)