Skip to content

Commit

Permalink
Add load balancer metrics endpoints (#907)
Browse files Browse the repository at this point in the history
* add lb_id for load balancer metrics

* add first spec and example

* add the rest

* reorder some items

* update summary for consistency

---------

Co-authored-by: Andrew Starr-Bochicchio <andrewsomething@users.noreply.github.com>
  • Loading branch information
beardicus and andrewsomething authored Sep 6, 2024
1 parent ccd01a3 commit 312be69
Show file tree
Hide file tree
Showing 56 changed files with 1,278 additions and 0 deletions.
108 changes: 108 additions & 0 deletions specification/DigitalOcean-public.v2.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -1269,6 +1269,114 @@ paths:
get:
$ref: 'resources/monitoring/monitoring_get_appRestartCountMetrics.yml'

/v2/monitoring/metrics/load_balancer/frontend_connections_current:
get:
$ref: 'resources/monitoring/monitoring_get_lb_frontend_connections_current.yml'

/v2/monitoring/metrics/load_balancer/frontend_connections_limit:
get:
$ref: 'resources/monitoring/monitoring_get_lb_frontend_connections_limit.yml'

/v2/monitoring/metrics/load_balancer/frontend_cpu_utilization:
get:
$ref: 'resources/monitoring/monitoring_get_lb_frontend_cpu_utilization.yml'

/v2/monitoring/metrics/load_balancer/frontend_firewall_dropped_bytes:
get:
$ref: 'resources/monitoring/monitoring_get_lb_frontend_firewall_dropped_bytes.yml'

/v2/monitoring/metrics/load_balancer/frontend_firewall_dropped_packets:
get:
$ref: 'resources/monitoring/monitoring_get_lb_frontend_firewall_dropped_packets.yml'

/v2/monitoring/metrics/load_balancer/frontend_http_responses:
get:
$ref: 'resources/monitoring/monitoring_get_lb_frontend_http_responses.yml'

/v2/monitoring/metrics/load_balancer/frontend_http_requests_per_second:
get:
$ref: 'resources/monitoring/monitoring_get_lb_frontend_http_requests_per_second.yml'

/v2/monitoring/metrics/load_balancer/frontend_network_throughput_http:
get:
$ref: 'resources/monitoring/monitoring_get_lb_frontend_network_throughput_http.yml'

/v2/monitoring/metrics/load_balancer/frontend_network_throughput_udp:
get:
$ref: 'resources/monitoring/monitoring_get_lb_frontend_network_throughput_udp.yml'

/v2/monitoring/metrics/load_balancer/frontend_network_throughput_tcp:
get:
$ref: 'resources/monitoring/monitoring_get_lb_frontend_network_throughput_tcp.yml'

/v2/monitoring/metrics/load_balancer/frontend_nlb_tcp_network_throughput:
get:
$ref: 'resources/monitoring/monitoring_get_lb_frontend_nlb_tcp_network_throughput.yml'

/v2/monitoring/metrics/load_balancer/frontend_nlb_udp_network_throughput:
get:
$ref: 'resources/monitoring/monitoring_get_lb_frontend_nlb_udp_network_throughput.yml'

/v2/monitoring/metrics/load_balancer/frontend_tls_connections_current:
get:
$ref: 'resources/monitoring/monitoring_get_lb_frontend_tls_connections_current.yml'

/v2/monitoring/metrics/load_balancer/frontend_tls_connections_limit:
get:
$ref: 'resources/monitoring/monitoring_get_lb_frontend_tls_connections_limit.yml'

/v2/monitoring/metrics/load_balancer/frontend_tls_connections_exceeding_rate_limit:
get:
$ref: 'resources/monitoring/monitoring_get_lb_frontend_tls_connections_exceeding_rate_limit.yml'

/v2/monitoring/metrics/load_balancer/droplets_http_session_duration_avg:
get:
$ref: 'resources/monitoring/monitoring_get_lb_droplets_http_session_duration_avg.yml'

/v2/monitoring/metrics/load_balancer/droplets_http_session_duration_50p:
get:
$ref: 'resources/monitoring/monitoring_get_lb_droplets_http_session_duration_50p.yml'

/v2/monitoring/metrics/load_balancer/droplets_http_session_duration_95p:
get:
$ref: 'resources/monitoring/monitoring_get_lb_droplets_http_session_duration_95p.yml'

/v2/monitoring/metrics/load_balancer/droplets_http_response_time_avg:
get:
$ref: 'resources/monitoring/monitoring_get_lb_droplets_http_response_time_avg.yml'

/v2/monitoring/metrics/load_balancer/droplets_http_response_time_50p:
get:
$ref: 'resources/monitoring/monitoring_get_lb_droplets_http_response_time_50p.yml'

/v2/monitoring/metrics/load_balancer/droplets_http_response_time_95p:
get:
$ref: 'resources/monitoring/monitoring_get_lb_droplets_http_response_time_95p.yml'

/v2/monitoring/metrics/load_balancer/droplets_http_response_time_99p:
get:
$ref: 'resources/monitoring/monitoring_get_lb_droplets_http_response_time_99p.yml'

/v2/monitoring/metrics/load_balancer/droplets_queue_size:
get:
$ref: 'resources/monitoring/monitoring_get_lb_droplets_queue_size.yml'

/v2/monitoring/metrics/load_balancer/droplets_http_responses:
get:
$ref: 'resources/monitoring/monitoring_get_lb_droplets_http_responses.yml'

/v2/monitoring/metrics/load_balancer/droplets_connections:
get:
$ref: 'resources/monitoring/monitoring_get_lb_droplets_connections.yml'

/v2/monitoring/metrics/load_balancer/droplets_health_checks:
get:
$ref: 'resources/monitoring/monitoring_get_lb_droplets_health_checks.yml'

/v2/monitoring/metrics/load_balancer/droplets_downtime:
get:
$ref: 'resources/monitoring/monitoring_get_lb_droplets_downtime.yml'

/v2/projects:
get:
$ref: 'resources/projects/projects_list.yml'
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
lang: cURL
source: |-
curl -X GET \
-H "Content-Type: application/json" \
-H "Authorization: Bearer $DIGITALOCEAN_TOKEN" \
"https://api.digitalocean.com/v2/monitoring/metrics/load_balancer/droplets_connections?lb_id=4de7ac8b-495b-4884-9a69-1050c6793cd6&start=1636051668&end=1636051668"
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
lang: cURL
source: |-
curl -X GET \
-H "Content-Type: application/json" \
-H "Authorization: Bearer $DIGITALOCEAN_TOKEN" \
"https://api.digitalocean.com/v2/monitoring/metrics/load_balancer/droplets_downtime?lb_id=4de7ac8b-495b-4884-9a69-1050c6793cd6&start=1636051668&end=1636051668"
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
lang: cURL
source: |-
curl -X GET \
-H "Content-Type: application/json" \
-H "Authorization: Bearer $DIGITALOCEAN_TOKEN" \
"https://api.digitalocean.com/v2/monitoring/metrics/load_balancer/droplets_health_checks?lb_id=4de7ac8b-495b-4884-9a69-1050c6793cd6&start=1636051668&end=1636051668"
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
lang: cURL
source: |-
curl -X GET \
-H "Content-Type: application/json" \
-H "Authorization: Bearer $DIGITALOCEAN_TOKEN" \
"https://api.digitalocean.com/v2/monitoring/metrics/load_balancer/droplets_http_response_time_50p?lb_id=4de7ac8b-495b-4884-9a69-1050c6793cd6&start=1636051668&end=1636051668"
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
lang: cURL
source: |-
curl -X GET \
-H "Content-Type: application/json" \
-H "Authorization: Bearer $DIGITALOCEAN_TOKEN" \
"https://api.digitalocean.com/v2/monitoring/metrics/load_balancer/droplets_http_response_time_95p?lb_id=4de7ac8b-495b-4884-9a69-1050c6793cd6&start=1636051668&end=1636051668"
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
lang: cURL
source: |-
curl -X GET \
-H "Content-Type: application/json" \
-H "Authorization: Bearer $DIGITALOCEAN_TOKEN" \
"https://api.digitalocean.com/v2/monitoring/metrics/load_balancer/droplets_http_response_time_99p?lb_id=4de7ac8b-495b-4884-9a69-1050c6793cd6&start=1636051668&end=1636051668"
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
lang: cURL
source: |-
curl -X GET \
-H "Content-Type: application/json" \
-H "Authorization: Bearer $DIGITALOCEAN_TOKEN" \
"https://api.digitalocean.com/v2/monitoring/metrics/load_balancer/droplets_http_response_time_avg?lb_id=4de7ac8b-495b-4884-9a69-1050c6793cd6&start=1636051668&end=1636051668"
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
lang: cURL
source: |-
curl -X GET \
-H "Content-Type: application/json" \
-H "Authorization: Bearer $DIGITALOCEAN_TOKEN" \
"https://api.digitalocean.com/v2/monitoring/metrics/load_balancer/droplets_http_responses?lb_id=4de7ac8b-495b-4884-9a69-1050c6793cd6&start=1636051668&end=1636051668"
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
lang: cURL
source: |-
curl -X GET \
-H "Content-Type: application/json" \
-H "Authorization: Bearer $DIGITALOCEAN_TOKEN" \
"https://api.digitalocean.com/v2/monitoring/metrics/load_balancer/droplets_http_session_duration_50p?lb_id=4de7ac8b-495b-4884-9a69-1050c6793cd6&start=1636051668&end=1636051668"
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
lang: cURL
source: |-
curl -X GET \
-H "Content-Type: application/json" \
-H "Authorization: Bearer $DIGITALOCEAN_TOKEN" \
"https://api.digitalocean.com/v2/monitoring/metrics/load_balancer/droplets_http_session_duration_95p?lb_id=4de7ac8b-495b-4884-9a69-1050c6793cd6&start=1636051668&end=1636051668"
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
lang: cURL
source: |-
curl -X GET \
-H "Content-Type: application/json" \
-H "Authorization: Bearer $DIGITALOCEAN_TOKEN" \
"https://api.digitalocean.com/v2/monitoring/metrics/load_balancer/droplets_http_session_duration_avg?lb_id=4de7ac8b-495b-4884-9a69-1050c6793cd6&start=1636051668&end=1636051668"
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
lang: cURL
source: |-
curl -X GET \
-H "Content-Type: application/json" \
-H "Authorization: Bearer $DIGITALOCEAN_TOKEN" \
"https://api.digitalocean.com/v2/monitoring/metrics/load_balancer/droplets_queue_size?lb_id=4de7ac8b-495b-4884-9a69-1050c6793cd6&start=1636051668&end=1636051668"
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
lang: cURL
source: |-
curl -X GET \
-H "Content-Type: application/json" \
-H "Authorization: Bearer $DIGITALOCEAN_TOKEN" \
"https://api.digitalocean.com/v2/monitoring/metrics/load_balancer/frontend_connections_current?lb_id=4de7ac8b-495b-4884-9a69-1050c6793cd6&start=1636051668&end=1636051668"
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
lang: cURL
source: |-
curl -X GET \
-H "Content-Type: application/json" \
-H "Authorization: Bearer $DIGITALOCEAN_TOKEN" \
"https://api.digitalocean.com/v2/monitoring/metrics/load_balancer/frontend_connections_limit?lb_id=4de7ac8b-495b-4884-9a69-1050c6793cd6&start=1636051668&end=1636051668"
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
lang: cURL
source: |-
curl -X GET \
-H "Content-Type: application/json" \
-H "Authorization: Bearer $DIGITALOCEAN_TOKEN" \
"https://api.digitalocean.com/v2/monitoring/metrics/load_balancer/frontend_cpu_utilization?lb_id=4de7ac8b-495b-4884-9a69-1050c6793cd6&start=1636051668&end=1636051668"
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
lang: cURL
source: |-
curl -X GET \
-H "Content-Type: application/json" \
-H "Authorization: Bearer $DIGITALOCEAN_TOKEN" \
"https://api.digitalocean.com/v2/monitoring/metrics/load_balancer/frontend_firewall_dropped_bytes?lb_id=4de7ac8b-495b-4884-9a69-1050c6793cd6&start=1636051668&end=1636051668"
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
lang: cURL
source: |-
curl -X GET \
-H "Content-Type: application/json" \
-H "Authorization: Bearer $DIGITALOCEAN_TOKEN" \
"https://api.digitalocean.com/v2/monitoring/metrics/load_balancer/frontend_firewall_dropped_packets?lb_id=4de7ac8b-495b-4884-9a69-1050c6793cd6&start=1636051668&end=1636051668"
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
lang: cURL
source: |-
curl -X GET \
-H "Content-Type: application/json" \
-H "Authorization: Bearer $DIGITALOCEAN_TOKEN" \
"https://api.digitalocean.com/v2/monitoring/metrics/load_balancer/frontend_http_requests_per_second?lb_id=4de7ac8b-495b-4884-9a69-1050c6793cd6&start=1636051668&end=1636051668"
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
lang: cURL
source: |-
curl -X GET \
-H "Content-Type: application/json" \
-H "Authorization: Bearer $DIGITALOCEAN_TOKEN" \
"https://api.digitalocean.com/v2/monitoring/metrics/load_balancer/frontend_http_responses?lb_id=4de7ac8b-495b-4884-9a69-1050c6793cd6&start=1636051668&end=1636051668"
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
lang: cURL
source: |-
curl -X GET \
-H "Content-Type: application/json" \
-H "Authorization: Bearer $DIGITALOCEAN_TOKEN" \
"https://api.digitalocean.com/v2/monitoring/metrics/load_balancer/frontend_network_throughput_http?lb_id=4de7ac8b-495b-4884-9a69-1050c6793cd6&start=1636051668&end=1636051668"
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
lang: cURL
source: |-
curl -X GET \
-H "Content-Type: application/json" \
-H "Authorization: Bearer $DIGITALOCEAN_TOKEN" \
"https://api.digitalocean.com/v2/monitoring/metrics/load_balancer/frontend_network_throughput_tcp?lb_id=4de7ac8b-495b-4884-9a69-1050c6793cd6&start=1636051668&end=1636051668"
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
lang: cURL
source: |-
curl -X GET \
-H "Content-Type: application/json" \
-H "Authorization: Bearer $DIGITALOCEAN_TOKEN" \
"https://api.digitalocean.com/v2/monitoring/metrics/load_balancer/frontend_network_throughput_udp?lb_id=4de7ac8b-495b-4884-9a69-1050c6793cd6&start=1636051668&end=1636051668"
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
lang: cURL
source: |-
curl -X GET \
-H "Content-Type: application/json" \
-H "Authorization: Bearer $DIGITALOCEAN_TOKEN" \
"https://api.digitalocean.com/v2/monitoring/metrics/load_balancer/frontend_nlb_tcp_network_throughput?lb_id=4de7ac8b-495b-4884-9a69-1050c6793cd6&start=1636051668&end=1636051668"
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
lang: cURL
source: |-
curl -X GET \
-H "Content-Type: application/json" \
-H "Authorization: Bearer $DIGITALOCEAN_TOKEN" \
"https://api.digitalocean.com/v2/monitoring/metrics/load_balancer/frontend_nlb_udp_network_throughput?lb_id=4de7ac8b-495b-4884-9a69-1050c6793cd6&start=1636051668&end=1636051668"
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
lang: cURL
source: |-
curl -X GET \
-H "Content-Type: application/json" \
-H "Authorization: Bearer $DIGITALOCEAN_TOKEN" \
"https://api.digitalocean.com/v2/monitoring/metrics/load_balancer/frontend_tls_connections_current?lb_id=4de7ac8b-495b-4884-9a69-1050c6793cd6&start=1636051668&end=1636051668"
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
lang: cURL
source: |-
curl -X GET \
-H "Content-Type: application/json" \
-H "Authorization: Bearer $DIGITALOCEAN_TOKEN" \
"https://api.digitalocean.com/v2/monitoring/metrics/load_balancer/frontend_tls_connections_exceeding_rate_limit?lb_id=4de7ac8b-495b-4884-9a69-1050c6793cd6&start=1636051668&end=1636051668"
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
lang: cURL
source: |-
curl -X GET \
-H "Content-Type: application/json" \
-H "Authorization: Bearer $DIGITALOCEAN_TOKEN" \
"https://api.digitalocean.com/v2/monitoring/metrics/load_balancer/frontend_tls_connections_limit?lb_id=4de7ac8b-495b-4884-9a69-1050c6793cd6&start=1636051668&end=1636051668"
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
operationId: monitoring_get_lb_droplets_connections

summary: Get Load Balancer Droplets Active Connections Metrics

description: >-
To retrieve Droplets active connections for a given load balancer, send a GET request to `/v2/monitoring/metrics/load_balancer/droplets_connections`.
tags:
- Monitoring

responses:
'200':
$ref: 'responses/metric_response.yml'

'401':
$ref: '../../shared/responses/unauthorized.yml'

'429':
$ref: '../../shared/responses/too_many_requests.yml'

'500':
$ref: '../../shared/responses/server_error.yml'

default:
$ref: '../../shared/responses/unexpected_error.yml'

parameters:
- $ref: 'parameters.yml#/load_balancer_id'
- $ref: 'parameters.yml#/metric_timestamp_start'
- $ref: 'parameters.yml#/metric_timestamp_end'

x-codeSamples:
- $ref: 'examples/curl/monitoring_get_lb_droplets_connections.yml'

security:
- bearer_auth:
- 'monitoring:read'
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
operationId: monitoring_get_lb_droplets_downtime

summary: Get Load Balancer Droplets Downtime Status Metrics

description: >-
To retrieve Droplets downtime status for a given load balancer, send a GET request to `/v2/monitoring/metrics/load_balancer/droplets_downtime`.
tags:
- Monitoring

responses:
'200':
$ref: 'responses/metric_response.yml'

'401':
$ref: '../../shared/responses/unauthorized.yml'

'429':
$ref: '../../shared/responses/too_many_requests.yml'

'500':
$ref: '../../shared/responses/server_error.yml'

default:
$ref: '../../shared/responses/unexpected_error.yml'

parameters:
- $ref: 'parameters.yml#/load_balancer_id'
- $ref: 'parameters.yml#/metric_timestamp_start'
- $ref: 'parameters.yml#/metric_timestamp_end'

x-codeSamples:
- $ref: 'examples/curl/monitoring_get_lb_droplets_downtime.yml'

security:
- bearer_auth:
- 'monitoring:read'
Loading

0 comments on commit 312be69

Please sign in to comment.