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

metrics: Add Metrics tags to multiple Scopes #2687

Merged
merged 6 commits into from
Nov 19, 2022

Conversation

albertorm95
Copy link
Contributor

@albertorm95 albertorm95 commented Nov 16, 2022

Follow up from:

Before:

Metrics:
# HELP atlantis_api_getprojectjobs_execution_error atlantis_api_getprojectjobs_execution_error counter
# TYPE atlantis_api_getprojectjobs_execution_error counter
atlantis_api_getprojectjobs_execution_error 1
# HELP atlantis_api_getprojectjobs_execution_time atlantis_api_getprojectjobs_execution_time summary
# TYPE atlantis_api_getprojectjobs_execution_time summary
atlantis_api_getprojectjobs_execution_time{quantile="0.5"} NaN
atlantis_api_getprojectjobs_execution_time{quantile="0.75"} NaN
atlantis_api_getprojectjobs_execution_time{quantile="0.95"} NaN
atlantis_api_getprojectjobs_execution_time{quantile="0.99"} NaN
atlantis_api_getprojectjobs_execution_time{quantile="0.999"} NaN
atlantis_api_getprojectjobs_execution_time_sum 83.875298474
atlantis_api_getprojectjobs_execution_time_count 5
# HELP atlantis_cmd_autoplan_builder_execution_error atlantis_cmd_autoplan_builder_execution_error counter
# TYPE atlantis_cmd_autoplan_builder_execution_error counter
atlantis_cmd_autoplan_builder_execution_error 0
# HELP atlantis_cmd_autoplan_builder_execution_success atlantis_cmd_autoplan_builder_execution_success counter
# TYPE atlantis_cmd_autoplan_builder_execution_success counter
atlantis_cmd_autoplan_builder_execution_success 10
# HELP atlantis_cmd_autoplan_builder_execution_time atlantis_cmd_autoplan_builder_execution_time summary
# TYPE atlantis_cmd_autoplan_builder_execution_time summary
atlantis_cmd_autoplan_builder_execution_time{quantile="0.5"} NaN
atlantis_cmd_autoplan_builder_execution_time{quantile="0.75"} NaN
atlantis_cmd_autoplan_builder_execution_time{quantile="0.95"} NaN
atlantis_cmd_autoplan_builder_execution_time{quantile="0.99"} NaN
atlantis_cmd_autoplan_builder_execution_time{quantile="0.999"} NaN
atlantis_cmd_autoplan_builder_execution_time_sum 59.559332533
atlantis_cmd_autoplan_builder_execution_time_count 10
# HELP atlantis_cmd_autoplan_execution_error atlantis_cmd_autoplan_execution_error counter
# TYPE atlantis_cmd_autoplan_execution_error counter
atlantis_cmd_autoplan_execution_error 0
# HELP atlantis_cmd_autoplan_execution_failure atlantis_cmd_autoplan_execution_failure counter
# TYPE atlantis_cmd_autoplan_execution_failure counter
atlantis_cmd_autoplan_execution_failure 0
# HELP atlantis_cmd_autoplan_execution_success atlantis_cmd_autoplan_execution_success counter
# TYPE atlantis_cmd_autoplan_execution_success counter
atlantis_cmd_autoplan_execution_success 2
# HELP atlantis_cmd_autoplan_execution_time atlantis_cmd_autoplan_execution_time summary
# TYPE atlantis_cmd_autoplan_execution_time summary
atlantis_cmd_autoplan_execution_time{quantile="0.5"} NaN
atlantis_cmd_autoplan_execution_time{quantile="0.75"} NaN
atlantis_cmd_autoplan_execution_time{quantile="0.95"} NaN
atlantis_cmd_autoplan_execution_time{quantile="0.99"} NaN
atlantis_cmd_autoplan_execution_time{quantile="0.999"} NaN
atlantis_cmd_autoplan_execution_time_sum 152.79512225500002
atlantis_cmd_autoplan_execution_time_count 12
# HELP atlantis_cmd_comment_apply_builder_execution_error atlantis_cmd_comment_apply_builder_execution_error counter
# TYPE atlantis_cmd_comment_apply_builder_execution_error counter
atlantis_cmd_comment_apply_builder_execution_error 0
# HELP atlantis_cmd_comment_apply_builder_execution_success atlantis_cmd_comment_apply_builder_execution_success counter
# TYPE atlantis_cmd_comment_apply_builder_execution_success counter
atlantis_cmd_comment_apply_builder_execution_success 3
# HELP atlantis_cmd_comment_apply_builder_execution_time atlantis_cmd_comment_apply_builder_execution_time summary
# TYPE atlantis_cmd_comment_apply_builder_execution_time summary
atlantis_cmd_comment_apply_builder_execution_time{quantile="0.5"} NaN
atlantis_cmd_comment_apply_builder_execution_time{quantile="0.75"} NaN
atlantis_cmd_comment_apply_builder_execution_time{quantile="0.95"} NaN
atlantis_cmd_comment_apply_builder_execution_time{quantile="0.99"} NaN
atlantis_cmd_comment_apply_builder_execution_time{quantile="0.999"} NaN
atlantis_cmd_comment_apply_builder_execution_time_sum 0.16340852600000003
atlantis_cmd_comment_apply_builder_execution_time_count 3
# HELP atlantis_cmd_comment_apply_execution_error atlantis_cmd_comment_apply_execution_error counter
# TYPE atlantis_cmd_comment_apply_execution_error counter
atlantis_cmd_comment_apply_execution_error 1
# HELP atlantis_cmd_comment_apply_execution_failure atlantis_cmd_comment_apply_execution_failure counter

