Skip to content

Commit

Permalink
Add debug flag to print metrics payload and sketches payload (#8929)
Browse files Browse the repository at this point in the history
* added debug flag to print metrics payload

* add debug flag to print sketches payload

* added a changelog entry

Co-authored-by: Alex Boten <[email protected]>
  • Loading branch information
kmotupalli-tc and Alex Boten authored Mar 30, 2022
1 parent 556fb98 commit 3968c9e
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 0 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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 🛑

Expand Down
2 changes: 2 additions & 0 deletions exporter/datadogexporter/metrics_exporter.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand All @@ -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 {
Expand Down

0 comments on commit 3968c9e

Please sign in to comment.