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

add prometheus middleware #3229

Merged
merged 2 commits into from
Sep 29, 2022
Merged

Conversation

butonic
Copy link
Contributor

@butonic butonic commented Sep 13, 2022

This allows collecting call metrics for #2976

I'll add A PR to ocis that adds sth like this to all ocis services:

			"interceptors": map[string]interface{}{
				"prometheus": map[string]interface{}{
					"namespace": "ocis",
					"subsystem": "auth_basic",
				},
			},

it allows fetching metrics like this:

$ curl 127.0.0.1:9165/metrics -s | grep _requests | grep -v '#' | grep -v 'promhttp_metric_'
ocis_app_provider_grpc_requests_total 0
ocis_app_registry_grpc_requests_total 1
ocis_auth_basic_grpc_requests_total 0
ocis_auth_bearer_grpc_requests_total 0
ocis_auth_machine_grpc_requests_total 0
ocis_frontend_http_requests_total 0
ocis_gateway_grpc_requests_total 1
ocis_groups_grpc_requests_total 0
ocis_sharing_grpc_requests_total 0
ocis_storage_publiclink_grpc_requests_total 0
ocis_storage_shares_grpc_requests_total 0
ocis_storage_system_grpc_requests_total 6
ocis_storage_system_http_requests_total 0
ocis_storage_users_grpc_requests_total 0
ocis_users_grpc_requests_total 0

and after a single list received shares call with 500 accepted shares:

$ curl 127.0.0.1:9165/metrics -s | grep _requests | grep -v '#' | grep -v 'promhttp_metric_'
ocis_app_provider_grpc_requests_total 0
ocis_app_registry_grpc_requests_total 1
ocis_auth_basic_grpc_requests_total 1
ocis_auth_bearer_grpc_requests_total 0
ocis_auth_machine_grpc_requests_total 1
ocis_frontend_http_requests_total 1
ocis_gateway_grpc_requests_total 1013
ocis_groups_grpc_requests_total 0
ocis_sharing_grpc_requests_total 1
ocis_storage_publiclink_grpc_requests_total 0
ocis_storage_shares_grpc_requests_total 0
ocis_storage_system_grpc_requests_total 858
ocis_storage_system_http_requests_total 118
ocis_storage_users_grpc_requests_total 501
ocis_users_grpc_requests_total 5

This pr can easily be

  • ported to master and
  • used to compare master vs edge

Signed-off-by: Jörn Friedrich Dreyer <jfd@butonic.de>
Signed-off-by: Jörn Friedrich Dreyer <jfd@butonic.de>
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.

None yet

2 participants