Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Log dropped metric count when exporting from PRW exporter #3323

Closed
wants to merge 1 commit into from
Closed

Conversation

rakyll
Copy link
Contributor

@rakyll rakyll commented May 26, 2021

@rakyll rakyll requested a review from a team May 26, 2021 22:07
Copy link
Member

@mxiamxia mxiamxia left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@rakyll rakyll requested a review from alolita as a code owner May 27, 2021 17:22
@@ -158,7 +161,8 @@ func (prwe *PRWExporter) PushMetrics(ctx context.Context, md pdata.Metrics) erro
errs = append(errs, exportErrors...)
}

if dropped != 0 {
if dropped > 0 {
prwe.logger.Info("Prometheus remote write dropped metrics", zap.Int("dropped_count", dropped))
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This can potentially flood the logs. We shouldn't be doing this. See https://github.com/open-telemetry/opentelemetry-collector/blob/main/CONTRIBUTING.md#logging

I believe all exporters record dropped metrics, which presumably is sufficient for observing the Collector. If we need a different way observe dropped data we need to explain why and we would prefer it to be uniform for all exporters, not special just for Prometheus.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The metrics would work in this case. I opened the PR due to my lack of awareness of the builtin metrics. I'll close this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Debug log how many samples are written or dropped in the Prometheus RW exporter
4 participants