Skip to content
This repository has been archived by the owner on Oct 11, 2023. It is now read-only.

Add simple HTTP metrics for both requests and outputs #40

Merged
merged 2 commits into from
Feb 8, 2020

Conversation

CheyiLin
Copy link

@CheyiLin CheyiLin commented Dec 30, 2019

Hi,

Just added simple metrics for relay requests (HTTP server) and relay outputs (HTTP client).
It uses opencensus libs to provide prometheus compatible metrics on :8088/metrics.

Feel free to let me know if there is something I can improve.
Thank you.

  • Example for http requests: relay_http_*
...
relay_http_request_bytes_bucket{http_method="POST",http_path="/api/v1/prom/write",http_status="204",le="1.073741824e+09"} 2332
relay_http_request_bytes_bucket{http_method="POST",http_path="/api/v1/prom/write",http_status="204",le="4.294967296e+09"} 2332
relay_http_request_bytes_bucket{http_method="POST",http_path="/api/v1/prom/write",http_status="204",le="+Inf"} 2332
relay_http_request_bytes_sum{http_method="POST",http_path="/api/v1/prom/write",http_status="204"} 6.2660830000000065e+06
relay_http_request_bytes_count{http_method="POST",http_path="/api/v1/prom/write",http_status="204"} 2332
# HELP relay_http_response_count_by_status_code Server response count by status code
# TYPE relay_http_response_count_by_status_code counter
relay_http_response_count_by_status_code{http_method="POST",http_path="/api/v1/prom/write",http_status="204"} 2332
  • Example for outputs: relay_http_output_*
...
relay_http_output_roundtrip_latency_bucket{http_client_host="influxdb0:8086",http_client_method="POST",http_client_path="/api/v1/prom/write",http_client_status="204",le="50000"} 2332
relay_http_output_roundtrip_latency_bucket{http_client_host="influxdb0:8086",http_client_method="POST",http_client_path="/api/v1/prom/write",http_client_status="204",le="100000"} 2332
relay_http_output_roundtrip_latency_bucket{http_client_host="influxdb0:8086",http_client_method="POST",http_client_path="/api/v1/prom/write",http_client_status="204",le="+Inf"} 2332
relay_http_output_roundtrip_latency_sum{http_client_host="influxdb0:8086",http_client_method="POST",http_client_path="/api/v1/prom/write",http_client_status="204"} 10531.3364
relay_http_output_roundtrip_latency_count{http_client_host="influxdb0:8086",http_client_method="POST",http_client_path="/api/v1/prom/write",http_client_status="204"} 2332
# HELP relay_http_output_completed_count Count of completed requests, by HTTP method and response status
# TYPE relay_http_output_completed_count counter
relay_http_output_completed_count{http_client_host="influxdb0:8086",http_client_method="POST",http_client_path="/api/v1/prom/write",http_client_status="204"} 2332
relay_http_output
_completed_count{http_client_host="influxdb1:8086",http_client_method="POST",http_client_path="/api/v1/prom/write",http_client_status="204"} 2332

@CheyiLin
Copy link
Author

CheyiLin commented Jan 3, 2020

I've improved the metric names for better readability:

  • metrics with prefix relay_http_* are related to config section [[http]]
  • metrics with prefix relay_http_output_* are related to config sections [[http.output]]

@rockyluke rockyluke merged commit 1954f47 into veepee-oss:master Feb 8, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants