fog-google 0.5.5 → 0.6.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +6 -1
- data/examples/monitoring/metric_descriptors.rb +1 -1
- data/examples/monitoring/monitored_resource_descriptors.rb +24 -0
- data/examples/monitoring/timeseries_collection.rb +13 -8
- data/lib/fog/google/models/monitoring/metric_descriptor.rb +7 -4
- data/lib/fog/google/models/monitoring/metric_descriptors.rb +4 -6
- data/lib/fog/google/models/monitoring/monitored_resource_descriptor.rb +20 -0
- data/lib/fog/google/models/monitoring/monitored_resource_descriptors.rb +26 -0
- data/lib/fog/google/models/monitoring/timeseries.rb +5 -3
- data/lib/fog/google/models/monitoring/timeseries_collection.rb +19 -12
- data/lib/fog/google/monitoring.rb +10 -10
- data/lib/fog/google/monitoring/mock.rb +1 -1
- data/lib/fog/google/monitoring/real.rb +1 -1
- data/lib/fog/google/requests/monitoring/list_metric_descriptors.rb +181 -124
- data/lib/fog/google/requests/monitoring/list_monitored_resource_descriptors.rb +63 -0
- data/lib/fog/google/requests/monitoring/list_timeseries.rb +50 -31
- data/lib/fog/google/version.rb +1 -1
- metadata +7 -13
- data/examples/monitoring/timeseries_descriptors.rb +0 -27
- data/lib/fog/google/models/monitoring/timeseries_descriptor.rb +0 -20
- data/lib/fog/google/models/monitoring/timeseries_descriptors.rb +0 -31
- data/lib/fog/google/requests/monitoring/list_timeseries_descriptors.rb +0 -87
- data/tests/models/monitoring/metric_descriptors_tests.rb +0 -9
- data/tests/models/monitoring/timeseries_collection_tests.rb +0 -9
- data/tests/models/monitoring/timeseries_descriptors_tests.rb +0 -10
- data/tests/requests/monitoring/metric_descriptor_tests.rb +0 -22
- data/tests/requests/monitoring/timeseries_collection_tests.rb +0 -22
- data/tests/requests/monitoring/timeseries_descriptor_tests.rb +0 -23
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 9f523ba80fe04d0964f24b91dd5972d5a1761171
|
4
|
+
data.tar.gz: 0ec90da4720232b7cecec4262c4f2f93798b0366
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 5188db685057edfdd2d96e0a754a66aedb81ef62e416086f9888ca4dc851d1338bac5e46c4ae0d21e83fbbee73518474d9ef96a6868df2510b2dae06ee18abb8
|
7
|
+
data.tar.gz: b6620918dd17cb4e759e1cde19b90e322039b00779f78a0c4ef70539d47b3fd881fafa7df1a9ed3faba162a51c70a10204a4bc3c8a18e350a59e87b4c279f746
|
data/README.md
CHANGED
@@ -34,7 +34,12 @@ Fog implements [v1](https://cloud.google.com/dns/api/v1/) of the Google Cloud DN
|
|
34
34
|
|
35
35
|
## Monitoring
|
36
36
|
|
37
|
-
Fog implements [
|
37
|
+
Fog mostly implements [v3](https://cloud.google.com/monitoring/api/ref_v3/rest/) of the Google Cloud Monitoring API.
|
38
|
+
|
39
|
+
As of 2017-09-26, some less common API methods are missing and may be added as requested. Feature requests or pull requests for
|
40
|
+
additions are welcome.
|
41
|
+
|
42
|
+
We are always looking for people to improve our code and test coverage, so please [file issues](https://github.com/fog/fog-google/issues) for any anomalies you see or features you would like.
|
38
43
|
|
39
44
|
## Pubsub
|
40
45
|
|
@@ -17,7 +17,7 @@ def test
|
|
17
17
|
|
18
18
|
puts "\nListing all MetricDescriptors related to Google Compute Engine..."
|
19
19
|
puts "-----------------------------------------------------------------"
|
20
|
-
md = connection.metric_descriptors.all(:
|
20
|
+
md = connection.metric_descriptors.all(:filter => 'metric.type = starts_with("compute.googleapis.com")')
|
21
21
|
puts "Number of compute metric descriptors: #{md.length}"
|
22
22
|
end
|
23
23
|
|
@@ -0,0 +1,24 @@
|
|
1
|
+
# All examples presume that you have a ~/.fog credentials file set up.
|
2
|
+
# # More info on it can be found here: http://fog.io/about/getting_started.html
|
3
|
+
#
|
4
|
+
require "bundler"
|
5
|
+
Bundler.require(:default, :development)
|
6
|
+
# Uncomment this if you want to make real requests to GCE (you _will_ be billed!)
|
7
|
+
# WebMock.disable!
|
8
|
+
#
|
9
|
+
|
10
|
+
def test
|
11
|
+
connection = Fog::Google::Monitoring.new
|
12
|
+
|
13
|
+
puts "Listing all MonitoredResourceDescriptors..."
|
14
|
+
puts "--------------------------------"
|
15
|
+
md = connection.monitored_resource_descriptors
|
16
|
+
puts "Number of all monitored resource descriptors: #{md.length}"
|
17
|
+
|
18
|
+
puts "\nListing MonitoredResourceDescriptors related to Google Compute Engine..."
|
19
|
+
puts "-----------------------------------------------------------------"
|
20
|
+
md = connection.monitored_resource_descriptors.all(:filter => 'resource.type = starts_with("gce_")')
|
21
|
+
puts "Number of compute monitored resource : #{md.length}"
|
22
|
+
end
|
23
|
+
|
24
|
+
test
|
@@ -8,19 +8,24 @@ Bundler.require(:default, :development)
|
|
8
8
|
|
9
9
|
def test
|
10
10
|
connection = Fog::Google::Monitoring.new
|
11
|
-
|
12
|
-
|
11
|
+
interval = {
|
12
|
+
:start_time => (DateTime.now - 1).rfc3339,
|
13
|
+
:end_time => DateTime.now.rfc3339
|
14
|
+
}
|
15
|
+
puts "Listing Timeseries from the last hour for metric compute.googleapis.com/instance/uptime..."
|
13
16
|
puts "-------------------------------------------------------------------------------"
|
14
|
-
tc = connection.timeseries_collection.all("compute.googleapis.com/instance/uptime",
|
15
|
-
|
17
|
+
tc = connection.timeseries_collection.all(:filter => 'metric.type = "compute.googleapis.com/instance/uptime"',
|
18
|
+
:interval => interval)
|
16
19
|
puts "Number of matches: #{tc.length}"
|
17
20
|
|
18
|
-
puts "\nListing all Timeseries for
|
21
|
+
puts "\nListing all Timeseries for metric compute.googleapis.com/instance/uptime &"
|
19
22
|
puts "the region us-central1..."
|
20
23
|
puts "------------------------------------------------------------------------------"
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
+
filter = [
|
25
|
+
'metric.type = "compute.googleapis.com/instance/uptime"',
|
26
|
+
'resource.label.zone = "us-central1-c"'
|
27
|
+
].join(" AND ")
|
28
|
+
tc = connection.timeseries_collection.all(:filter => filter, :interval => interval)
|
24
29
|
puts "Number of matches: #{tc.length}"
|
25
30
|
end
|
26
31
|
|
@@ -4,16 +4,19 @@ module Fog
|
|
4
4
|
module Google
|
5
5
|
class Monitoring
|
6
6
|
##
|
7
|
-
# A metricDescriptor defines
|
7
|
+
# A metricDescriptor defines a metric type and its schema.
|
8
8
|
#
|
9
|
-
# @see https://cloud.google.com/monitoring/
|
9
|
+
# @see https://cloud.google.com/monitoring/api/ref_v3/rest/v3/projects.metricDescriptors#MetricDescriptor
|
10
10
|
class MetricDescriptor < Fog::Model
|
11
11
|
identity :name
|
12
12
|
|
13
13
|
attribute :description
|
14
|
+
attribute :display_name, :aliases => "displayName"
|
14
15
|
attribute :labels
|
15
|
-
attribute :
|
16
|
-
attribute :
|
16
|
+
attribute :metric_kind, :aliases => "metricKind"
|
17
|
+
attribute :type
|
18
|
+
attribute :value_type, :aliases => "valueType"
|
19
|
+
attribute :unit
|
17
20
|
end
|
18
21
|
end
|
19
22
|
end
|
@@ -11,15 +11,13 @@ module Fog
|
|
11
11
|
# Lists all Metric Descriptors.
|
12
12
|
#
|
13
13
|
# @param [Hash] options Optional query parameters.
|
14
|
-
# @option options [String]
|
14
|
+
# @option options [String] page_size Maximum number of metric descriptors per page. Used for pagination.
|
15
15
|
# @option options [String] page_token The pagination token, which is used to page through large result sets.
|
16
|
-
# @option options [String]
|
17
|
-
#
|
18
|
-
# If this field is omitted, all metrics are returned. If an empty string is passed with this field,
|
19
|
-
# no metrics are returned.
|
16
|
+
# @option options [String] filter Monitoring filter specifying which metric descriptors are to be returned.
|
17
|
+
# @see https://cloud.google.com/monitoring/api/v3/filters filter documentation
|
20
18
|
# @return [Array<Fog::Google::Monitoring::MetricDescriptor>] List of Metric Descriptors.
|
21
19
|
def all(options = {})
|
22
|
-
data = service.list_metric_descriptors(options).body["
|
20
|
+
data = service.list_metric_descriptors(options).body["metricDescriptors"] || []
|
23
21
|
load(data)
|
24
22
|
end
|
25
23
|
end
|
@@ -0,0 +1,20 @@
|
|
1
|
+
require "fog/core/model"
|
2
|
+
|
3
|
+
module Fog
|
4
|
+
module Google
|
5
|
+
class Monitoring
|
6
|
+
##
|
7
|
+
# A monitoredResourceDescriptor defines a metric type and its schema.
|
8
|
+
#
|
9
|
+
# @see https://cloud.google.com/monitoring/api/ref_v3/rest/v3/projects.monitoredResourceDescriptors#MonitoredResourceDescriptor
|
10
|
+
class MonitoredResourceDescriptor < Fog::Model
|
11
|
+
identity :name
|
12
|
+
|
13
|
+
attribute :description
|
14
|
+
attribute :display_name, :aliases => "displayName"
|
15
|
+
attribute :type
|
16
|
+
attribute :labels
|
17
|
+
end
|
18
|
+
end
|
19
|
+
end
|
20
|
+
end
|
@@ -0,0 +1,26 @@
|
|
1
|
+
require "fog/core/collection"
|
2
|
+
require "fog/google/models/monitoring/monitored_resource_descriptor"
|
3
|
+
|
4
|
+
module Fog
|
5
|
+
module Google
|
6
|
+
class Monitoring
|
7
|
+
class MonitoredResourceDescriptors < Fog::Collection
|
8
|
+
model Fog::Google::Monitoring::MonitoredResourceDescriptor
|
9
|
+
|
10
|
+
##
|
11
|
+
# Lists all Monitored Resource Descriptors.
|
12
|
+
#
|
13
|
+
# @param [Hash] options Optional query parameters.
|
14
|
+
# @option options [String] page_size Maximum number of metric descriptors per page. Used for pagination.
|
15
|
+
# @option options [String] page_token The pagination token, which is used to page through large result sets.
|
16
|
+
# @option options [String] filter The monitoring filter used to search against existing descriptors.
|
17
|
+
# See
|
18
|
+
# @return [Array<Fog::Google::Monitoring::MetricDescriptor>] List of Monitored Resource Descriptors.
|
19
|
+
def all(options = {})
|
20
|
+
data = service.list_monitored_resource_descriptors(options).body["resourceDescriptors"] || []
|
21
|
+
load(data)
|
22
|
+
end
|
23
|
+
end
|
24
|
+
end
|
25
|
+
end
|
26
|
+
end
|
@@ -6,10 +6,12 @@ module Fog
|
|
6
6
|
##
|
7
7
|
# A time series is a collection of data points that represents the value of a metric of a project over time.
|
8
8
|
#
|
9
|
-
#
|
9
|
+
# https://cloud.google.com/monitoring/api/ref_v3/rest/v3/projects.timeSeries/list
|
10
10
|
class Timeseries < Fog::Model
|
11
|
-
|
12
|
-
|
11
|
+
attribute :metric
|
12
|
+
attribute :resource
|
13
|
+
attribute :metric_kind, :aliases => "metricKind"
|
14
|
+
attribute :value_type, :aliases => "valueType"
|
13
15
|
attribute :points
|
14
16
|
end
|
15
17
|
end
|
@@ -10,19 +10,26 @@ module Fog
|
|
10
10
|
##
|
11
11
|
# Lists all Timeseries.
|
12
12
|
#
|
13
|
-
# @param [
|
14
|
-
# @
|
15
|
-
#
|
16
|
-
#
|
17
|
-
# @option options [
|
18
|
-
# @option
|
19
|
-
#
|
20
|
-
# @
|
21
|
-
# @
|
22
|
-
#
|
13
|
+
# @param [Hash] options Query parameters.
|
14
|
+
# @option [String] filter A monitoring filter that specifies which time series should be returned.
|
15
|
+
# The filter must specify a single metric type, and can additionally specify metric labels and other
|
16
|
+
# information.
|
17
|
+
# @option options [Hash] interval Required. The time interval for which results should be returned.
|
18
|
+
# @option interval [String] end_time Required RFC3339 timestamp marking the end of interval
|
19
|
+
# @option interval [String] start_time Optional RFC3339 timestamp marking start of interval.
|
20
|
+
# @option options [Hash] aggregation
|
21
|
+
# @option aggregation [String] alignment_period
|
22
|
+
# @option aggregation [String] cross_series_reducer
|
23
|
+
# @option aggregation [String] group_by_fields
|
24
|
+
# @option aggregation [String] per_series_aligner
|
25
|
+
# @option options [String] order_by
|
26
|
+
# @option options [String] page_size
|
27
|
+
# @option options [String] page_token
|
28
|
+
# @option options [String] view
|
29
|
+
#
|
23
30
|
# @return [Array<Fog::Google::Monitoring::Timeseries>] List of Timeseries.
|
24
|
-
def all(
|
25
|
-
data = service.list_timeseries(
|
31
|
+
def all(options = {})
|
32
|
+
data = service.list_timeseries(options).body["timeSeries"] || []
|
26
33
|
load(data)
|
27
34
|
end
|
28
35
|
end
|
@@ -17,9 +17,9 @@ module Fog
|
|
17
17
|
:google_json_key_string
|
18
18
|
)
|
19
19
|
|
20
|
-
GOOGLE_MONITORING_API_VERSION = "
|
21
|
-
GOOGLE_MONITORING_BASE_URL = "https://
|
22
|
-
GOOGLE_MONITORING_API_SCOPE_URLS = %w(https://www.googleapis.com/auth/monitoring)
|
20
|
+
GOOGLE_MONITORING_API_VERSION = "v3".freeze
|
21
|
+
GOOGLE_MONITORING_BASE_URL = "https://monitoring.googleapis.com/".freeze
|
22
|
+
GOOGLE_MONITORING_API_SCOPE_URLS = %w(https://www.googleapis.com/auth/monitoring).freeze
|
23
23
|
|
24
24
|
##
|
25
25
|
# MODELS
|
@@ -29,14 +29,14 @@ module Fog
|
|
29
29
|
model :timeseries
|
30
30
|
collection :timeseries_collection
|
31
31
|
|
32
|
-
# TimeseriesDescriptors
|
33
|
-
model :timeseries_descriptor
|
34
|
-
collection :timeseries_descriptors
|
35
|
-
|
36
32
|
# MetricDescriptors
|
37
33
|
model :metric_descriptor
|
38
34
|
collection :metric_descriptors
|
39
35
|
|
36
|
+
# MonitoredResourceDescriptors
|
37
|
+
model :monitored_resource_descriptor
|
38
|
+
collection :monitored_resource_descriptors
|
39
|
+
|
40
40
|
##
|
41
41
|
# REQUESTS
|
42
42
|
request_path "fog/google/requests/monitoring"
|
@@ -44,11 +44,11 @@ module Fog
|
|
44
44
|
# Timeseries
|
45
45
|
request :list_timeseries
|
46
46
|
|
47
|
-
# TimeseriesDescriptors
|
48
|
-
request :list_timeseries_descriptors
|
49
|
-
|
50
47
|
# MetricDescriptors
|
51
48
|
request :list_metric_descriptors
|
49
|
+
|
50
|
+
# MonitoredResourceDescriptors
|
51
|
+
request :list_monitored_resource_descriptors
|
52
52
|
end
|
53
53
|
end
|
54
54
|
end
|
@@ -12,7 +12,7 @@ module Fog
|
|
12
12
|
options[:google_api_scope_url] = GOOGLE_MONITORING_API_SCOPE_URLS.join(" ")
|
13
13
|
|
14
14
|
@client = initialize_google_client(options)
|
15
|
-
@monitoring = @client.discovered_api("
|
15
|
+
@monitoring = @client.discovered_api("monitoring", api_version)
|
16
16
|
end
|
17
17
|
end
|
18
18
|
end
|
@@ -2,21 +2,20 @@ module Fog
|
|
2
2
|
module Google
|
3
3
|
class Monitoring
|
4
4
|
##
|
5
|
-
#
|
6
|
-
# will be returned.
|
5
|
+
# Lists metric descriptors that match a filter.
|
7
6
|
#
|
8
|
-
# @see https://cloud.google.com/monitoring/
|
7
|
+
# @see https://cloud.google.com/monitoring/api/ref_v3/rest/v3/projects.metricDescriptors/list
|
9
8
|
class Real
|
10
9
|
def list_metric_descriptors(options = {})
|
11
|
-
api_method = @monitoring.metric_descriptors.list
|
10
|
+
api_method = @monitoring.projects.metric_descriptors.list
|
12
11
|
parameters = {
|
13
|
-
"
|
12
|
+
"name" => "projects/#{@project}"
|
14
13
|
}
|
15
|
-
|
16
|
-
parameters["
|
14
|
+
parameters["filter"] = options[:filter] if options.key?(:filter)
|
15
|
+
parameters["pageSize"] = options[:page_size] if options.key?(:page_size)
|
17
16
|
parameters["pageToken"] = options[:page_token] if options.key?(:page_token)
|
18
|
-
parameters["query"] = options[:query] if options.key?(:query)
|
19
17
|
|
18
|
+
puts parameters
|
20
19
|
request(api_method, parameters)
|
21
20
|
end
|
22
21
|
end
|
@@ -24,161 +23,219 @@ module Fog
|
|
24
23
|
class Mock
|
25
24
|
def list_metric_descriptors(_options = {})
|
26
25
|
body = {
|
27
|
-
"
|
28
|
-
"metrics" => [
|
29
|
-
{ "name" => "compute.googleapis.com/instance/cpu/reserved_cores",
|
30
|
-
"project" => @project,
|
31
|
-
"labels" => [
|
32
|
-
{ "key" => "compute.googleapis.com/instance_name" },
|
33
|
-
{ "key" => "cloud.googleapis.com/location" },
|
34
|
-
{ "key" => "compute.googleapis.com/resource_id" },
|
35
|
-
{ "key" => "compute.googleapis.com/resource_type" },
|
36
|
-
{ "key" => "cloud.googleapis.com/service" }
|
37
|
-
],
|
38
|
-
"typeDescriptor" => { "metricType" => "gauge", "valueType" => "double" },
|
39
|
-
"description" => "Number of cores reserved on the host of the instance."
|
40
|
-
},
|
26
|
+
"metricDescriptors" => [
|
41
27
|
{
|
42
|
-
"
|
43
|
-
"
|
28
|
+
"type" => "compute.googleapis.com/instance/cpu/reserved_cores",
|
29
|
+
"name" => "projects/#{@project}/metricDescriptors/compute.googleapis.com/instance/cpu/reserved_cores",
|
44
30
|
"labels" => [
|
45
|
-
{
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
{ "key" => "cloud.googleapis.com/service" }
|
31
|
+
{
|
32
|
+
"key" => "instance_name",
|
33
|
+
"description" => "The name of the VM instance."
|
34
|
+
}
|
50
35
|
],
|
51
|
-
"
|
52
|
-
"
|
36
|
+
"metricKind" => "GAUGE",
|
37
|
+
"valueType" => "DOUBLE",
|
38
|
+
"unit" => "1",
|
39
|
+
"description" => "Number of cores reserved on the host of the instance.",
|
40
|
+
"displayName" => "Reserved cores"
|
53
41
|
},
|
54
42
|
{
|
55
|
-
"
|
56
|
-
"
|
43
|
+
"type" => "compute.googleapis.com/instance/cpu/usage_time",
|
44
|
+
"name" => "projects/#{@project}/metricDescriptors/compute.googleapis.com/instance/cpu/usage_time",
|
57
45
|
"labels" => [
|
58
|
-
{
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
{ "key" => "compute.googleapis.com/resource_id" },
|
63
|
-
{ "key" => "compute.googleapis.com/resource_type" },
|
64
|
-
{ "key" => "cloud.googleapis.com/service" }
|
46
|
+
{
|
47
|
+
"key" => "instance_name",
|
48
|
+
"description" => "The name of the VM instance."
|
49
|
+
}
|
65
50
|
],
|
66
|
-
"
|
67
|
-
"
|
51
|
+
"metricKind" => "DELTA",
|
52
|
+
"valueType" => "DOUBLE",
|
53
|
+
"unit" => "s",
|
54
|
+
"description" => "Delta CPU usage for all cores, in seconds. To compute the per-core CPU utilization fraction, divide this value by (end-start)*N, where end and start define this value's time interval and N is `compute.googleapis.com/instance/cpu/reserved_cores` at the end of the interval.",
|
55
|
+
"displayName" => "CPU usage"
|
68
56
|
},
|
69
57
|
{
|
70
|
-
"
|
71
|
-
"
|
58
|
+
"type" => "compute.googleapis.com/instance/disk/read_bytes_count",
|
59
|
+
"name" => "projects/#{@project}/metricDescriptors/compute.googleapis.com/instance/disk/read_bytes_count",
|
72
60
|
"labels" => [
|
73
|
-
{
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
{
|
78
|
-
|
79
|
-
|
61
|
+
{
|
62
|
+
"key" => "instance_name",
|
63
|
+
"description" => "The name of the VM instance."
|
64
|
+
},
|
65
|
+
{
|
66
|
+
"key" => "device_name",
|
67
|
+
"description" => "The name of the disk device."
|
68
|
+
},
|
69
|
+
{
|
70
|
+
"key" => "storage_type",
|
71
|
+
"description" => "The storage type => `pd-standard` or `pd-ssd`."
|
72
|
+
},
|
73
|
+
{
|
74
|
+
"key" => "device_type",
|
75
|
+
"description" => "The disk type => `ephemeral` or `permanent`."
|
76
|
+
}
|
80
77
|
],
|
81
|
-
"
|
82
|
-
"
|
78
|
+
"metricKind" => "DELTA",
|
79
|
+
"valueType" => "INT64",
|
80
|
+
"unit" => "By",
|
81
|
+
"description" => "Delta count of bytes read from disk.",
|
82
|
+
"displayName" => "Disk read bytes"
|
83
83
|
},
|
84
84
|
{
|
85
|
-
"name" => "compute.googleapis.com/instance/disk/
|
86
|
-
"project" => @project,
|
85
|
+
"name" => "projects/#{@project}/metricDescriptors/compute.googleapis.com/instance/disk/read_ops_count",
|
87
86
|
"labels" => [
|
88
|
-
{
|
89
|
-
|
90
|
-
|
91
|
-
|
92
|
-
{
|
93
|
-
|
94
|
-
|
87
|
+
{
|
88
|
+
"key" => "instance_name",
|
89
|
+
"description" => "The name of the VM instance."
|
90
|
+
},
|
91
|
+
{
|
92
|
+
"key" => "device_name",
|
93
|
+
"description" => "The name of the disk device."
|
94
|
+
},
|
95
|
+
{
|
96
|
+
"key" => "storage_type",
|
97
|
+
"description" => "The storage type => `pd-standard` or `pd-ssd`."
|
98
|
+
},
|
99
|
+
{
|
100
|
+
"key" => "device_type",
|
101
|
+
"description" => "The disk type => `ephemeral` or `permanent`."
|
102
|
+
}
|
95
103
|
],
|
96
|
-
"
|
97
|
-
"
|
104
|
+
"metricKind" => "DELTA",
|
105
|
+
"valueType" => "INT64",
|
106
|
+
"unit" => "1",
|
107
|
+
"description" => "Delta count of disk read IO operations.",
|
108
|
+
"displayName" => "Disk read operations",
|
109
|
+
"type" => "compute.googleapis.com/instance/disk/read_ops_count"
|
98
110
|
},
|
99
111
|
{
|
100
|
-
"
|
101
|
-
"
|
112
|
+
"type" => "compute.googleapis.com/instance/disk/write_bytes_count",
|
113
|
+
"name" => "projects/#{@project}/metricDescriptors/compute.googleapis.com/instance/disk/write_bytes_count",
|
102
114
|
"labels" => [
|
103
|
-
{
|
104
|
-
|
105
|
-
|
106
|
-
|
107
|
-
{
|
108
|
-
|
109
|
-
|
115
|
+
{
|
116
|
+
"key" => "instance_name",
|
117
|
+
"description" => "The name of the VM instance."
|
118
|
+
},
|
119
|
+
{
|
120
|
+
"key" => "device_name",
|
121
|
+
"description" => "The name of the disk device."
|
122
|
+
},
|
123
|
+
{
|
124
|
+
"key" => "storage_type",
|
125
|
+
"description" => "The storage type => `pd-standard` or `pd-ssd`."
|
126
|
+
},
|
127
|
+
{
|
128
|
+
"key" => "device_type",
|
129
|
+
"description" => "The disk type => `ephemeral` or `permanent`."
|
130
|
+
}
|
110
131
|
],
|
111
|
-
"
|
112
|
-
"
|
132
|
+
"metricKind" => "DELTA",
|
133
|
+
"valueType" => "INT64",
|
134
|
+
"unit" => "By",
|
135
|
+
"description" => "Delta count of bytes written to disk.",
|
136
|
+
"displayName" => "Disk write bytes"
|
113
137
|
},
|
114
138
|
{
|
115
|
-
"
|
116
|
-
"
|
139
|
+
"type" => "compute.googleapis.com/instance/disk/write_ops_count",
|
140
|
+
"name" => "projects/#{@project}/metricDescriptors/compute.googleapis.com/instance/disk/write_ops_count",
|
117
141
|
"labels" => [
|
118
|
-
{
|
119
|
-
|
120
|
-
|
121
|
-
|
122
|
-
{
|
123
|
-
|
142
|
+
{
|
143
|
+
"key" => "instance_name",
|
144
|
+
"description" => "The name of the VM instance."
|
145
|
+
},
|
146
|
+
{
|
147
|
+
"key" => "device_name",
|
148
|
+
"description" => "The name of the disk device."
|
149
|
+
},
|
150
|
+
{
|
151
|
+
"key" => "storage_type",
|
152
|
+
"description" => "The storage type => `pd-standard` or `pd-ssd`."
|
153
|
+
},
|
154
|
+
{
|
155
|
+
"key" => "device_type",
|
156
|
+
"description" => "The disk type => `ephemeral` or `permanent`."
|
157
|
+
}
|
124
158
|
],
|
125
|
-
"
|
126
|
-
"
|
159
|
+
"metricKind" => "DELTA",
|
160
|
+
"valueType" => "INT64",
|
161
|
+
"unit" => "1",
|
162
|
+
"description" => "Delta count of disk write IO operations.",
|
163
|
+
"displayName" => "Disk write operations"
|
127
164
|
},
|
128
165
|
{
|
129
|
-
"
|
130
|
-
"
|
166
|
+
"type" => "compute.googleapis.com/instance/network/received_packets_count",
|
167
|
+
"name" => "projects/#{@project}/metricDescriptors/compute.googleapis.com/instance/network/received_packets_count",
|
131
168
|
"labels" => [
|
132
|
-
{
|
133
|
-
|
134
|
-
|
135
|
-
|
136
|
-
{
|
137
|
-
|
169
|
+
{
|
170
|
+
"key" => "instance_name",
|
171
|
+
"description" => "The name of the VM instance."
|
172
|
+
},
|
173
|
+
{
|
174
|
+
"key" => "loadbalanced",
|
175
|
+
"valueType" => "BOOL",
|
176
|
+
"description" => "Whether traffic was received by an L3 loadbalanced IP address assigned to the VM. Traffic that is externally routed to the VM's standard internal or external IP address, such as L7 loadbalanced traffic, is not considered to be loadbalanced in this metric."
|
177
|
+
}
|
138
178
|
],
|
139
|
-
"
|
140
|
-
"
|
179
|
+
"metricKind" => "DELTA",
|
180
|
+
"valueType" => "INT64",
|
181
|
+
"unit" => "1",
|
182
|
+
"description" => "Delta count of packets received from the network.",
|
183
|
+
"displayName" => "Received packets"
|
141
184
|
},
|
142
185
|
{
|
143
|
-
"
|
144
|
-
"
|
186
|
+
"type" => "compute.googleapis.com/instance/network/sent_bytes_count",
|
187
|
+
"name" => "projects/#{@project}/metricDescriptors/compute.googleapis.com/instance/network/sent_bytes_count",
|
145
188
|
"labels" => [
|
146
|
-
{
|
147
|
-
|
148
|
-
|
149
|
-
|
150
|
-
{
|
151
|
-
|
189
|
+
{
|
190
|
+
"key" => "instance_name",
|
191
|
+
"description" => "The name of the VM instance."
|
192
|
+
},
|
193
|
+
{
|
194
|
+
"key" => "loadbalanced",
|
195
|
+
"valueType" => "BOOL",
|
196
|
+
"description" => "Whether traffic was sent from an L3 loadbalanced IP address assigned to the VM. Traffic that is externally routed from the VM's standard internal or external IP address, such as L7 loadbalanced traffic, is not considered to be loadbalanced in this metric."
|
197
|
+
}
|
152
198
|
],
|
153
|
-
"
|
154
|
-
"
|
199
|
+
"metricKind" => "DELTA",
|
200
|
+
"valueType" => "INT64",
|
201
|
+
"unit" => "By",
|
202
|
+
"description" => "Delta count of bytes sent over the network.",
|
203
|
+
"displayName" => "Sent bytes"
|
155
204
|
},
|
156
205
|
{
|
157
|
-
"
|
158
|
-
"
|
206
|
+
"type" => "compute.googleapis.com/instance/network/sent_packets_count",
|
207
|
+
"name" => "projects/#{@project}/metricDescriptors/compute.googleapis.com/instance/network/sent_packets_count",
|
159
208
|
"labels" => [
|
160
|
-
{
|
161
|
-
|
162
|
-
|
163
|
-
|
164
|
-
{
|
165
|
-
|
209
|
+
{
|
210
|
+
"key" => "instance_name",
|
211
|
+
"description" => "The name of the VM instance."
|
212
|
+
},
|
213
|
+
{
|
214
|
+
"key" => "loadbalanced",
|
215
|
+
"valueType" => "BOOL",
|
216
|
+
"description" => "Whether traffic was sent from an L3 loadbalanced IP address assigned to the VM. Traffic that is externally routed from the VM's standard internal or external IP address, such as L7 loadbalanced traffic, is not considered to be loadbalanced in this metric."
|
217
|
+
}
|
166
218
|
],
|
167
|
-
"
|
168
|
-
"
|
219
|
+
"metricKind" => "DELTA",
|
220
|
+
"valueType" => "INT64",
|
221
|
+
"unit" => "1",
|
222
|
+
"description" => "Delta count of packets sent over the network.",
|
223
|
+
"displayName" => "Sent packets"
|
169
224
|
},
|
170
225
|
{
|
171
|
-
"
|
172
|
-
"
|
226
|
+
"type" => "compute.googleapis.com/instance/uptime",
|
227
|
+
"name" => "projects/#{@project}/metricDescriptors/compute.googleapis.com/instance/uptime",
|
173
228
|
"labels" => [
|
174
|
-
{
|
175
|
-
|
176
|
-
|
177
|
-
|
178
|
-
{ "key" => "cloud.googleapis.com/service" }
|
229
|
+
{
|
230
|
+
"key" => "instance_name",
|
231
|
+
"description" => "The name of the VM instance."
|
232
|
+
}
|
179
233
|
],
|
180
|
-
"
|
181
|
-
"
|
234
|
+
"metricKind" => "DELTA",
|
235
|
+
"valueType" => "DOUBLE",
|
236
|
+
"unit" => "s",
|
237
|
+
"description" => "How long the VM has been running, in seconds.",
|
238
|
+
"displayName" => "Uptime"
|
182
239
|
}
|
183
240
|
]
|
184
241
|
}
|