Skip to content

Commit c9740f1

Browse files
committed
[Metricbeat] gcp.loadbalancing: uniform metric's fields (#28370)
(cherry picked from commit d85c826) # Conflicts: # metricbeat/docs/fields.asciidoc # x-pack/metricbeat/module/gcp/fields.go
1 parent f441b50 commit c9740f1

5 files changed

Lines changed: 121 additions & 71 deletions

File tree

metricbeat/docs/fields.asciidoc

Lines changed: 42 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -28333,12 +28333,6 @@ type: double
2833328333
Google Cloud Load Balancing metrics
2833428334

2833528335

28336-
[float]
28337-
=== https
28338-
28339-
Google Cloud Load Balancing metrics
28340-
28341-
2834228336
*`gcp.loadbalancing.https.backend_request_bytes_count.value`*::
2834328337
+
2834428338
--
@@ -28357,6 +28351,15 @@ type: long
2835728351

2835828352
--
2835928353

28354+
*`gcp.loadbalancing.https.backend_response_bytes_count.value`*::
28355+
+
28356+
--
28357+
The number of bytes sent as responses from backends (or cache) to external HTTP(S) load balancer.
28358+
28359+
type: long
28360+
28361+
--
28362+
2836028363
*`gcp.loadbalancing.https.request_bytes_count.value`*::
2836128364
+
2836228365
--
@@ -28384,11 +28387,41 @@ type: long
2838428387

2838528388
--
2838628389

28387-
[float]
28388-
=== l3.internal
28390+
*`gcp.loadbalancing.l3.external.egress_bytes_count.value`*::
28391+
+
28392+
--
28393+
The number of bytes sent from external TCP/UDP network load balancer backend to client of the flow. For TCP flows it's counting bytes on application stream only.
2838928394

28390-
Google Cloud Load Balancing metrics
28395+
type: long
28396+
28397+
--
28398+
28399+
*`gcp.loadbalancing.l3.external.egress_packets_count.value`*::
28400+
+
28401+
--
28402+
The number of packets sent from external TCP/UDP network load balancer backend to client of the flow.
2839128403

28404+
type: long
28405+
28406+
--
28407+
28408+
*`gcp.loadbalancing.l3.external.ingress_bytes_count.value`*::
28409+
+
28410+
--
28411+
The number of bytes sent from client to external TCP/UDP network load balancer backend. For TCP flows it's counting bytes on application stream only.
28412+
28413+
type: long
28414+
28415+
--
28416+
28417+
*`gcp.loadbalancing.l3.external.ingress_packets_count.value`*::
28418+
+
28419+
--
28420+
The number of packets sent from client to external TCP/UDP network load balancer backend.
28421+
28422+
type: long
28423+
28424+
--
2839228425

2839328426
*`gcp.loadbalancing.l3.internal.egress_bytes_count.value`*::
2839428427
+
@@ -28426,12 +28459,6 @@ type: long
2842628459

2842728460
--
2842828461

28429-
[float]
28430-
=== tcp_ssl_proxy
28431-
28432-
Google Cloud Load Balancing metrics
28433-
28434-
2843528462
*`gcp.loadbalancing.tcp_ssl_proxy.closed_connections.value`*::
2843628463
+
2843728464
--

