-
Notifications
You must be signed in to change notification settings - Fork 268
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
Fix prometheus port (#1078) and add unit test for opentelemetry (#1088) #1093
Conversation
… for opentelemetry (aws#1088)
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.
Overall lgtm! Just some small comments
conn, err = net.DialTimeout("tcp", fmt.Sprintf("localhost:%d", mockClosedPort), time.Second) | ||
if err == nil { | ||
conn.Close() | ||
t.Errorf("server should not listening on port %d: %v", mockClosedPort, err) |
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.
Nit: be
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.
Fixed.
metrics.NodeActionsInc(mockAction, mockNodeName2, mockEventID2, nil) | ||
metrics.NodeActionsInc(mockAction, mockNodeName3, mockEventID3, errors.New("mockError")) | ||
|
||
rr := mockMetricsRequest() |
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.
What does rr mean? Could we rename to something more specific?
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.
I assume request response?
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.
Fixed by renaming to responseRecorder.
|
||
metrics := getMetrics(t) | ||
|
||
errorEventLables := []attribute.KeyValue{labelEventErrorWhereKey.String(mockErrorEvent)} |
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.
Typo: errorEventLabels. Same for other areas
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.
Fixed.
h.Equals(t, http.StatusOK, status) | ||
} | ||
|
||
func getMetricsMap(body string) map[string]string { |
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.
Could you add a comment here indicating an example of what the body might look like? Is there only a specific format it accepts? Just so it's easier to understand what this does?
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.
Fixed by adding doc comment for example response body.
Fix prometheus port (#1078) and add unit test for opentelemetry (#1088)
**Issue #, if available:
#1078
#1088
Description of changes:
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.