diff --git a/app/kuma-dp/pkg/dataplane/metrics/metrics_format_mapper.go b/app/kuma-dp/pkg/dataplane/metrics/metrics_format_mapper.go index ccb86927b9de..4cc67b99e198 100644 --- a/app/kuma-dp/pkg/dataplane/metrics/metrics_format_mapper.go +++ b/app/kuma-dp/pkg/dataplane/metrics/metrics_format_mapper.go @@ -2,6 +2,7 @@ package metrics import ( "math" + "time" io_prometheus_client "github.com/prometheus/client_model/go" "go.opentelemetry.io/otel/attribute" @@ -10,7 +11,7 @@ import ( "github.com/kumahq/kuma/pkg/util/pointer" ) -func FromPrometheusMetrics(appMetrics map[string]*io_prometheus_client.MetricFamily, mesh string, dataplane string, service string, extraLabels map[string]string) []metricdata.Metrics { +func FromPrometheusMetrics(appMetrics map[string]*io_prometheus_client.MetricFamily, mesh string, dataplane string, service string, extraLabels map[string]string, requestTime time.Time) []metricdata.Metrics { extraAttributes := extraAttributesFrom(mesh, dataplane, service, extraLabels) var openTelemetryMetrics []metricdata.Metrics @@ -23,22 +24,22 @@ func FromPrometheusMetrics(appMetrics map[string]*io_prometheus_client.MetricFam switch prometheusMetric.GetType() { case io_prometheus_client.MetricType_GAUGE: otelMetric.Data = metricdata.Gauge[float64]{ - DataPoints: gaugeDataPoints(prometheusMetric.Metric, extraAttributes), + DataPoints: gaugeDataPoints(prometheusMetric.Metric, extraAttributes, requestTime), } case io_prometheus_client.MetricType_SUMMARY: otelMetric.Data = metricdata.Summary{ - DataPoints: summaryDataPoints(prometheusMetric.Metric, extraAttributes), + DataPoints: summaryDataPoints(prometheusMetric.Metric, extraAttributes, requestTime), } case io_prometheus_client.MetricType_COUNTER: otelMetric.Data = metricdata.Sum[float64]{ IsMonotonic: true, Temporality: metricdata.CumulativeTemporality, - DataPoints: counterDataPoints(prometheusMetric.Metric, extraAttributes), + DataPoints: counterDataPoints(prometheusMetric.Metric, extraAttributes, requestTime), } case io_prometheus_client.MetricType_HISTOGRAM: otelMetric.Data = metricdata.Histogram[float64]{ Temporality: metricdata.CumulativeTemporality, - DataPoints: histogramDataPoints(prometheusMetric.Metric, extraAttributes), + DataPoints: histogramDataPoints(prometheusMetric.Metric, extraAttributes, requestTime), } default: log.Info("got unsupported metric type", "type", prometheusMetric.Type) @@ -49,24 +50,26 @@ func FromPrometheusMetrics(appMetrics map[string]*io_prometheus_client.MetricFam return openTelemetryMetrics } -func gaugeDataPoints(prometheusData []*io_prometheus_client.Metric, extraAttributes []attribute.KeyValue) []metricdata.DataPoint[float64] { +func gaugeDataPoints(prometheusData []*io_prometheus_client.Metric, extraAttributes []attribute.KeyValue, requestTime time.Time) []metricdata.DataPoint[float64] { var dataPoints []metricdata.DataPoint[float64] for _, metric := range prometheusData { attributes := createOpenTelemetryAttributes(metric.Label, extraAttributes) dataPoints = append(dataPoints, metricdata.DataPoint[float64]{ Attributes: attributes, + Time: getTimeOrFallback(metric.TimestampMs, requestTime), Value: metric.Gauge.GetValue(), }) } return dataPoints } -func summaryDataPoints(prometheusData []*io_prometheus_client.Metric, extraAttributes []attribute.KeyValue) []metricdata.SummaryDataPoint { +func summaryDataPoints(prometheusData []*io_prometheus_client.Metric, extraAttributes []attribute.KeyValue, requestTime time.Time) []metricdata.SummaryDataPoint { var dataPoints []metricdata.SummaryDataPoint for _, metric := range prometheusData { attributes := createOpenTelemetryAttributes(metric.Label, extraAttributes) dataPoints = append(dataPoints, metricdata.SummaryDataPoint{ Attributes: attributes, + Time: getTimeOrFallback(metric.TimestampMs, requestTime), QuantileValues: toOpenTelemetryQuantile(metric.Summary.Quantile), Sum: pointer.Deref(metric.Summary.SampleSum), Count: pointer.Deref(metric.Summary.SampleCount), @@ -75,19 +78,20 @@ func summaryDataPoints(prometheusData []*io_prometheus_client.Metric, extraAttri return dataPoints } -func counterDataPoints(prometheusData []*io_prometheus_client.Metric, extraAttributes []attribute.KeyValue) []metricdata.DataPoint[float64] { +func counterDataPoints(prometheusData []*io_prometheus_client.Metric, extraAttributes []attribute.KeyValue, requestTime time.Time) []metricdata.DataPoint[float64] { var dataPoints []metricdata.DataPoint[float64] for _, metric := range prometheusData { attributes := createOpenTelemetryAttributes(metric.Label, extraAttributes) dataPoints = append(dataPoints, metricdata.DataPoint[float64]{ Attributes: attributes, + Time: getTimeOrFallback(metric.TimestampMs, requestTime), Value: metric.Counter.GetValue(), }) } return dataPoints } -func histogramDataPoints(prometheusData []*io_prometheus_client.Metric, extraAttributes []attribute.KeyValue) []metricdata.HistogramDataPoint[float64] { +func histogramDataPoints(prometheusData []*io_prometheus_client.Metric, extraAttributes []attribute.KeyValue, requestTime time.Time) []metricdata.HistogramDataPoint[float64] { var dataPoints []metricdata.HistogramDataPoint[float64] for _, metric := range prometheusData { attributes := createOpenTelemetryAttributes(metric.Label, extraAttributes) @@ -102,6 +106,7 @@ func histogramDataPoints(prometheusData []*io_prometheus_client.Metric, extraAtt } dataPoints = append(dataPoints, metricdata.HistogramDataPoint[float64]{ + Time: getTimeOrFallback(metric.TimestampMs, requestTime), Attributes: attributes, Count: metric.Histogram.GetSampleCount(), Sum: metric.Histogram.GetSampleSum(), @@ -112,6 +117,14 @@ func histogramDataPoints(prometheusData []*io_prometheus_client.Metric, extraAtt return dataPoints } +func getTimeOrFallback(timestampMs *int64, fallback time.Time) time.Time { + if timestampMs != nil { + return time.UnixMilli(*timestampMs).UTC() + } else { + return fallback + } +} + func createOpenTelemetryAttributes(labels []*io_prometheus_client.LabelPair, extraAttributes []attribute.KeyValue) attribute.Set { var attributes []attribute.KeyValue for _, label := range labels { diff --git a/app/kuma-dp/pkg/dataplane/metrics/metrics_format_mapper_test.go b/app/kuma-dp/pkg/dataplane/metrics/metrics_format_mapper_test.go index 3e4b0b6c8539..3e000de0daea 100644 --- a/app/kuma-dp/pkg/dataplane/metrics/metrics_format_mapper_test.go +++ b/app/kuma-dp/pkg/dataplane/metrics/metrics_format_mapper_test.go @@ -5,6 +5,7 @@ import ( "os" "path" "sort" + "time" . "github.com/onsi/ginkgo/v2" . "github.com/onsi/gomega" @@ -23,7 +24,7 @@ var _ = Describe("Metrics format mapper", func() { // when metrics, err := AggregatedOtelMutator()(input) Expect(err).ToNot(HaveOccurred()) - openTelemetryMetrics := FromPrometheusMetrics(metrics, "default", "dpp-1", "test-service", map[string]string{"extraLabel": "test"}) + openTelemetryMetrics := FromPrometheusMetrics(metrics, "default", "dpp-1", "test-service", map[string]string{"extraLabel": "test"}, time.Date(2024, 1, 1, 1, 1, 1, 1, time.UTC)) // then sort.SliceStable(openTelemetryMetrics, func(i, j int) bool { diff --git a/app/kuma-dp/pkg/dataplane/metrics/metrics_producer.go b/app/kuma-dp/pkg/dataplane/metrics/metrics_producer.go index 825ab5e0a180..c028bd6f24f0 100644 --- a/app/kuma-dp/pkg/dataplane/metrics/metrics_producer.go +++ b/app/kuma-dp/pkg/dataplane/metrics/metrics_producer.go @@ -5,6 +5,7 @@ import ( "net/http" "net/url" "sync" + "time" "go.opentelemetry.io/otel/sdk/instrumentation" sdkmetric "go.opentelemetry.io/otel/sdk/metric" @@ -100,6 +101,7 @@ func (ap *AggregatedProducer) fetchStats(ctx context.Context, app ApplicationToS return nil } defer resp.Body.Close() + requestTime := time.Now().UTC() metricsFromApplication, err := app.MeshMetricMutator(resp.Body) if err != nil { @@ -110,7 +112,7 @@ func (ap *AggregatedProducer) fetchStats(ctx context.Context, app ApplicationToS Scope: instrumentation.Scope{ Name: app.Name, }, - Metrics: FromPrometheusMetrics(metricsFromApplication, ap.mesh, ap.dataplane, ap.service, app.ExtraLabels), + Metrics: FromPrometheusMetrics(metricsFromApplication, ap.mesh, ap.dataplane, ap.service, app.ExtraLabels, requestTime), } } diff --git a/app/kuma-dp/pkg/dataplane/metrics/testdata/otel/counter.golden.json b/app/kuma-dp/pkg/dataplane/metrics/testdata/otel/counter.golden.json index 9bd65b57b214..09429f0b310e 100644 --- a/app/kuma-dp/pkg/dataplane/metrics/testdata/otel/counter.golden.json +++ b/app/kuma-dp/pkg/dataplane/metrics/testdata/otel/counter.golden.json @@ -44,7 +44,7 @@ } ], "StartTime": "0001-01-01T00:00:00Z", - "Time": "0001-01-01T00:00:00Z", + "Time": "2014-03-17T14:26:03Z", "Value": 11 }, { @@ -86,7 +86,7 @@ } ], "StartTime": "0001-01-01T00:00:00Z", - "Time": "0001-01-01T00:00:00Z", + "Time": "2024-01-01T01:01:01.000000001Z", "Value": 12 }, { @@ -128,7 +128,7 @@ } ], "StartTime": "0001-01-01T00:00:00Z", - "Time": "0001-01-01T00:00:00Z", + "Time": "2024-01-01T01:01:01.000000001Z", "Value": 13 }, { @@ -170,7 +170,7 @@ } ], "StartTime": "0001-01-01T00:00:00Z", - "Time": "0001-01-01T00:00:00Z", + "Time": "2024-01-01T01:01:01.000000001Z", "Value": 101 }, { @@ -212,7 +212,7 @@ } ], "StartTime": "0001-01-01T00:00:00Z", - "Time": "0001-01-01T00:00:00Z", + "Time": "2024-01-01T01:01:01.000000001Z", "Value": 102 }, { @@ -254,7 +254,7 @@ } ], "StartTime": "0001-01-01T00:00:00Z", - "Time": "0001-01-01T00:00:00Z", + "Time": "2024-01-01T01:01:01.000000001Z", "Value": 103 }, { @@ -296,7 +296,7 @@ } ], "StartTime": "0001-01-01T00:00:00Z", - "Time": "0001-01-01T00:00:00Z", + "Time": "2024-01-01T01:01:01.000000001Z", "Value": 14 }, { @@ -338,7 +338,7 @@ } ], "StartTime": "0001-01-01T00:00:00Z", - "Time": "0001-01-01T00:00:00Z", + "Time": "2024-01-01T01:01:01.000000001Z", "Value": 15 }, { @@ -380,7 +380,7 @@ } ], "StartTime": "0001-01-01T00:00:00Z", - "Time": "0001-01-01T00:00:00Z", + "Time": "2024-01-01T01:01:01.000000001Z", "Value": 16 }, { @@ -422,7 +422,7 @@ } ], "StartTime": "0001-01-01T00:00:00Z", - "Time": "0001-01-01T00:00:00Z", + "Time": "2024-01-01T01:01:01.000000001Z", "Value": 17 }, { @@ -464,7 +464,7 @@ } ], "StartTime": "0001-01-01T00:00:00Z", - "Time": "0001-01-01T00:00:00Z", + "Time": "2024-01-01T01:01:01.000000001Z", "Value": 18 }, { @@ -506,7 +506,7 @@ } ], "StartTime": "0001-01-01T00:00:00Z", - "Time": "0001-01-01T00:00:00Z", + "Time": "2024-01-01T01:01:01.000000001Z", "Value": 19 } ], @@ -559,7 +559,7 @@ } ], "StartTime": "0001-01-01T00:00:00Z", - "Time": "0001-01-01T00:00:00Z", + "Time": "2024-01-01T01:01:01.000000001Z", "Value": 1 }, { @@ -601,7 +601,7 @@ } ], "StartTime": "0001-01-01T00:00:00Z", - "Time": "0001-01-01T00:00:00Z", + "Time": "2024-01-01T01:01:01.000000001Z", "Value": 2 }, { @@ -643,7 +643,7 @@ } ], "StartTime": "0001-01-01T00:00:00Z", - "Time": "0001-01-01T00:00:00Z", + "Time": "2024-01-01T01:01:01.000000001Z", "Value": 3 }, { @@ -685,7 +685,7 @@ } ], "StartTime": "0001-01-01T00:00:00Z", - "Time": "0001-01-01T00:00:00Z", + "Time": "2024-01-01T01:01:01.000000001Z", "Value": 201 }, { @@ -727,7 +727,7 @@ } ], "StartTime": "0001-01-01T00:00:00Z", - "Time": "0001-01-01T00:00:00Z", + "Time": "2024-01-01T01:01:01.000000001Z", "Value": 202 }, { @@ -769,7 +769,7 @@ } ], "StartTime": "0001-01-01T00:00:00Z", - "Time": "0001-01-01T00:00:00Z", + "Time": "2024-01-01T01:01:01.000000001Z", "Value": 203 }, { @@ -811,7 +811,7 @@ } ], "StartTime": "0001-01-01T00:00:00Z", - "Time": "0001-01-01T00:00:00Z", + "Time": "2024-01-01T01:01:01.000000001Z", "Value": 4 }, { @@ -853,7 +853,7 @@ } ], "StartTime": "0001-01-01T00:00:00Z", - "Time": "0001-01-01T00:00:00Z", + "Time": "2024-01-01T01:01:01.000000001Z", "Value": 5 }, { @@ -895,7 +895,7 @@ } ], "StartTime": "0001-01-01T00:00:00Z", - "Time": "0001-01-01T00:00:00Z", + "Time": "2024-01-01T01:01:01.000000001Z", "Value": 6 }, { @@ -937,7 +937,7 @@ } ], "StartTime": "0001-01-01T00:00:00Z", - "Time": "0001-01-01T00:00:00Z", + "Time": "2024-01-01T01:01:01.000000001Z", "Value": 7 }, { @@ -979,7 +979,7 @@ } ], "StartTime": "0001-01-01T00:00:00Z", - "Time": "0001-01-01T00:00:00Z", + "Time": "2024-01-01T01:01:01.000000001Z", "Value": 8 }, { @@ -1021,7 +1021,7 @@ } ], "StartTime": "0001-01-01T00:00:00Z", - "Time": "0001-01-01T00:00:00Z", + "Time": "2024-01-01T01:01:01.000000001Z", "Value": 9 } ], @@ -1074,7 +1074,7 @@ } ], "StartTime": "0001-01-01T00:00:00Z", - "Time": "0001-01-01T00:00:00Z", + "Time": "2024-01-01T01:01:01.000000001Z", "Value": 10 } ], diff --git a/app/kuma-dp/pkg/dataplane/metrics/testdata/otel/counter.in b/app/kuma-dp/pkg/dataplane/metrics/testdata/otel/counter.in index 939335b7590a..6db00cfe6a29 100644 --- a/app/kuma-dp/pkg/dataplane/metrics/testdata/otel/counter.in +++ b/app/kuma-dp/pkg/dataplane/metrics/testdata/otel/counter.in @@ -1,5 +1,5 @@ # TYPE envoy_cluster_assignment_stale counter -envoy_cluster_assignment_stale{envoy_cluster_name="access_log_sink"} 11 +envoy_cluster_assignment_stale{envoy_cluster_name="access_log_sink"} 11 1395066363000 envoy_cluster_assignment_stale{envoy_cluster_name="ads_cluster"} 12 envoy_cluster_assignment_stale{envoy_cluster_name="demo-client"} 13 envoy_cluster_assignment_stale{envoy_cluster_name="echo-server_kuma-test_svc_8080-94bcdea309bceaff"} 101 diff --git a/app/kuma-dp/pkg/dataplane/metrics/testdata/otel/gauge.golden.json b/app/kuma-dp/pkg/dataplane/metrics/testdata/otel/gauge.golden.json index 3bfcedc81aaf..dab95d823592 100644 --- a/app/kuma-dp/pkg/dataplane/metrics/testdata/otel/gauge.golden.json +++ b/app/kuma-dp/pkg/dataplane/metrics/testdata/otel/gauge.golden.json @@ -44,7 +44,7 @@ } ], "StartTime": "0001-01-01T00:00:00Z", - "Time": "0001-01-01T00:00:00Z", + "Time": "2024-01-01T01:01:01.000000001Z", "Value": 1 }, { @@ -86,7 +86,7 @@ } ], "StartTime": "0001-01-01T00:00:00Z", - "Time": "0001-01-01T00:00:00Z", + "Time": "2024-01-01T01:01:01.000000001Z", "Value": 2 }, { @@ -128,7 +128,7 @@ } ], "StartTime": "0001-01-01T00:00:00Z", - "Time": "0001-01-01T00:00:00Z", + "Time": "2024-01-01T01:01:01.000000001Z", "Value": 3 }, { @@ -170,7 +170,7 @@ } ], "StartTime": "0001-01-01T00:00:00Z", - "Time": "0001-01-01T00:00:00Z", + "Time": "2024-01-01T01:01:01.000000001Z", "Value": 100 }, { @@ -212,7 +212,7 @@ } ], "StartTime": "0001-01-01T00:00:00Z", - "Time": "0001-01-01T00:00:00Z", + "Time": "2024-01-01T01:01:01.000000001Z", "Value": 110 }, { @@ -254,7 +254,7 @@ } ], "StartTime": "0001-01-01T00:00:00Z", - "Time": "0001-01-01T00:00:00Z", + "Time": "2024-01-01T01:01:01.000000001Z", "Value": 120 }, { @@ -296,7 +296,7 @@ } ], "StartTime": "0001-01-01T00:00:00Z", - "Time": "0001-01-01T00:00:00Z", + "Time": "2024-01-01T01:01:01.000000001Z", "Value": 4 }, { @@ -338,7 +338,7 @@ } ], "StartTime": "0001-01-01T00:00:00Z", - "Time": "0001-01-01T00:00:00Z", + "Time": "2024-01-01T01:01:01.000000001Z", "Value": 5 }, { @@ -380,7 +380,7 @@ } ], "StartTime": "0001-01-01T00:00:00Z", - "Time": "0001-01-01T00:00:00Z", + "Time": "2024-01-01T01:01:01.000000001Z", "Value": 6 }, { @@ -422,7 +422,7 @@ } ], "StartTime": "0001-01-01T00:00:00Z", - "Time": "0001-01-01T00:00:00Z", + "Time": "2024-01-01T01:01:01.000000001Z", "Value": 7 }, { @@ -464,7 +464,7 @@ } ], "StartTime": "0001-01-01T00:00:00Z", - "Time": "0001-01-01T00:00:00Z", + "Time": "2024-01-01T01:01:01.000000001Z", "Value": 8 }, { @@ -506,7 +506,7 @@ } ], "StartTime": "0001-01-01T00:00:00Z", - "Time": "0001-01-01T00:00:00Z", + "Time": "2024-01-01T01:01:01.000000001Z", "Value": 9 } ] @@ -557,7 +557,7 @@ } ], "StartTime": "0001-01-01T00:00:00Z", - "Time": "0001-01-01T00:00:00Z", + "Time": "2024-01-01T01:01:01.000000001Z", "Value": 21 }, { @@ -599,7 +599,7 @@ } ], "StartTime": "0001-01-01T00:00:00Z", - "Time": "0001-01-01T00:00:00Z", + "Time": "2024-01-01T01:01:01.000000001Z", "Value": 22 }, { @@ -641,7 +641,7 @@ } ], "StartTime": "0001-01-01T00:00:00Z", - "Time": "0001-01-01T00:00:00Z", + "Time": "2024-01-01T01:01:01.000000001Z", "Value": 23 }, { @@ -683,7 +683,7 @@ } ], "StartTime": "0001-01-01T00:00:00Z", - "Time": "0001-01-01T00:00:00Z", + "Time": "2024-01-01T01:01:01.000000001Z", "Value": 200 }, { @@ -725,7 +725,7 @@ } ], "StartTime": "0001-01-01T00:00:00Z", - "Time": "0001-01-01T00:00:00Z", + "Time": "2024-01-01T01:01:01.000000001Z", "Value": 210 }, { @@ -767,7 +767,7 @@ } ], "StartTime": "0001-01-01T00:00:00Z", - "Time": "0001-01-01T00:00:00Z", + "Time": "2024-01-01T01:01:01.000000001Z", "Value": 220 }, { @@ -809,7 +809,7 @@ } ], "StartTime": "0001-01-01T00:00:00Z", - "Time": "0001-01-01T00:00:00Z", + "Time": "2024-01-01T01:01:01.000000001Z", "Value": 24 }, { @@ -851,7 +851,7 @@ } ], "StartTime": "0001-01-01T00:00:00Z", - "Time": "0001-01-01T00:00:00Z", + "Time": "2024-01-01T01:01:01.000000001Z", "Value": 25 }, { @@ -893,7 +893,7 @@ } ], "StartTime": "0001-01-01T00:00:00Z", - "Time": "0001-01-01T00:00:00Z", + "Time": "2024-01-01T01:01:01.000000001Z", "Value": 26 }, { @@ -935,7 +935,7 @@ } ], "StartTime": "0001-01-01T00:00:00Z", - "Time": "0001-01-01T00:00:00Z", + "Time": "2024-01-01T01:01:01.000000001Z", "Value": 27 }, { @@ -977,7 +977,7 @@ } ], "StartTime": "0001-01-01T00:00:00Z", - "Time": "0001-01-01T00:00:00Z", + "Time": "2024-01-01T01:01:01.000000001Z", "Value": 28 }, { @@ -1019,7 +1019,7 @@ } ], "StartTime": "0001-01-01T00:00:00Z", - "Time": "0001-01-01T00:00:00Z", + "Time": "2024-01-01T01:01:01.000000001Z", "Value": 29 } ] @@ -1070,7 +1070,7 @@ } ], "StartTime": "0001-01-01T00:00:00Z", - "Time": "0001-01-01T00:00:00Z", + "Time": "2024-01-01T01:01:01.000000001Z", "Value": 31 }, { @@ -1112,7 +1112,7 @@ } ], "StartTime": "0001-01-01T00:00:00Z", - "Time": "0001-01-01T00:00:00Z", + "Time": "2024-01-01T01:01:01.000000001Z", "Value": 32 }, { @@ -1154,7 +1154,7 @@ } ], "StartTime": "0001-01-01T00:00:00Z", - "Time": "0001-01-01T00:00:00Z", + "Time": "2024-01-01T01:01:01.000000001Z", "Value": 33 }, { @@ -1196,7 +1196,7 @@ } ], "StartTime": "0001-01-01T00:00:00Z", - "Time": "0001-01-01T00:00:00Z", + "Time": "2024-01-01T01:01:01.000000001Z", "Value": 300 }, { @@ -1238,7 +1238,7 @@ } ], "StartTime": "0001-01-01T00:00:00Z", - "Time": "0001-01-01T00:00:00Z", + "Time": "2024-01-01T01:01:01.000000001Z", "Value": 310 }, { @@ -1280,7 +1280,7 @@ } ], "StartTime": "0001-01-01T00:00:00Z", - "Time": "0001-01-01T00:00:00Z", + "Time": "2024-01-01T01:01:01.000000001Z", "Value": 320 }, { @@ -1322,7 +1322,7 @@ } ], "StartTime": "0001-01-01T00:00:00Z", - "Time": "0001-01-01T00:00:00Z", + "Time": "2024-01-01T01:01:01.000000001Z", "Value": 34 }, { @@ -1364,7 +1364,7 @@ } ], "StartTime": "0001-01-01T00:00:00Z", - "Time": "0001-01-01T00:00:00Z", + "Time": "2024-01-01T01:01:01.000000001Z", "Value": 35 }, { @@ -1406,7 +1406,7 @@ } ], "StartTime": "0001-01-01T00:00:00Z", - "Time": "0001-01-01T00:00:00Z", + "Time": "2024-01-01T01:01:01.000000001Z", "Value": 36 }, { @@ -1448,7 +1448,7 @@ } ], "StartTime": "0001-01-01T00:00:00Z", - "Time": "0001-01-01T00:00:00Z", + "Time": "2024-01-01T01:01:01.000000001Z", "Value": 37 }, { @@ -1490,7 +1490,7 @@ } ], "StartTime": "0001-01-01T00:00:00Z", - "Time": "0001-01-01T00:00:00Z", + "Time": "2024-01-01T01:01:01.000000001Z", "Value": 38 }, { @@ -1532,7 +1532,7 @@ } ], "StartTime": "0001-01-01T00:00:00Z", - "Time": "0001-01-01T00:00:00Z", + "Time": "2024-01-01T01:01:01.000000001Z", "Value": 39 } ] diff --git a/app/kuma-dp/pkg/dataplane/metrics/testdata/otel/histogram.golden.json b/app/kuma-dp/pkg/dataplane/metrics/testdata/otel/histogram.golden.json index da426c22ba4b..a0cd5fdd9cb5 100644 --- a/app/kuma-dp/pkg/dataplane/metrics/testdata/otel/histogram.golden.json +++ b/app/kuma-dp/pkg/dataplane/metrics/testdata/otel/histogram.golden.json @@ -44,7 +44,7 @@ } ], "StartTime": "0001-01-01T00:00:00Z", - "Time": "0001-01-01T00:00:00Z", + "Time": "2024-01-01T01:01:01.000000001Z", "Count": 0, "Bounds": [ 0.5, @@ -132,7 +132,7 @@ } ], "StartTime": "0001-01-01T00:00:00Z", - "Time": "0001-01-01T00:00:00Z", + "Time": "2024-01-01T01:01:01.000000001Z", "Count": 1, "Bounds": [ 0.5, @@ -220,7 +220,7 @@ } ], "StartTime": "0001-01-01T00:00:00Z", - "Time": "0001-01-01T00:00:00Z", + "Time": "2024-01-01T01:01:01.000000001Z", "Count": 0, "Bounds": [ 0.5, @@ -308,7 +308,7 @@ } ], "StartTime": "0001-01-01T00:00:00Z", - "Time": "0001-01-01T00:00:00Z", + "Time": "2024-01-01T01:01:01.000000001Z", "Count": 4, "Bounds": [ 0.5, @@ -396,7 +396,7 @@ } ], "StartTime": "0001-01-01T00:00:00Z", - "Time": "0001-01-01T00:00:00Z", + "Time": "2024-01-01T01:01:01.000000001Z", "Count": 4, "Bounds": [ 0.5, @@ -484,7 +484,7 @@ } ], "StartTime": "0001-01-01T00:00:00Z", - "Time": "0001-01-01T00:00:00Z", + "Time": "2024-01-01T01:01:01.000000001Z", "Count": 4, "Bounds": [ 0.5, @@ -572,7 +572,7 @@ } ], "StartTime": "0001-01-01T00:00:00Z", - "Time": "0001-01-01T00:00:00Z", + "Time": "2024-01-01T01:01:01.000000001Z", "Count": 0, "Bounds": [ 0.5, @@ -660,7 +660,7 @@ } ], "StartTime": "0001-01-01T00:00:00Z", - "Time": "0001-01-01T00:00:00Z", + "Time": "2024-01-01T01:01:01.000000001Z", "Count": 0, "Bounds": [ 0.5, @@ -748,7 +748,7 @@ } ], "StartTime": "0001-01-01T00:00:00Z", - "Time": "0001-01-01T00:00:00Z", + "Time": "2024-01-01T01:01:01.000000001Z", "Count": 0, "Bounds": [ 0.5, @@ -836,7 +836,7 @@ } ], "StartTime": "0001-01-01T00:00:00Z", - "Time": "0001-01-01T00:00:00Z", + "Time": "2024-01-01T01:01:01.000000001Z", "Count": 0, "Bounds": [ 0.5, @@ -924,7 +924,7 @@ } ], "StartTime": "0001-01-01T00:00:00Z", - "Time": "0001-01-01T00:00:00Z", + "Time": "2024-01-01T01:01:01.000000001Z", "Count": 0, "Bounds": [ 0.5, @@ -1012,7 +1012,7 @@ } ], "StartTime": "0001-01-01T00:00:00Z", - "Time": "0001-01-01T00:00:00Z", + "Time": "2024-01-01T01:01:01.000000001Z", "Count": 0, "Bounds": [ 0.5, diff --git a/app/kuma-dp/pkg/dataplane/metrics/testdata/otel/summary.golden.json b/app/kuma-dp/pkg/dataplane/metrics/testdata/otel/summary.golden.json index d14350d702a8..7f4fd1a6e3f3 100644 --- a/app/kuma-dp/pkg/dataplane/metrics/testdata/otel/summary.golden.json +++ b/app/kuma-dp/pkg/dataplane/metrics/testdata/otel/summary.golden.json @@ -44,7 +44,7 @@ } ], "StartTime": "0001-01-01T00:00:00Z", - "Time": "0001-01-01T00:00:00Z", + "Time": "2024-01-01T01:01:01.000000001Z", "Count": 500, "Sum": 1000, "QuantileValues": [ @@ -101,7 +101,7 @@ } ], "StartTime": "0001-01-01T00:00:00Z", - "Time": "0001-01-01T00:00:00Z", + "Time": "2024-01-01T01:01:01.000000001Z", "Count": 100, "Sum": 600, "QuantileValues": [ @@ -158,7 +158,7 @@ } ], "StartTime": "0001-01-01T00:00:00Z", - "Time": "0001-01-01T00:00:00Z", + "Time": "2024-01-01T01:01:01.000000001Z", "Count": 200, "Sum": 800, "QuantileValues": [