After:

Metrics:
# HELP atlantis_cmd_autoplan_builder_execution_error atlantis_cmd_autoplan_builder_execution_error counter
# TYPE atlantis_cmd_autoplan_builder_execution_error counter
atlantis_cmd_autoplan_builder_execution_error 0
# HELP atlantis_cmd_autoplan_builder_execution_success atlantis_cmd_autoplan_builder_execution_success counter
# TYPE atlantis_cmd_autoplan_builder_execution_success counter
atlantis_cmd_autoplan_builder_execution_success 1
# HELP atlantis_cmd_autoplan_builder_execution_time atlantis_cmd_autoplan_builder_execution_time summary
# TYPE atlantis_cmd_autoplan_builder_execution_time summary
atlantis_cmd_autoplan_builder_execution_time{quantile="0.5"} 1.310477125
atlantis_cmd_autoplan_builder_execution_time{quantile="0.75"} 1.310477125
atlantis_cmd_autoplan_builder_execution_time{quantile="0.95"} 1.310477125
atlantis_cmd_autoplan_builder_execution_time{quantile="0.99"} 1.310477125
atlantis_cmd_autoplan_builder_execution_time{quantile="0.999"} 1.310477125
atlantis_cmd_autoplan_builder_execution_time_sum 1.310477125
atlantis_cmd_autoplan_builder_execution_time_count 1
# HELP atlantis_cmd_autoplan_execution_time atlantis_cmd_autoplan_execution_time summary
# TYPE atlantis_cmd_autoplan_execution_time summary
atlantis_cmd_autoplan_execution_time{quantile="0.5"} 4.827898625
atlantis_cmd_autoplan_execution_time{quantile="0.75"} 4.827898625
atlantis_cmd_autoplan_execution_time{quantile="0.95"} 4.827898625
atlantis_cmd_autoplan_execution_time{quantile="0.99"} 4.827898625
atlantis_cmd_autoplan_execution_time{quantile="0.999"} 4.827898625
atlantis_cmd_autoplan_execution_time_sum 4.827898625
atlantis_cmd_autoplan_execution_time_count 1
# HELP atlantis_cmd_autoplan_project_execution_error atlantis_cmd_autoplan_project_execution_error counter
# TYPE atlantis_cmd_autoplan_project_execution_error counter
atlantis_cmd_autoplan_project_execution_error{base_repo="albertorm95/atlantis-test",pr_number="7",project="atlantis-example-live",project_path="example",terraform_version="1.3.4",workspace="default"} 0
# HELP atlantis_cmd_autoplan_project_execution_failure atlantis_cmd_autoplan_project_execution_failure counter
# TYPE atlantis_cmd_autoplan_project_execution_failure counter
atlantis_cmd_autoplan_project_execution_failure{base_repo="albertorm95/atlantis-test",pr_number="7",project="atlantis-example-live",project_path="example",terraform_version="1.3.4",workspace="default"} 0
# HELP atlantis_cmd_autoplan_project_execution_success atlantis_cmd_autoplan_project_execution_success counter
# TYPE atlantis_cmd_autoplan_project_execution_success counter
atlantis_cmd_autoplan_project_execution_success{base_repo="albertorm95/atlantis-test",pr_number="7",project="atlantis-example-live",project_path="example",terraform_version="1.3.4",workspace="default"} 1
# HELP atlantis_cmd_autoplan_project_execution_time atlantis_cmd_autoplan_project_execution_time summary
# TYPE atlantis_cmd_autoplan_project_execution_time summary
atlantis_cmd_autoplan_project_execution_time{base_repo="albertorm95/atlantis-test",pr_number="7",project="atlantis-example-live",project_path="example",terraform_version="1.3.4",workspace="default",quantile="0.5"} 1.97550125
atlantis_cmd_autoplan_project_execution_time{base_repo="albertorm95/atlantis-test",pr_number="7",project="atlantis-example-live",project_path="example",terraform_version="1.3.4",workspace="default",quantile="0.75"} 1.97550125
atlantis_cmd_autoplan_project_execution_time{base_repo="albertorm95/atlantis-test",pr_number="7",project="atlantis-example-live",project_path="example",terraform_version="1.3.4",workspace="default",quantile="0.95"} 1.97550125
atlantis_cmd_autoplan_project_execution_time{base_repo="albertorm95/atlantis-test",pr_number="7",project="atlantis-example-live",project_path="example",terraform_version="1.3.4",workspace="default",quantile="0.99"} 1.97550125
atlantis_cmd_autoplan_project_execution_time{base_repo="albertorm95/atlantis-test",pr_number="7",project="atlantis-example-live",project_path="example",terraform_version="1.3.4",workspace="default",quantile="0.999"} 1.97550125
atlantis_cmd_autoplan_project_execution_time_sum{base_repo="albertorm95/atlantis-test",pr_number="7",project="atlantis-example-live",project_path="example",terraform_version="1.3.4",workspace="default"} 1.97550125
atlantis_cmd_autoplan_project_execution_time_count{base_repo="albertorm95/atlantis-test",pr_number="7",project="atlantis-example-live",project_path="example",terraform_version="1.3.4",workspace="default"} 1
# HELP atlantis_cmd_comment_plan_builder_execution_error atlantis_cmd_comment_plan_builder_execution_error counter
# TYPE atlantis_cmd_comment_plan_builder_execution_error counter
atlantis_cmd_comment_plan_builder_execution_error 0
# HELP atlantis_cmd_comment_plan_builder_execution_success atlantis_cmd_comment_plan_builder_execution_success counter
# TYPE atlantis_cmd_comment_plan_builder_execution_success counter
atlantis_cmd_comment_plan_builder_execution_success 1
# HELP atlantis_cmd_comment_plan_builder_execution_time atlantis_cmd_comment_plan_builder_execution_time summary
# TYPE atlantis_cmd_comment_plan_builder_execution_time summary
atlantis_cmd_comment_plan_builder_execution_time{quantile="0.5"} 0.200459125
atlantis_cmd_comment_plan_builder_execution_time{quantile="0.75"} 0.200459125
atlantis_cmd_comment_plan_builder_execution_time{quantile="0.95"} 0.200459125
atlantis_cmd_comment_plan_builder_execution_time{quantile="0.99"} 0.200459125
atlantis_cmd_comment_plan_builder_execution_time{quantile="0.999"} 0.200459125
atlantis_cmd_comment_plan_builder_execution_time_sum 0.200459125
atlantis_cmd_comment_plan_builder_execution_time_count 1
# HELP atlantis_cmd_comment_plan_execution_time atlantis_cmd_comment_plan_execution_time summary
# TYPE atlantis_cmd_comment_plan_execution_time summary
atlantis_cmd_comment_plan_execution_time{quantile="0.5"} 4.97979875
atlantis_cmd_comment_plan_execution_time{quantile="0.75"} 4.97979875
atlantis_cmd_comment_plan_execution_time{quantile="0.95"} 4.97979875
atlantis_cmd_comment_plan_execution_time{quantile="0.99"} 4.97979875
atlantis_cmd_comment_plan_execution_time{quantile="0.999"} 4.97979875
atlantis_cmd_comment_plan_execution_time_sum 4.97979875
atlantis_cmd_comment_plan_execution_time_count 1
# HELP atlantis_cmd_comment_plan_project_execution_error atlantis_cmd_comment_plan_project_execution_error counter
# TYPE atlantis_cmd_comment_plan_project_execution_error counter
atlantis_cmd_comment_plan_project_execution_error{base_repo="albertorm95/atlantis-test",pr_number="7",project="atlantis-example-dev",project_path="example",terraform_version="1.3.4",workspace="default"} 1
atlantis_cmd_comment_plan_project_execution_error{base_repo="albertorm95/atlantis-test",pr_number="7",project="atlantis-example-live",project_path="example",terraform_version="1.3.4",workspace="default"} 1
# HELP atlantis_cmd_comment_plan_project_execution_failure atlantis_cmd_comment_plan_project_execution_failure counter
# TYPE atlantis_cmd_comment_plan_project_execution_failure counter
atlantis_cmd_comment_plan_project_execution_failure{base_repo="albertorm95/atlantis-test",pr_number="7",project="atlantis-example-dev",project_path="example",terraform_version="1.3.4",workspace="default"} 0
atlantis_cmd_comment_plan_project_execution_failure{base_repo="albertorm95/atlantis-test",pr_number="7",project="atlantis-example-live",project_path="example",terraform_version="1.3.4",workspace="default"} 0
# HELP atlantis_cmd_comment_plan_project_execution_success atlantis_cmd_comment_plan_project_execution_success counter
# TYPE atlantis_cmd_comment_plan_project_execution_success counter
atlantis_cmd_comment_plan_project_execution_success{base_repo="albertorm95/atlantis-test",pr_number="7",project="atlantis-example-dev",project_path="example",terraform_version="1.3.4",workspace="default"} 0
atlantis_cmd_comment_plan_project_execution_success{base_repo="albertorm95/atlantis-test",pr_number="7",project="atlantis-example-live",project_path="example",terraform_version="1.3.4",workspace="default"} 0
# HELP atlantis_cmd_comment_plan_project_execution_time atlantis_cmd_comment_plan_project_execution_time summary
# TYPE atlantis_cmd_comment_plan_project_execution_time summary
atlantis_cmd_comment_plan_project_execution_time{base_repo="albertorm95/atlantis-test",pr_number="7",project="atlantis-example-dev",project_path="example",terraform_version="1.3.4",workspace="default",quantile="0.5"} 1.390768583
atlantis_cmd_comment_plan_project_execution_time{base_repo="albertorm95/atlantis-test",pr_number="7",project="atlantis-example-dev",project_path="example",terraform_version="1.3.4",workspace="default",quantile="0.75"} 1.390768583
atlantis_cmd_comment_plan_project_execution_time{base_repo="albertorm95/atlantis-test",pr_number="7",project="atlantis-example-dev",project_path="example",terraform_version="1.3.4",workspace="default",quantile="0.95"} 1.390768583
atlantis_cmd_comment_plan_project_execution_time{base_repo="albertorm95/atlantis-test",pr_number="7",project="atlantis-example-dev",project_path="example",terraform_version="1.3.4",workspace="default",quantile="0.99"} 1.390768583
atlantis_cmd_comment_plan_project_execution_time{base_repo="albertorm95/atlantis-test",pr_number="7",project="atlantis-example-dev",project_path="example",terraform_version="1.3.4",workspace="default",quantile="0.999"} 1.390768583
atlantis_cmd_comment_plan_project_execution_time_sum{base_repo="albertorm95/atlantis-test",pr_number="7",project="atlantis-example-dev",project_path="example",terraform_version="1.3.4",workspace="default"} 1.390768583
atlantis_cmd_comment_plan_project_execution_time_count{base_repo="albertorm95/atlantis-test",pr_number="7",project="atlantis-example-dev",project_path="example",terraform_version="1.3.4",workspace="default"} 1
atlantis_cmd_comment_plan_project_execution_time{base_repo="albertorm95/atlantis-test",pr_number="7",project="atlantis-example-live",project_path="example",terraform_version="1.3.4",workspace="default",quantile="0.5"} 1.219499583
atlantis_cmd_comment_plan_project_execution_time{base_repo="albertorm95/atlantis-test",pr_number="7",project="atlantis-example-live",project_path="example",terraform_version="1.3.4",workspace="default",quantile="0.75"} 1.219499583
atlantis_cmd_comment_plan_project_execution_time{base_repo="albertorm95/atlantis-test",pr_number="7",project="atlantis-example-live",project_path="example",terraform_version="1.3.4",workspace="default",quantile="0.95"} 1.219499583
atlantis_cmd_comment_plan_project_execution_time{base_repo="albertorm95/atlantis-test",pr_number="7",project="atlantis-example-live",project_path="example",terraform_version="1.3.4",workspace="default",quantile="0.99"} 1.219499583
atlantis_cmd_comment_plan_project_execution_time{base_repo="albertorm95/atlantis-test",pr_number="7",project="atlantis-example-live",project_path="example",terraform_version="1.3.4",workspace="default",quantile="0.999"} 1.219499583
atlantis_cmd_comment_plan_project_execution_time_sum{base_repo="albertorm95/atlantis-test",pr_number="7",project="atlantis-example-live",project_path="example",terraform_version="1.3.4",workspace="default"} 1.219499583
atlantis_cmd_comment_plan_project_execution_time_count{base_repo="albertorm95/atlantis-test",pr_number="7",project="atlantis-example-live",project_path="example",terraform_version="1.3.4",workspace="default"} 1
# HELP atlantis_github_create_comment_execution_error atlantis_github_create_comment_execution_error counter
# TYPE atlantis_github_create_comment_execution_error counter
atlantis_github_create_comment_execution_error{base_repo="albertorm95/atlantis-test",pr_number="7"} 0
# HELP atlantis_github_create_comment_execution_success atlantis_github_create_comment_execution_success counter
# TYPE atlantis_github_create_comment_execution_success counter
atlantis_github_create_comment_execution_success{base_repo="albertorm95/atlantis-test",pr_number="7"} 2
# HELP atlantis_github_create_comment_execution_time atlantis_github_create_comment_execution_time summary
# TYPE atlantis_github_create_comment_execution_time summary
atlantis_github_create_comment_execution_time{base_repo="albertorm95/atlantis-test",pr_number="7",quantile="0.5"} 0.86706325
atlantis_github_create_comment_execution_time{base_repo="albertorm95/atlantis-test",pr_number="7",quantile="0.75"} 0.950698167
atlantis_github_create_comment_execution_time{base_repo="albertorm95/atlantis-test",pr_number="7",quantile="0.95"} 0.950698167
atlantis_github_create_comment_execution_time{base_repo="albertorm95/atlantis-test",pr_number="7",quantile="0.99"} 0.950698167
atlantis_github_create_comment_execution_time{base_repo="albertorm95/atlantis-test",pr_number="7",quantile="0.999"} 0.950698167
atlantis_github_create_comment_execution_time_sum{base_repo="albertorm95/atlantis-test",pr_number="7"} 1.8177614169999998
atlantis_github_create_comment_execution_time_count{base_repo="albertorm95/atlantis-test",pr_number="7"} 2
# HELP atlantis_github_event_comment_created_success_200 atlantis_github_event_comment_created_success_200 counter
# TYPE atlantis_github_event_comment_created_success_200 counter
atlantis_github_event_comment_created_success_200{base_repo="albertorm95/atlantis-test",pr_number="7"} 3
# HELP atlantis_github_event_pr_synchronize_success_200 atlantis_github_event_pr_synchronize_success_200 counter
# TYPE atlantis_github_event_pr_synchronize_success_200 counter
atlantis_github_event_pr_synchronize_success_200{base_repo="albertorm95/atlantis-test",pr_number="7"} 1
# HELP atlantis_github_event_success_200 atlantis_github_event_success_200 counter
# TYPE atlantis_github_event_success_200 counter
atlantis_github_event_success_200 1
# HELP atlantis_github_get_modified_files_execution_error atlantis_github_get_modified_files_execution_error counter
# TYPE atlantis_github_get_modified_files_execution_error counter
atlantis_github_get_modified_files_execution_error{base_repo="albertorm95/atlantis-test",pr_number="7"} 0
# HELP atlantis_github_get_modified_files_execution_success atlantis_github_get_modified_files_execution_success counter
# TYPE atlantis_github_get_modified_files_execution_success counter
atlantis_github_get_modified_files_execution_success{base_repo="albertorm95/atlantis-test",pr_number="7"} 2
# HELP atlantis_github_get_modified_files_execution_time atlantis_github_get_modified_files_execution_time summary
# TYPE atlantis_github_get_modified_files_execution_time summary
atlantis_github_get_modified_files_execution_time{base_repo="albertorm95/atlantis-test",pr_number="7",quantile="0.5"} 0.166267583
atlantis_github_get_modified_files_execution_time{base_repo="albertorm95/atlantis-test",pr_number="7",quantile="0.75"} 0.448229417
atlantis_github_get_modified_files_execution_time{base_repo="albertorm95/atlantis-test",pr_number="7",quantile="0.95"} 0.448229417
atlantis_github_get_modified_files_execution_time{base_repo="albertorm95/atlantis-test",pr_number="7",quantile="0.99"} 0.448229417
atlantis_github_get_modified_files_execution_time{base_repo="albertorm95/atlantis-test",pr_number="7",quantile="0.999"} 0.448229417
atlantis_github_get_modified_files_execution_time_sum{base_repo="albertorm95/atlantis-test",pr_number="7"} 0.6144970000000001
atlantis_github_get_modified_files_execution_time_count{base_repo="albertorm95/atlantis-test",pr_number="7"} 2
# HELP atlantis_github_get_pull_request_execution_error atlantis_github_get_pull_request_execution_error counter
# TYPE atlantis_github_get_pull_request_execution_error counter
atlantis_github_get_pull_request_execution_error{base_repo="albertorm95/atlantis-test",pr_number="7"} 0
# HELP atlantis_github_get_pull_request_execution_success atlantis_github_get_pull_request_execution_success counter
# TYPE atlantis_github_get_pull_request_execution_success counter
atlantis_github_get_pull_request_execution_success{base_repo="albertorm95/atlantis-test",pr_number="7"} 1
# HELP atlantis_github_get_pull_request_execution_time atlantis_github_get_pull_request_execution_time summary
# TYPE atlantis_github_get_pull_request_execution_time summary
atlantis_github_get_pull_request_execution_time{base_repo="albertorm95/atlantis-test",pr_number="7",quantile="0.5"} 0.517413084
atlantis_github_get_pull_request_execution_time{base_repo="albertorm95/atlantis-test",pr_number="7",quantile="0.75"} 0.517413084
atlantis_github_get_pull_request_execution_time{base_repo="albertorm95/atlantis-test",pr_number="7",quantile="0.95"} 0.517413084
atlantis_github_get_pull_request_execution_time{base_repo="albertorm95/atlantis-test",pr_number="7",quantile="0.99"} 0.517413084
atlantis_github_get_pull_request_execution_time{base_repo="albertorm95/atlantis-test",pr_number="7",quantile="0.999"} 0.517413084
atlantis_github_get_pull_request_execution_time_sum{base_repo="albertorm95/atlantis-test",pr_number="7"} 0.517413084
atlantis_github_get_pull_request_execution_time_count{base_repo="albertorm95/atlantis-test",pr_number="7"} 1
# HELP atlantis_github_update_status_execution_error atlantis_github_update_status_execution_error counter
# TYPE atlantis_github_update_status_execution_error counter
atlantis_github_update_status_execution_error{base_repo="albertorm95/atlantis-test",pr_number="7"} 0
# HELP atlantis_github_update_status_execution_success atlantis_github_update_status_execution_success counter
# TYPE atlantis_github_update_status_execution_success counter
atlantis_github_update_status_execution_success{base_repo="albertorm95/atlantis-test",pr_number="7"} 10
# HELP atlantis_github_update_status_execution_time atlantis_github_update_status_execution_time summary
# TYPE atlantis_github_update_status_execution_time summary
atlantis_github_update_status_execution_time{base_repo="albertorm95/atlantis-test",pr_number="7",quantile="0.5"} 0.286050084
atlantis_github_update_status_execution_time{base_repo="albertorm95/atlantis-test",pr_number="7",quantile="0.75"} 0.349325333
atlantis_github_update_status_execution_time{base_repo="albertorm95/atlantis-test",pr_number="7",quantile="0.95"} 0.43589
atlantis_github_update_status_execution_time{base_repo="albertorm95/atlantis-test",pr_number="7",quantile="0.99"} 0.43589
atlantis_github_update_status_execution_time{base_repo="albertorm95/atlantis-test",pr_number="7",quantile="0.999"} 0.43589
atlantis_github_update_status_execution_time_sum{base_repo="albertorm95/atlantis-test",pr_number="7"} 3.1921828740000002
atlantis_github_update_status_execution_time_count{base_repo="albertorm95/atlantis-test",pr_number="7"} 10
# HELP atlantis_projects atlantis_projects counter
# TYPE atlantis_projects counter
atlantis_projects 3
# HELP atlantis_scheduled_runtime_cpu_cgo_calls atlantis_scheduled_runtime_cpu_cgo_calls gauge
# TYPE atlantis_scheduled_runtime_cpu_cgo_calls gauge
atlantis_scheduled_runtime_cpu_cgo_calls 5
# HELP atlantis_scheduled_runtime_cpu_goroutines atlantis_scheduled_runtime_cpu_goroutines gauge
# TYPE atlantis_scheduled_runtime_cpu_goroutines gauge
atlantis_scheduled_runtime_cpu_goroutines 13
# HELP atlantis_scheduled_runtime_memory_alloc atlantis_scheduled_runtime_memory_alloc gauge
# TYPE atlantis_scheduled_runtime_memory_alloc gauge
atlantis_scheduled_runtime_memory_alloc 9.056176e+06
# HELP atlantis_scheduled_runtime_memory_frees atlantis_scheduled_runtime_memory_frees gauge
# TYPE atlantis_scheduled_runtime_memory_frees gauge
atlantis_scheduled_runtime_memory_frees 51495
# HELP atlantis_scheduled_runtime_memory_gc_count atlantis_scheduled_runtime_memory_gc_count gauge
# TYPE atlantis_scheduled_runtime_memory_gc_count gauge
atlantis_scheduled_runtime_memory_gc_count 6
# HELP atlantis_scheduled_runtime_memory_gc_last atlantis_scheduled_runtime_memory_gc_last gauge
# TYPE atlantis_scheduled_runtime_memory_gc_last gauge
atlantis_scheduled_runtime_memory_gc_last 1.668792762090732e+18
# HELP atlantis_scheduled_runtime_memory_gc_next atlantis_scheduled_runtime_memory_gc_next gauge
# TYPE atlantis_scheduled_runtime_memory_gc_next gauge
atlantis_scheduled_runtime_memory_gc_next 1.6972608e+07
# HELP atlantis_scheduled_runtime_memory_gc_pause_total atlantis_scheduled_runtime_memory_gc_pause_total gauge
# TYPE atlantis_scheduled_runtime_memory_gc_pause_total gauge
atlantis_scheduled_runtime_memory_gc_pause_total 1.53142e+06
# HELP atlantis_scheduled_runtime_memory_gc_sys atlantis_scheduled_runtime_memory_gc_sys gauge
# TYPE atlantis_scheduled_runtime_memory_gc_sys gauge
atlantis_scheduled_runtime_memory_gc_sys 5.844328e+06
# HELP atlantis_scheduled_runtime_memory_heap_alloc atlantis_scheduled_runtime_memory_heap_alloc gauge
# TYPE atlantis_scheduled_runtime_memory_heap_alloc gauge
atlantis_scheduled_runtime_memory_heap_alloc 9.056176e+06
# HELP atlantis_scheduled_runtime_memory_heap_idle atlantis_scheduled_runtime_memory_heap_idle gauge
# TYPE atlantis_scheduled_runtime_memory_heap_idle gauge
atlantis_scheduled_runtime_memory_heap_idle 4.431872e+06
# HELP atlantis_scheduled_runtime_memory_heap_inuse atlantis_scheduled_runtime_memory_heap_inuse gauge
# TYPE atlantis_scheduled_runtime_memory_heap_inuse gauge
atlantis_scheduled_runtime_memory_heap_inuse 1.1493376e+07
# HELP atlantis_scheduled_runtime_memory_heap_objects atlantis_scheduled_runtime_memory_heap_objects gauge
# TYPE atlantis_scheduled_runtime_memory_heap_objects gauge
atlantis_scheduled_runtime_memory_heap_objects 30891
# HELP atlantis_scheduled_runtime_memory_heap_released atlantis_scheduled_runtime_memory_heap_released gauge
# TYPE atlantis_scheduled_runtime_memory_heap_released gauge
atlantis_scheduled_runtime_memory_heap_released 2.383872e+06
# HELP atlantis_scheduled_runtime_memory_heap_sys atlantis_scheduled_runtime_memory_heap_sys gauge
# TYPE atlantis_scheduled_runtime_memory_heap_sys gauge
atlantis_scheduled_runtime_memory_heap_sys 1.5925248e+07
# HELP atlantis_scheduled_runtime_memory_lookups atlantis_scheduled_runtime_memory_lookups gauge
# TYPE atlantis_scheduled_runtime_memory_lookups gauge
atlantis_scheduled_runtime_memory_lookups 0
# HELP atlantis_scheduled_runtime_memory_malloc atlantis_scheduled_runtime_memory_malloc gauge
# TYPE atlantis_scheduled_runtime_memory_malloc gauge
atlantis_scheduled_runtime_memory_malloc 82386
# HELP atlantis_scheduled_runtime_memory_othersys atlantis_scheduled_runtime_memory_othersys gauge
# TYPE atlantis_scheduled_runtime_memory_othersys gauge
atlantis_scheduled_runtime_memory_othersys 1.084832e+06
# HELP atlantis_scheduled_runtime_memory_stack_inuse atlantis_scheduled_runtime_memory_stack_inuse gauge
# TYPE atlantis_scheduled_runtime_memory_stack_inuse gauge
atlantis_scheduled_runtime_memory_stack_inuse 851968
# HELP atlantis_scheduled_runtime_memory_stack_mcache_inuse atlantis_scheduled_runtime_memory_stack_mcache_inuse gauge
# TYPE atlantis_scheduled_runtime_memory_stack_mcache_inuse gauge
atlantis_scheduled_runtime_memory_stack_mcache_inuse 9600
# HELP atlantis_scheduled_runtime_memory_stack_mcache_sys atlantis_scheduled_runtime_memory_stack_mcache_sys gauge
# TYPE atlantis_scheduled_runtime_memory_stack_mcache_sys gauge
atlantis_scheduled_runtime_memory_stack_mcache_sys 15600
# HELP atlantis_scheduled_runtime_memory_stack_mspan_inuse atlantis_scheduled_runtime_memory_stack_mspan_inuse gauge
# TYPE atlantis_scheduled_runtime_memory_stack_mspan_inuse gauge
atlantis_scheduled_runtime_memory_stack_mspan_inuse 174352
# HELP atlantis_scheduled_runtime_memory_stack_sys atlantis_scheduled_runtime_memory_stack_sys gauge
# TYPE atlantis_scheduled_runtime_memory_stack_sys gauge
atlantis_scheduled_runtime_memory_stack_sys 179520
# HELP atlantis_scheduled_runtime_memory_sys atlantis_scheduled_runtime_memory_sys gauge
# TYPE atlantis_scheduled_runtime_memory_sys gauge
atlantis_scheduled_runtime_memory_sys 2.3907344e+07
# HELP atlantis_scheduled_runtime_memory_total atlantis_scheduled_runtime_memory_total gauge
# TYPE atlantis_scheduled_runtime_memory_total gauge
atlantis_scheduled_runtime_memory_total 1.6610048e+07
# HELP go_gc_duration_seconds A summary of the pause duration of garbage collection cycles.
# TYPE go_gc_duration_seconds summary
go_gc_duration_seconds{quantile="0"} 4.1292e-05
go_gc_duration_seconds{quantile="0.25"} 4.7959e-05
go_gc_duration_seconds{quantile="0.5"} 0.00016175
go_gc_duration_seconds{quantile="0.75"} 0.000393293
go_gc_duration_seconds{quantile="1"} 0.000831084
go_gc_duration_seconds_sum 0.00153142
go_gc_duration_seconds_count 6
# HELP go_goroutines Number of goroutines that currently exist.
# TYPE go_goroutines gauge
go_goroutines 15
# HELP go_info Information about the Go environment.
# TYPE go_info gauge
go_info{version="go1.19.3"} 1
# HELP go_memstats_alloc_bytes Number of bytes allocated and still in use.
# TYPE go_memstats_alloc_bytes gauge
go_memstats_alloc_bytes 9.331232e+06
# HELP go_memstats_alloc_bytes_total Total number of bytes allocated, even if freed.
# TYPE go_memstats_alloc_bytes_total counter
go_memstats_alloc_bytes_total 1.6885104e+07
# HELP go_memstats_buck_hash_sys_bytes Number of bytes used by the profiling bucket hash table.
# TYPE go_memstats_buck_hash_sys_bytes gauge
go_memstats_buck_hash_sys_bytes 5848
# HELP go_memstats_frees_total Total number of frees.
# TYPE go_memstats_frees_total counter
go_memstats_frees_total 51719
# HELP go_memstats_gc_sys_bytes Number of bytes used for garbage collection system metadata.
# TYPE go_memstats_gc_sys_bytes gauge
go_memstats_gc_sys_bytes 5.848424e+06
# HELP go_memstats_heap_alloc_bytes Number of heap bytes allocated and still in use.
# TYPE go_memstats_heap_alloc_bytes gauge
go_memstats_heap_alloc_bytes 9.331232e+06
# HELP go_memstats_heap_idle_bytes Number of heap bytes waiting to be used.
# TYPE go_memstats_heap_idle_bytes gauge
go_memstats_heap_idle_bytes 3.883008e+06
# HELP go_memstats_heap_inuse_bytes Number of heap bytes that are in use.
# TYPE go_memstats_heap_inuse_bytes gauge
go_memstats_heap_inuse_bytes 1.2009472e+07
# HELP go_memstats_heap_objects Number of allocated objects.
# TYPE go_memstats_heap_objects gauge
go_memstats_heap_objects 32572
# HELP go_memstats_heap_released_bytes Number of heap bytes released to OS.
# TYPE go_memstats_heap_released_bytes gauge
go_memstats_heap_released_bytes 2.318336e+06
# HELP go_memstats_heap_sys_bytes Number of heap bytes obtained from system.
# TYPE go_memstats_heap_sys_bytes gauge
go_memstats_heap_sys_bytes 1.589248e+07
# HELP go_memstats_last_gc_time_seconds Number of seconds since 1970 of last garbage collection.
# TYPE go_memstats_last_gc_time_seconds gauge
go_memstats_last_gc_time_seconds 1.668792762090732e+09
# HELP go_memstats_lookups_total Total number of pointer lookups.
# TYPE go_memstats_lookups_total counter
go_memstats_lookups_total 0
# HELP go_memstats_mallocs_total Total number of mallocs.
# TYPE go_memstats_mallocs_total counter
go_memstats_mallocs_total 84291
# HELP go_memstats_mcache_inuse_bytes Number of bytes in use by mcache structures.
# TYPE go_memstats_mcache_inuse_bytes gauge
go_memstats_mcache_inuse_bytes 9600
# HELP go_memstats_mcache_sys_bytes Number of bytes used for mcache structures obtained from system.
# TYPE go_memstats_mcache_sys_bytes gauge
go_memstats_mcache_sys_bytes 15600
# HELP go_memstats_mspan_inuse_bytes Number of bytes in use by mspan structures.
# TYPE go_memstats_mspan_inuse_bytes gauge
go_memstats_mspan_inuse_bytes 183056
# HELP go_memstats_mspan_sys_bytes Number of bytes used for mspan structures obtained from system.
# TYPE go_memstats_mspan_sys_bytes gauge
go_memstats_mspan_sys_bytes 195840
# HELP go_memstats_next_gc_bytes Number of heap bytes when next garbage collection will take place.
# TYPE go_memstats_next_gc_bytes gauge
go_memstats_next_gc_bytes 1.6972608e+07
# HELP go_memstats_other_sys_bytes Number of bytes used for other system allocations.
# TYPE go_memstats_other_sys_bytes gauge
go_memstats_other_sys_bytes 1.064416e+06
# HELP go_memstats_stack_inuse_bytes Number of bytes in use by the stack allocator.
# TYPE go_memstats_stack_inuse_bytes gauge
go_memstats_stack_inuse_bytes 884736
# HELP go_memstats_stack_sys_bytes Number of bytes obtained from system for stack allocator.
# TYPE go_memstats_stack_sys_bytes gauge
go_memstats_stack_sys_bytes 884736
# HELP go_memstats_sys_bytes Number of bytes obtained from system.
# TYPE go_memstats_sys_bytes gauge
go_memstats_sys_bytes 2.3907344e+07
# HELP go_threads Number of OS threads created.
# TYPE go_threads gauge
go_threads 14

