@@ -203,6 +203,7 @@ public enum MetricsAdapter {
203
203
protoExemplar. spanID = TraceProtoUtils . toProtoSpanId ( spanId: spanContext. spanId)
204
204
protoExemplar. traceID = TraceProtoUtils . toProtoTraceId ( traceId: spanContext. traceId)
205
205
}
206
+ protoPoint. exemplars. append ( protoExemplar)
206
207
}
207
208
}
208
209
@@ -225,6 +226,7 @@ public enum MetricsAdapter {
225
226
protoExemplar. spanID = TraceProtoUtils . toProtoSpanId ( spanId: spanContext. spanId)
226
227
protoExemplar. traceID = TraceProtoUtils . toProtoTraceId ( traceId: spanContext. traceId)
227
228
}
229
+ protoPoint. exemplars. append ( protoExemplar)
228
230
}
229
231
}
230
232
@@ -235,19 +237,6 @@ public enum MetricsAdapter {
235
237
pointData. attributes. forEach {
236
238
protoPoint. attributes. append ( CommonAdapter . toProtoAttribute ( key: $0. key, attributeValue: $0. value) )
237
239
}
238
-
239
- pointData. exemplars. forEach {
240
- var protoExemplar = Opentelemetry_Proto_Metrics_V1_Exemplar ( )
241
- protoExemplar. timeUnixNano = $0. epochNanos
242
-
243
- $0. filteredAttributes. forEach {
244
- protoExemplar. filteredAttributes. append ( CommonAdapter . toProtoAttribute ( key: $0. key, attributeValue: $0. value) )
245
- }
246
- if let spanContext = $0. spanContext {
247
- protoExemplar. spanID = TraceProtoUtils . toProtoSpanId ( spanId: spanContext. spanId)
248
- protoExemplar. traceID = TraceProtoUtils . toProtoTraceId ( traceId: spanContext. traceId)
249
- }
250
- }
251
240
}
252
241
253
242
static func injectPointData( protoNumberPoint protoPoint: inout Opentelemetry_Proto_Metrics_V1_NumberDataPoint , pointData: PointData ) {
0 commit comments