-
Notifications
You must be signed in to change notification settings - Fork 233
fix(debug): log information for debugging purposes #2501
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -64,9 +64,13 @@ func (m *OperationMetrics) Finish(reqContext *requestContext, statusCode int, re | |
| attrs = append(attrs, rotel.WgRequestError.Bool(true)) | ||
| attrOpt := otelmetric.WithAttributeSet(attribute.NewSet(attrs...)) | ||
|
|
||
| m.logger.Info("logging metrics with attributes 1", zap.Any("attributes", attrs)) | ||
|
|
||
| rm.MeasureRequestCount(ctx, sliceAttrs, attrOpt) | ||
| rm.MeasureLatency(ctx, latency, sliceAttrs, attrOpt) | ||
| } else { | ||
| m.logger.Info("logging metrics with attributes 2", zap.Any("attributes", attrs)) | ||
|
|
||
| rm.MeasureRequestCount(ctx, sliceAttrs, o) | ||
| rm.MeasureLatency(ctx, latency, sliceAttrs, o) | ||
| } | ||
|
Comment on lines
+67
to
76
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. These appear to be debug/development logs that should be removed or improved. The log messages "logging metrics with attributes 1" and "logging metrics with attributes 2" are vague and use numeric identifiers typical of temporary debugging. If these logs are intended for production:
If these are debugging artifacts, please remove them before merging. 🤖 Prompt for AI Agents |
||
|
|
@@ -104,14 +108,19 @@ type OperationMetricsOptions struct { | |
| func newOperationMetrics(opts OperationMetricsOptions) *OperationMetrics { | ||
| operationStartTime := time.Now() | ||
|
|
||
| logger := opts.Logger | ||
| if logger == nil { | ||
| logger = zap.NewNop() | ||
| } | ||
|
|
||
| inflightMetric := opts.RouterMetrics.MetricStore().MeasureInFlight(context.Background(), opts.SliceAttributes, opts.InFlightAddOption) | ||
| return &OperationMetrics{ | ||
| requestContentLength: opts.RequestContentLength, | ||
| operationStartTime: operationStartTime, | ||
| inflightMetric: inflightMetric, | ||
| routerConfigVersion: opts.RouterConfigVersion, | ||
| routerMetrics: opts.RouterMetrics, | ||
| logger: opts.Logger, | ||
| logger: logger, | ||
| trackUsageInfo: opts.TrackUsageInfo, | ||
| prometheusTrackUsageInfo: opts.PrometheusTrackUsageInfo, | ||
| } | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same issue: These appear to be debug logs that should be removed or improved.
Similar to the logs in
operation_metrics.go, the messages "logging metrics with attributes a" and "logging metrics with attributes b" are vague and use letter identifiers typical of temporary debugging.The inconsistent naming convention across files (numbers "1", "2" in
operation_metrics.govs letters "a", "b" here) further suggests these are ad-hoc debugging statements rather than intentional production logging.Please either:
🤖 Prompt for AI Agents