@albertorm95 albertorm95 requested a review from a team as a code owner November 16, 2022 20:42
@jamengual
Copy link
Contributor

thanks @albertorm95 do you think you could give it a try and try to fix that error? we recently upgraded to go1.19 I wonder if is related to new client instantiations that meed updating

@jamengual jamengual added the waiting-on-review Waiting for a review from a maintainer label Nov 16, 2022
@nitrocode
Copy link
Member

@albertorm95 please add tests for this

@albertorm95
Copy link
Contributor Author

albertorm95 commented Nov 17, 2022

@albertorm95 please add tests for this

Hello @nitrocode , do you want me to create a test that verifies that the tags are in the metric?

@nitrocode
Copy link
Member

nitrocode commented Nov 17, 2022

Any tests would be helpful to prevent breaking the feature. I do not recall if we added any tests for the metrics feature in general..

@@ -235,3 +243,10 @@ func fmtLogSrc(repo models.Repo, pullNum int) []interface{} {
"pull-num", strconv.Itoa(pullNum),
}
}

func SetGitScopeTags(scope tally.Scope, repoFullName string, pullNum int) tally.Scope {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Is there a global place to put some functions like helpers?

// instead of a pointer since we want scopes to mirror our function stack
func (p ProjectContext) SetScope(scope string) {
// SetScopeTags adds ProjectContext tags to a new returned scope.
func (p ProjectContext) SetScopeTags(scope tally.Scope) tally.Scope {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

After a lot of debugging I got to the conclusion that the previous code was doing nothing, so instead of creating a function to SetScope that was basically scope.SubScope, I renamed to SetScopeTags that will add the listed tags to the scope

Copy link
Member

@nitrocode nitrocode left a comment

Choose a reason for hiding this comment

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

This looks good to me but let's get a second opinion too. cc: @jamengual @chenrui333 @lilincmu

@nitrocode nitrocode merged commit 949ee3f into runatlantis:main Nov 19, 2022
@nitrocode
Copy link
Member

Thank you @albertorm95 !

krrrr38 pushed a commit to krrrr38/atlantis that referenced this pull request Dec 16, 2022
* metrics: Add Metrics tags to multiple Scopes

* metrics: Fix base_repo and pr_number

* metrics: Refactor SetScope to SetScopeTags

* metrics: Add SetGitScopeTags function

* metrics: docs reword project_context SetScopeTags description

* metrics: test Add TestNewScope_PrometheusTaggingCapabilities
@nitrocode nitrocode added this to the 0.21.0 milestone Jan 13, 2023
@albertorm95 albertorm95 deleted the feat-add-metrics-tags branch May 17, 2023 14:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
waiting-on-review Waiting for a review from a maintainer
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants