-
Notifications
You must be signed in to change notification settings - Fork 858
Add tests for Prometheus metrics endpoint and validation #4185
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
Conversation
… metrics setup - Added tests for Prometheus exporter registration and metrics endpoint exposure - Verified all expected metrics are served via /metrics endpoint - Included Stackdriver-only setup test to ensure no panics
Build Succeeded 🥳 Build Id: 9386d087-612a-404f-8994-fcf316d51dda The following development artifacts have been built, and will exist for the next 30 days:
A preview of the website (the last 30 builds are retained): To install this version:
|
Build Succeeded 🥳 Build Id: 23068501-53f6-4639-b3c6-97f7f58947be The following development artifacts have been built, and will exist for the next 30 days:
A preview of the website (the last 30 builds are retained): To install this version:
|
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.
Looks like this test isn't including the agones_gameserver_allocations_duration_seconds
or agones_gameserver_allocations_retry_total
. @vicentefb could you confirm which metrics are expected at the allocator endpoint?
Try adding some debug statements (or just use your debugger) to see what metrics the test is testing for:
metricsSet := collectMetricNames(resp)
fmt.Println("GOT", metricsSet)
expectedMetrics := getMetricNames()
fmt.Println("EXPECTED", expectedMetrics)
// Force test to fail so that the above fmt.Println actually prints.
assert.True(t, false)
|
||
} | ||
|
||
func TestSetupMetrics_StackdriverOnly_NoPanic(t *testing.T) { |
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.
Stackdriver has been deprecated in favor of Google Cloud Monitoring.
As part of a separate issue we should investigate if these configs are still working as intended, or if they need to be updated.
Yeah, those two metrics are also expected at the allocator endpoint as well as metrics listed here: https://agones.dev/site/docs/guides/metrics/ |
@@ -117,3 +135,131 @@ func TestSetResponse(t *testing.T) { | |||
}) | |||
} | |||
} | |||
|
|||
func TestAllocationMetrics(t *testing.T) { |
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.
@igooch @vicentefb I’ve added a separate test case for these metrics: agones_gameserver_allocations_duration_seconds, agones_gameserver_allocations_retry_total, and agones_gameserver_creation_duration. This should fix the issue with missing metrics in the tests. PR is now ready for review.
Build Succeeded 🥳 Build Id: 39b31441-5c49-41f8-9952-7da7117eefa8 The following development artifacts have been built, and will exist for the next 30 days:
A preview of the website (the last 30 builds are retained): To install this version:
|
Build Failed 😭 Build Id: 1034ca0f-312c-4550-8da4-0c52d51d32c0 Status: FAILURE To get permission to view the Cloud Build view, join the agones-discuss Google Group. |
/gcbrun |
Build Succeeded 🥳 Build Id: bce52699-46ed-4e2f-825c-d93dc931153f The following development artifacts have been built, and will exist for the next 30 days:
A preview of the website (the last 30 builds are retained): To install this version:
|
Build Succeeded 🥳 Build Id: 135458f3-06d2-482b-b080-45996e261032 The following development artifacts have been built, and will exist for the next 30 days:
A preview of the website (the last 30 builds are retained): To install this version:
|
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.
lgtm
What type of PR is this?
/kind cleanup
What this PR does / Why we need it:
Which issue(s) this PR fixes:
Closes #3925
Special notes for your reviewer: