From 3968c9e94db4476f17ca747f72f8513da72eb942 Mon Sep 17 00:00:00 2001 From: Keerthi Motupalli Date: Wed, 30 Mar 2022 08:16:43 -0700 Subject: [PATCH] Add debug flag to print metrics payload and sketches payload (#8929) * added debug flag to print metrics payload * add debug flag to print sketches payload * added a changelog entry Co-authored-by: Alex Boten --- CHANGELOG.md | 1 + exporter/datadogexporter/metrics_exporter.go | 2 ++ 2 files changed, 3 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index acc6e0e0a9ae..a2a542678ad7 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -8,6 +8,7 @@ - `k8seventsreceiver`: Add Api_version and resource_version (#8539) - `dynatraceexporter`: add multi-instance deployment note to README.md (#8848) - `resourcedetectionprocessor`: Add attribute allowlist (#8547) +- `datadogexporter`: Metrics payload data and Sketches payload data will be logged if collector is started in debug mode (#8929) ### 🛑 Breaking changes 🛑 diff --git a/exporter/datadogexporter/metrics_exporter.go b/exporter/datadogexporter/metrics_exporter.go index 3a19f4a6f5d4..3f5b33f0683e 100644 --- a/exporter/datadogexporter/metrics_exporter.go +++ b/exporter/datadogexporter/metrics_exporter.go @@ -186,6 +186,7 @@ func (exp *metricsExporter) PushMetricsData(ctx context.Context, md pdata.Metric err = nil if len(ms) > 0 { + exp.params.Logger.Debug("exporting payload", zap.Any("metric", ms)) err = multierr.Append( err, exp.retrier.DoWithRetries(ctx, func(context.Context) error { @@ -195,6 +196,7 @@ func (exp *metricsExporter) PushMetricsData(ctx context.Context, md pdata.Metric } if len(sl) > 0 { + exp.params.Logger.Debug("exporting sketches payload", zap.Any("sketches", sl)) err = multierr.Append( err, exp.retrier.DoWithRetries(ctx, func(ctx context.Context) error {