From d4b40a8ab74a63b1de5ab4d663d23f0f1870d263 Mon Sep 17 00:00:00 2001 From: Reiley Yang Date: Wed, 23 Nov 2022 16:45:14 -0800 Subject: [PATCH 1/2] Handle DateTimeOffset in the same way as DateTime --- .../MsgPackExporter/MessagePackSerializer.cs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/OpenTelemetry.Exporter.Geneva/MsgPackExporter/MessagePackSerializer.cs b/src/OpenTelemetry.Exporter.Geneva/MsgPackExporter/MessagePackSerializer.cs index f92f79d0db..2d62ebede4 100644 --- a/src/OpenTelemetry.Exporter.Geneva/MsgPackExporter/MessagePackSerializer.cs +++ b/src/OpenTelemetry.Exporter.Geneva/MsgPackExporter/MessagePackSerializer.cs @@ -563,6 +563,8 @@ public static int Serialize(byte[] buffer, int cursor, object obj) return SerializeArray(buffer, cursor, v); case DateTime v: return SerializeUtcDateTime(buffer, cursor, v.ToUniversalTime()); + case DateTimeOffset v: + return SerializeUtcDateTime(buffer, cursor, v.UtcDateTime); default: string repr = null; From 052631dfb0a4c29c88710330f9e98151a2a459e1 Mon Sep 17 00:00:00 2001 From: Reiley Yang Date: Wed, 23 Nov 2022 16:52:23 -0800 Subject: [PATCH 2/2] changelog --- src/OpenTelemetry.Exporter.Geneva/CHANGELOG.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/OpenTelemetry.Exporter.Geneva/CHANGELOG.md b/src/OpenTelemetry.Exporter.Geneva/CHANGELOG.md index d8e8550d00..38a813d5e3 100644 --- a/src/OpenTelemetry.Exporter.Geneva/CHANGELOG.md +++ b/src/OpenTelemetry.Exporter.Geneva/CHANGELOG.md @@ -2,6 +2,10 @@ ## Unreleased +* Added support for + [DateTimeOffset](https://learn.microsoft.com/dotnet/api/system.datetimeoffset). + ([#797](https://github.com/open-telemetry/opentelemetry-dotnet-contrib/pull/797)) + ## 1.4.0-beta.5 Released 2022-Nov-21