Add Prometheus metrics to Kubernetes Access#29363
Merged
Conversation
4903039 to
733fba0
Compare
This PR adds several prometheus metrics to the Kubernetes Access package. The new metrics are: | Name | Type | Component | Description | | ----------------------------------------------------------------- | --------- | --------------------------- | --------------------------------------------------------------------------------------------------------- | | `teleport_kubernetes_client_in_flight_requests` | gauge | Teleport Kubernetes Service | In-flight requests waiting for the upstream response. | | `teleport_kubernetes_client_requests_total` | counter | Teleport Kubernetes Service | Total number of requests sent to the upstream teleport proxy, kube_service or Kubernetes Cluster servers. | | `teleport_kubernetes_client_tls_duration_seconds` | histogram | Teleport Kubernetes Service | Latency distribution of TLS handshakes. | | `teleport_kubernetes_client_got_conn_duration_seconds` | histogram | Teleport Kubernetes Service | Latency distribution of time to dial to the upstream server - using reversetunnel or direct dialer. | | `teleport_kubernetes_client_first_byte_response_duration_seconds` | histogram | Teleport Kubernetes Service | Latency distribution of time to receive the first response byte from the upstream server. | | `teleport_kubernetes_client_request_duration_seconds` | histogram | Teleport Kubernetes Service | Latency distribution of the upstream request time. | | Name | Type | Component | Description | | ----------------------------------------------------------- | --------- | --------------------------- | --------------------------------------------------- | | `teleport_kubernetes_server_in_flight_requests` | gauge | Teleport Kubernetes Service | In-flight requests currently handled by the server. | | `teleport_kubernetes_server_api_requests_total` | counter | Teleport Kubernetes Service | Total number of requests handled by the server. | | `teleport_kubernetes_server_request_duration_seconds` | histogram | Teleport Kubernetes Service | Latency distribution of the total request time. | | `teleport_kubernetes_server_response_size_bytes` | histogram | Teleport Kubernetes Service | Distribution of the response size. | | `teleport_kubernetes_server_exec_in_flight_sessions` | gauge | Teleport Kubernetes Service | Number of active kubectl exec sessions. | | `teleport_kubernetes_server_exec_sessions_total` | counter | Teleport Kubernetes Service | Total number of kubectl exec sessions. | | `teleport_kubernetes_server_portforward_in_flight_sessions` | gauge | Teleport Kubernetes Service | Number of active kubectl portforward sessions. | | `teleport_kubernetes_server_portforward_sessions_total` | counter | Teleport Kubernetes Service | Number of active kubectl portforward sessions. | | `teleport_kubernetes_server_join_in_flight_sessions` | gauge | Teleport Kubernetes Service | Number of active joining sessions, | | `teleport_kubernetes_server_join_sessions_total` | counter | Teleport Kubernetes Service | Total number of joining sessions. | Closes #29362 Signed-off-by: Tiago Silva <tiago.silva@goteleport.com>
733fba0 to
9724c54
Compare
rosstimothy
approved these changes
Jul 21, 2023
alexfornuto
reviewed
Jul 25, 2023
Co-authored-by: Alex Fornuto <alex.fornuto@goteleport.com>
r0mant
approved these changes
Jul 26, 2023
tigrato
added a commit
that referenced
this pull request
Aug 3, 2023
* Add Prometheus metrics to Kubernetes Access This PR adds several prometheus metrics to the Kubernetes Access package. The new metrics are: | Name | Type | Component | Description | | ----------------------------------------------------------------- | --------- | --------------------------- | --------------------------------------------------------------------------------------------------------- | | `teleport_kubernetes_client_in_flight_requests` | gauge | Teleport Kubernetes Service | In-flight requests waiting for the upstream response. | | `teleport_kubernetes_client_requests_total` | counter | Teleport Kubernetes Service | Total number of requests sent to the upstream teleport proxy, kube_service or Kubernetes Cluster servers. | | `teleport_kubernetes_client_tls_duration_seconds` | histogram | Teleport Kubernetes Service | Latency distribution of TLS handshakes. | | `teleport_kubernetes_client_got_conn_duration_seconds` | histogram | Teleport Kubernetes Service | Latency distribution of time to dial to the upstream server - using reversetunnel or direct dialer. | | `teleport_kubernetes_client_first_byte_response_duration_seconds` | histogram | Teleport Kubernetes Service | Latency distribution of time to receive the first response byte from the upstream server. | | `teleport_kubernetes_client_request_duration_seconds` | histogram | Teleport Kubernetes Service | Latency distribution of the upstream request time. | | Name | Type | Component | Description | | ----------------------------------------------------------- | --------- | --------------------------- | --------------------------------------------------- | | `teleport_kubernetes_server_in_flight_requests` | gauge | Teleport Kubernetes Service | In-flight requests currently handled by the server. | | `teleport_kubernetes_server_api_requests_total` | counter | Teleport Kubernetes Service | Total number of requests handled by the server. | | `teleport_kubernetes_server_request_duration_seconds` | histogram | Teleport Kubernetes Service | Latency distribution of the total request time. | | `teleport_kubernetes_server_response_size_bytes` | histogram | Teleport Kubernetes Service | Distribution of the response size. | | `teleport_kubernetes_server_exec_in_flight_sessions` | gauge | Teleport Kubernetes Service | Number of active kubectl exec sessions. | | `teleport_kubernetes_server_exec_sessions_total` | counter | Teleport Kubernetes Service | Total number of kubectl exec sessions. | | `teleport_kubernetes_server_portforward_in_flight_sessions` | gauge | Teleport Kubernetes Service | Number of active kubectl portforward sessions. | | `teleport_kubernetes_server_portforward_sessions_total` | counter | Teleport Kubernetes Service | Number of active kubectl portforward sessions. | | `teleport_kubernetes_server_join_in_flight_sessions` | gauge | Teleport Kubernetes Service | Number of active joining sessions, | | `teleport_kubernetes_server_join_sessions_total` | counter | Teleport Kubernetes Service | Total number of joining sessions. | Closes #29362 Signed-off-by: Tiago Silva <tiago.silva@goteleport.com> * replace prometheus.MustRegister with metrics.RegisterPrometheusCollectors * Apply suggestions from code review Co-authored-by: Alex Fornuto <alex.fornuto@goteleport.com> --------- Signed-off-by: Tiago Silva <tiago.silva@goteleport.com> Co-authored-by: Alex Fornuto <alex.fornuto@goteleport.com>
github-merge-queue Bot
pushed a commit
that referenced
this pull request
Aug 3, 2023
* Add Prometheus metrics to Kubernetes Access This PR adds several prometheus metrics to the Kubernetes Access package. The new metrics are: | Name | Type | Component | Description | | ----------------------------------------------------------------- | --------- | --------------------------- | --------------------------------------------------------------------------------------------------------- | | `teleport_kubernetes_client_in_flight_requests` | gauge | Teleport Kubernetes Service | In-flight requests waiting for the upstream response. | | `teleport_kubernetes_client_requests_total` | counter | Teleport Kubernetes Service | Total number of requests sent to the upstream teleport proxy, kube_service or Kubernetes Cluster servers. | | `teleport_kubernetes_client_tls_duration_seconds` | histogram | Teleport Kubernetes Service | Latency distribution of TLS handshakes. | | `teleport_kubernetes_client_got_conn_duration_seconds` | histogram | Teleport Kubernetes Service | Latency distribution of time to dial to the upstream server - using reversetunnel or direct dialer. | | `teleport_kubernetes_client_first_byte_response_duration_seconds` | histogram | Teleport Kubernetes Service | Latency distribution of time to receive the first response byte from the upstream server. | | `teleport_kubernetes_client_request_duration_seconds` | histogram | Teleport Kubernetes Service | Latency distribution of the upstream request time. | | Name | Type | Component | Description | | ----------------------------------------------------------- | --------- | --------------------------- | --------------------------------------------------- | | `teleport_kubernetes_server_in_flight_requests` | gauge | Teleport Kubernetes Service | In-flight requests currently handled by the server. | | `teleport_kubernetes_server_api_requests_total` | counter | Teleport Kubernetes Service | Total number of requests handled by the server. | | `teleport_kubernetes_server_request_duration_seconds` | histogram | Teleport Kubernetes Service | Latency distribution of the total request time. | | `teleport_kubernetes_server_response_size_bytes` | histogram | Teleport Kubernetes Service | Distribution of the response size. | | `teleport_kubernetes_server_exec_in_flight_sessions` | gauge | Teleport Kubernetes Service | Number of active kubectl exec sessions. | | `teleport_kubernetes_server_exec_sessions_total` | counter | Teleport Kubernetes Service | Total number of kubectl exec sessions. | | `teleport_kubernetes_server_portforward_in_flight_sessions` | gauge | Teleport Kubernetes Service | Number of active kubectl portforward sessions. | | `teleport_kubernetes_server_portforward_sessions_total` | counter | Teleport Kubernetes Service | Number of active kubectl portforward sessions. | | `teleport_kubernetes_server_join_in_flight_sessions` | gauge | Teleport Kubernetes Service | Number of active joining sessions, | | `teleport_kubernetes_server_join_sessions_total` | counter | Teleport Kubernetes Service | Total number of joining sessions. | Closes #29362 * replace prometheus.MustRegister with metrics.RegisterPrometheusCollectors * Apply suggestions from code review --------- Signed-off-by: Tiago Silva <tiago.silva@goteleport.com> Co-authored-by: Alex Fornuto <alex.fornuto@goteleport.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR adds several prometheus metrics to the Kubernetes Access package.
The new metrics are:
teleport_kubernetes_client_in_flight_requeststeleport_kubernetes_client_requests_totalteleport_kubernetes_client_tls_duration_secondsteleport_kubernetes_client_got_conn_duration_secondsteleport_kubernetes_client_first_byte_response_duration_secondsteleport_kubernetes_client_request_duration_secondsteleport_kubernetes_server_in_flight_requeststeleport_kubernetes_server_api_requests_totalteleport_kubernetes_server_request_duration_secondsteleport_kubernetes_server_response_size_bytesteleport_kubernetes_server_exec_in_flight_sessionsteleport_kubernetes_server_exec_sessions_totalteleport_kubernetes_server_portforward_in_flight_sessionsteleport_kubernetes_server_portforward_sessions_totalteleport_kubernetes_server_join_in_flight_sessionsteleport_kubernetes_server_join_sessions_totalCloses #29362