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

remove apiserver_admission_step_admission_duration_seconds_summary me… #107

Conversation

chadpatel
Copy link

Description:
The apiserver_admission_step_admission_duration_seconds_summary was getting included in our regex. We only intended to publish The apiserver_admission_step_admission_duration_seconds, which is made up of prometheus (submetrics? idk what to call them), The apiserver_admission_step_admission_duration_seconds_[count/sum/bucket], because this is a prometheus histogram. We need to allow list the component bits but exclude the summary metric itself

I also decided to prefix our regex with a carrot as a performance optimization. it is unnecessary for the entire metric name to be scanned to determine if it matches, with the carrot it will be able to determine just from the first couple characters if it is a match or not.

An alternative implementation would be to replace all the ".*"s, which are super convenient, with very explicit matchers for the histogram. Something like this:

	controlPlaneMetricAllowList = []string{
		"apiserver_admission_controller_admission_duration_seconds_(bucket|sum|count)$",
		// we want to exclude the separate metric apiserver_admission_step_admission_duration_seconds_summary
		"^apiserver_admission_step_admission_duration_seconds_(bucket|sum|count)$",
		"^apiserver_admission_webhook_admission_duration_seconds_(bucket|sum|count)$",
		"^apiserver_current_inflight_requests",
		"^apiserver_current_inqueue_requests",
		"^apiserver_flowcontrol_rejected_requests_total",
		"^apiserver_flowcontrol_request_concurrency_limit",
		"^apiserver_longrunning_requests",
		"^apiserver_request_duration_seconds_(bucket|sum|count)$",
		"^apiserver_request_total",
		"^apiserver_requested_deprecated_apis",
		"^apiserver_storage_list_duration_seconds_(bucket|sum|count)$",
		"^apiserver_storage_objects",
		"^apiserver_storage_db_total_size_in_bytes_(bucket|sum|count)$",
		"^apiserver_storage_size_bytes_(bucket|sum|count)$",
		"^etcd_db_total_size_in_bytes_(bucket|sum|count)$",
		"^etcd_request_duration_seconds_(bucket|sum|count)$",
		"^rest_client_request_duration_seconds_(bucket|sum|count)$",
		"^rest_client_requests_total",
	}

LMK what you think about that

Link to tracking Issue:

Testing: Tested on my cluster
control plane metrics are still flowing:
Screenshot 2023-10-04 at 5 17 40 PM

no summary metric:
Screenshot 2023-10-04 at 5 17 47 PM

but the non-summary one is still flowing
Screenshot 2023-10-04 at 5 18 16 PM

Documentation: N/A, the removed metric was unintended so it was never documented as a supported metric

SaxyPandaBear
SaxyPandaBear previously approved these changes Oct 5, 2023
Copy link

@SaxyPandaBear SaxyPandaBear left a comment

Choose a reason for hiding this comment

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

LGTM

mitali-salvi
mitali-salvi previously approved these changes Oct 5, 2023
@chadpatel chadpatel merged commit 4b74f35 into amazon-contributing:aws-cwa-dev Oct 5, 2023
86 of 87 checks passed
lisguo pushed a commit to lisguo/opentelemetry-collector-contrib that referenced this pull request Oct 20, 2023
amazon-contributing#107)

* remove apiserver_admission_step_admission_duration_seconds_summary metric

* make regex allow list very specific
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.

4 participants