x-pack/metricbeat/module/gcp/fields.go

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Lines changed: 58 additions & 55 deletions
Original file line numberDiff line numberDiff line change
@@ -1,59 +1,62 @@
11
- name: loadbalancing
2+
description: Google Cloud Load Balancing metrics
23
release: beta
34
type: group
4-
description: Google Cloud Load Balancing metrics
55
fields:
6-
- name: https
7-
type: group
8-
description: Google Cloud Load Balancing metrics
9-
fields:
10-
- name: backend_request_bytes_count.value
11-
type: long
12-
description: The number of bytes sent as requests from HTTP/S load balancer to backends.
13-
- name: backend_request_count.value
14-
type: long
15-
description: The number of requests served by backends of HTTP/S load balancer.
16-
- name: request_bytes_count.value
17-
type: long
18-
description: The number of bytes sent as requests from clients to HTTP/S load balancer.
19-
- name: request_count.value
20-
type: long
21-
description: The number of requests served by HTTP/S load balancer.
22-
- name: response_bytes_count.value
23-
type: long
24-
description: The number of bytes sent as responses from HTTP/S load balancer to clients.
25-
- name: l3.internal
26-
type: group
27-
description: Google Cloud Load Balancing metrics
28-
fields:
29-
- name: egress_bytes_count.value
30-
type: long
31-
description: The number of bytes sent from ILB backend to client (for TCP flows it's counting bytes on application stream only).
32-
- name: egress_packets_count.value
33-
type: long
34-
description: The number of packets sent from ILB backend to client of the flow.
35-
- name: ingress_bytes_count.value
36-
type: long
37-
description: The number of bytes sent from client to ILB backend (for TCP flows it's counting bytes on application stream only).
38-
- name: ingress_packets_count.value
39-
type: long
40-
description: The number of packets sent from client to ILB backend.
41-
- name: tcp_ssl_proxy
42-
type: group
43-
description: Google Cloud Load Balancing metrics
44-
fields:
45-
- name: closed_connections.value
46-
type: long
47-
description: Number of connections that were terminated over TCP/SSL proxy.
48-
- name: egress_bytes_count.value
49-
type: long
50-
description: Number of bytes sent from VM to client using proxy.
51-
- name: ingress_bytes_count.value
52-
type: long
53-
description: Number of bytes sent from client to VM using proxy.
54-
- name: new_connections.value
55-
type: long
56-
description: Number of connections that were created over TCP/SSL proxy.
57-
- name: open_connections.value
58-
type: long
59-
description: Current number of outstanding connections through the TCP/SSL proxy.
6+
- name: https.backend_request_bytes_count.value
7+
type: long
8+
description: The number of bytes sent as requests from HTTP/S load balancer to backends.
9+
- name: https.backend_request_count.value
10+
type: long
11+
description: The number of requests served by backends of HTTP/S load balancer.
12+
- name: https.backend_response_bytes_count.value
13+
type: long
14+
description: The number of bytes sent as responses from backends (or cache) to external HTTP(S) load balancer.
15+
- name: https.request_bytes_count.value
16+
type: long
17+
description: The number of bytes sent as requests from clients to HTTP/S load balancer.
18+
- name: https.request_count.value
19+
type: long
20+
description: The number of requests served by HTTP/S load balancer.
21+
- name: https.response_bytes_count.value
22+
type: long
23+
description: The number of bytes sent as responses from HTTP/S load balancer to clients.
24+
- name: l3.external.egress_bytes_count.value
25+
type: long
26+
description: The number of bytes sent from external TCP/UDP network load balancer backend to client of the flow. For TCP flows it's counting bytes on application stream only.
27+
- name: l3.external.egress_packets_count.value
28+
type: long
29+
description: The number of packets sent from external TCP/UDP network load balancer backend to client of the flow.
30+
- name: l3.external.ingress_bytes_count.value
31+
type: long
32+
description: The number of bytes sent from client to external TCP/UDP network load balancer backend. For TCP flows it's counting bytes on application stream only.
33+
- name: l3.external.ingress_packets_count.value
34+
type: long
35+
description: The number of packets sent from client to external TCP/UDP network load balancer backend.
36+
- name: l3.internal.egress_bytes_count.value
37+
type: long
38+
description: The number of bytes sent from ILB backend to client (for TCP flows it's counting bytes on application stream only).
39+
- name: l3.internal.egress_packets_count.value
40+
type: long
41+
description: The number of packets sent from ILB backend to client of the flow.
42+
- name: l3.internal.ingress_bytes_count.value
43+
type: long
44+
description: The number of bytes sent from client to ILB backend (for TCP flows it's counting bytes on application stream only).
45+
- name: l3.internal.ingress_packets_count.value
46+
type: long
47+
description: The number of packets sent from client to ILB backend.
48+
- name: tcp_ssl_proxy.closed_connections.value
49+
type: long
50+
description: Number of connections that were terminated over TCP/SSL proxy.
51+
- name: tcp_ssl_proxy.egress_bytes_count.value
52+
type: long
53+
description: Number of bytes sent from VM to client using proxy.
54+
- name: tcp_ssl_proxy.ingress_bytes_count.value
55+
type: long
56+
description: Number of bytes sent from client to VM using proxy.
57+
- name: tcp_ssl_proxy.new_connections.value
58+
type: long
59+
description: Number of connections that were created over TCP/SSL proxy.
60+
- name: tcp_ssl_proxy.open_connections.value
61+
type: long
62+
description: Current number of outstanding connections through the TCP/SSL proxy.

x-pack/metricbeat/module/gcp/loadbalancing/loadbalancing_integration_test.go

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,11 +11,27 @@ import (
1111
"fmt"
1212
"testing"
1313

14+
"github.com/stretchr/testify/assert"
15+
1416
"github.com/elastic/beats/v7/libbeat/common"
1517
mbtest "github.com/elastic/beats/v7/metricbeat/mb/testing"
1618
"github.com/elastic/beats/v7/x-pack/metricbeat/module/gcp/metrics"
1719
)
1820

21+
func TestFetch(t *testing.T) {
22+
config := metrics.GetConfigForTest(t, "loadbalancing")
23+
fmt.Printf("%+v\n", config)
24+
25+
metricSet := mbtest.NewReportingMetricSetV2WithContext(t, config)
26+
events, errs := mbtest.ReportingFetchV2WithContext(metricSet)
27+
if len(errs) > 0 {
28+
t.Fatalf("Expected 0 error, had %d. %v\n", len(errs), errs)
29+
}
30+
31+
assert.NotEmpty(t, events)
32+
mbtest.TestMetricsetFieldsDocumented(t, metricSet, events)
33+
}
34+
1935
func TestData(t *testing.T) {
2036
metricPrefixIs := func(metricPrefix string) func(e common.MapStr) bool {
2137
return func(e common.MapStr) bool {

x-pack/metricbeat/module/gcp/loadbalancing/manifest.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,10 @@ input:
1212
- "https/request_bytes_count"
1313
- "https/request_count"
1414
- "https/response_bytes_count"
15+
- "l3/external/egress_bytes_count"
16+
- "l3/external/egress_packets_count"
17+
- "l3/external/ingress_bytes_count"
18+
- "l3/external/ingress_packets_count"
1519
- "l3/internal/egress_bytes_count"
1620
- "l3/internal/egress_packets_count"
1721
- "l3/internal/ingress_bytes_count"

0 commit comments

Comments
 (0)