google-cloud-logging-v2 0.5.0 → 0.5.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/AUTHENTICATION.md +8 -8
- data/README.md +1 -1
- data/lib/google/cloud/logging/v2/config_service/client.rb +106 -88
- data/lib/google/cloud/logging/v2/logging_service/client.rb +54 -67
- data/lib/google/cloud/logging/v2/metrics_service/client.rb +49 -58
- data/lib/google/cloud/logging/v2/version.rb +1 -1
- data/proto_docs/google/api/distribution.rb +2 -2
- data/proto_docs/google/api/field_behavior.rb +7 -1
- data/proto_docs/google/api/launch_stage.rb +71 -0
- data/proto_docs/google/api/metric.rb +109 -36
- data/proto_docs/google/api/monitored_resource.rb +7 -6
- metadata +14 -9
- data/lib/google/logging/type/http_request_pb.rb +0 -38
- data/lib/google/logging/type/log_severity_pb.rb +0 -31
@@ -41,13 +41,12 @@ module Google
|
|
41
41
|
# See {::Google::Cloud::Logging::V2::LoggingService::Client::Configuration}
|
42
42
|
# for a description of the configuration fields.
|
43
43
|
#
|
44
|
-
#
|
44
|
+
# @example
|
45
45
|
#
|
46
|
-
#
|
47
|
-
#
|
48
|
-
#
|
49
|
-
#
|
50
|
-
# end
|
46
|
+
# # Modify the configuration for all LoggingService clients
|
47
|
+
# ::Google::Cloud::Logging::V2::LoggingService::Client.configure do |config|
|
48
|
+
# config.timeout = 10.0
|
49
|
+
# end
|
51
50
|
#
|
52
51
|
# @yield [config] Configure the Client client.
|
53
52
|
# @yieldparam config [Client::Configuration]
|
@@ -67,50 +66,32 @@ module Google
|
|
67
66
|
|
68
67
|
default_config.rpcs.delete_log.timeout = 60.0
|
69
68
|
default_config.rpcs.delete_log.retry_policy = {
|
70
|
-
initial_delay: 0.1,
|
71
|
-
max_delay: 60.0,
|
72
|
-
multiplier: 1.3,
|
73
|
-
retry_codes: [4, 13, 14]
|
69
|
+
initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [4, 13, 14]
|
74
70
|
}
|
75
71
|
|
76
72
|
default_config.rpcs.write_log_entries.timeout = 60.0
|
77
73
|
default_config.rpcs.write_log_entries.retry_policy = {
|
78
|
-
initial_delay: 0.1,
|
79
|
-
max_delay: 60.0,
|
80
|
-
multiplier: 1.3,
|
81
|
-
retry_codes: [4, 13, 14]
|
74
|
+
initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [4, 13, 14]
|
82
75
|
}
|
83
76
|
|
84
77
|
default_config.rpcs.list_log_entries.timeout = 60.0
|
85
78
|
default_config.rpcs.list_log_entries.retry_policy = {
|
86
|
-
initial_delay: 0.1,
|
87
|
-
max_delay: 60.0,
|
88
|
-
multiplier: 1.3,
|
89
|
-
retry_codes: [4, 13, 14]
|
79
|
+
initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [4, 13, 14]
|
90
80
|
}
|
91
81
|
|
92
82
|
default_config.rpcs.list_monitored_resource_descriptors.timeout = 60.0
|
93
83
|
default_config.rpcs.list_monitored_resource_descriptors.retry_policy = {
|
94
|
-
initial_delay: 0.1,
|
95
|
-
max_delay: 60.0,
|
96
|
-
multiplier: 1.3,
|
97
|
-
retry_codes: [4, 13, 14]
|
84
|
+
initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [4, 13, 14]
|
98
85
|
}
|
99
86
|
|
100
87
|
default_config.rpcs.list_logs.timeout = 60.0
|
101
88
|
default_config.rpcs.list_logs.retry_policy = {
|
102
|
-
initial_delay: 0.1,
|
103
|
-
max_delay: 60.0,
|
104
|
-
multiplier: 1.3,
|
105
|
-
retry_codes: [4, 13, 14]
|
89
|
+
initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [4, 13, 14]
|
106
90
|
}
|
107
91
|
|
108
92
|
default_config.rpcs.tail_log_entries.timeout = 3600.0
|
109
93
|
default_config.rpcs.tail_log_entries.retry_policy = {
|
110
|
-
initial_delay: 0.1,
|
111
|
-
max_delay: 60.0,
|
112
|
-
multiplier: 1.3,
|
113
|
-
retry_codes: [4, 13, 14]
|
94
|
+
initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [4, 13, 14]
|
114
95
|
}
|
115
96
|
|
116
97
|
default_config
|
@@ -142,19 +123,15 @@ module Google
|
|
142
123
|
##
|
143
124
|
# Create a new LoggingService client object.
|
144
125
|
#
|
145
|
-
#
|
146
|
-
#
|
147
|
-
# To create a new LoggingService client with the default
|
148
|
-
# configuration:
|
126
|
+
# @example
|
149
127
|
#
|
150
|
-
#
|
128
|
+
# # Create a client using the default configuration
|
129
|
+
# client = ::Google::Cloud::Logging::V2::LoggingService::Client.new
|
151
130
|
#
|
152
|
-
#
|
153
|
-
#
|
154
|
-
#
|
155
|
-
#
|
156
|
-
# config.timeout = 10.0
|
157
|
-
# end
|
131
|
+
# # Create a client using a custom configuration
|
132
|
+
# client = ::Google::Cloud::Logging::V2::LoggingService::Client.new do |config|
|
133
|
+
# config.timeout = 10.0
|
134
|
+
# end
|
158
135
|
#
|
159
136
|
# @yield [config] Configure the LoggingService client.
|
160
137
|
# @yieldparam config [Client::Configuration]
|
@@ -174,14 +151,13 @@ module Google
|
|
174
151
|
|
175
152
|
# Create credentials
|
176
153
|
credentials = @config.credentials
|
177
|
-
# Use self-signed JWT if the
|
154
|
+
# Use self-signed JWT if the endpoint is unchanged from default,
|
178
155
|
# but only if the default endpoint does not have a region prefix.
|
179
|
-
enable_self_signed_jwt = @config.
|
180
|
-
@config.endpoint == Client.configure.endpoint &&
|
156
|
+
enable_self_signed_jwt = @config.endpoint == Client.configure.endpoint &&
|
181
157
|
!@config.endpoint.split(".").first.include?("-")
|
182
158
|
credentials ||= Credentials.default scope: @config.scope,
|
183
159
|
enable_self_signed_jwt: enable_self_signed_jwt
|
184
|
-
if credentials.is_a?(String) || credentials.is_a?(Hash)
|
160
|
+
if credentials.is_a?(::String) || credentials.is_a?(::Hash)
|
185
161
|
credentials = Credentials.new credentials, scope: @config.scope
|
186
162
|
end
|
187
163
|
@quota_project_id = @config.quota_project
|
@@ -267,7 +243,9 @@ module Google
|
|
267
243
|
options.apply_defaults timeout: @config.rpcs.delete_log.timeout,
|
268
244
|
metadata: metadata,
|
269
245
|
retry_policy: @config.rpcs.delete_log.retry_policy
|
270
|
-
|
246
|
+
|
247
|
+
options.apply_defaults timeout: @config.timeout,
|
248
|
+
metadata: @config.metadata,
|
271
249
|
retry_policy: @config.retry_policy
|
272
250
|
|
273
251
|
@logging_service_stub.call_rpc :delete_log, request, options: options do |response, operation|
|
@@ -398,7 +376,9 @@ module Google
|
|
398
376
|
options.apply_defaults timeout: @config.rpcs.write_log_entries.timeout,
|
399
377
|
metadata: metadata,
|
400
378
|
retry_policy: @config.rpcs.write_log_entries.retry_policy
|
401
|
-
|
379
|
+
|
380
|
+
options.apply_defaults timeout: @config.timeout,
|
381
|
+
metadata: @config.metadata,
|
402
382
|
retry_policy: @config.retry_policy
|
403
383
|
|
404
384
|
@logging_service_stub.call_rpc :write_log_entries, request, options: options do |response, operation|
|
@@ -500,7 +480,9 @@ module Google
|
|
500
480
|
options.apply_defaults timeout: @config.rpcs.list_log_entries.timeout,
|
501
481
|
metadata: metadata,
|
502
482
|
retry_policy: @config.rpcs.list_log_entries.retry_policy
|
503
|
-
|
483
|
+
|
484
|
+
options.apply_defaults timeout: @config.timeout,
|
485
|
+
metadata: @config.metadata,
|
504
486
|
retry_policy: @config.retry_policy
|
505
487
|
|
506
488
|
@logging_service_stub.call_rpc :list_log_entries, request, options: options do |response, operation|
|
@@ -568,7 +550,9 @@ module Google
|
|
568
550
|
options.apply_defaults timeout: @config.rpcs.list_monitored_resource_descriptors.timeout,
|
569
551
|
metadata: metadata,
|
570
552
|
retry_policy: @config.rpcs.list_monitored_resource_descriptors.retry_policy
|
571
|
-
|
553
|
+
|
554
|
+
options.apply_defaults timeout: @config.timeout,
|
555
|
+
metadata: @config.metadata,
|
572
556
|
retry_policy: @config.retry_policy
|
573
557
|
|
574
558
|
@logging_service_stub.call_rpc :list_monitored_resource_descriptors, request, options: options do |response, operation|
|
@@ -662,7 +646,9 @@ module Google
|
|
662
646
|
options.apply_defaults timeout: @config.rpcs.list_logs.timeout,
|
663
647
|
metadata: metadata,
|
664
648
|
retry_policy: @config.rpcs.list_logs.retry_policy
|
665
|
-
|
649
|
+
|
650
|
+
options.apply_defaults timeout: @config.timeout,
|
651
|
+
metadata: @config.metadata,
|
666
652
|
retry_policy: @config.retry_policy
|
667
653
|
|
668
654
|
@logging_service_stub.call_rpc :list_logs, request, options: options do |response, operation|
|
@@ -715,7 +701,9 @@ module Google
|
|
715
701
|
options.apply_defaults timeout: @config.rpcs.tail_log_entries.timeout,
|
716
702
|
metadata: metadata,
|
717
703
|
retry_policy: @config.rpcs.tail_log_entries.retry_policy
|
718
|
-
|
704
|
+
|
705
|
+
options.apply_defaults timeout: @config.timeout,
|
706
|
+
metadata: @config.metadata,
|
719
707
|
retry_policy: @config.retry_policy
|
720
708
|
|
721
709
|
@logging_service_stub.call_rpc :tail_log_entries, request, options: options do |response, operation|
|
@@ -739,22 +727,21 @@ module Google
|
|
739
727
|
# Configuration can be applied globally to all clients, or to a single client
|
740
728
|
# on construction.
|
741
729
|
#
|
742
|
-
#
|
743
|
-
#
|
744
|
-
#
|
745
|
-
# to 20 seconds,
|
746
|
-
#
|
747
|
-
#
|
748
|
-
#
|
749
|
-
#
|
750
|
-
#
|
751
|
-
#
|
752
|
-
#
|
753
|
-
#
|
754
|
-
#
|
755
|
-
#
|
756
|
-
#
|
757
|
-
# end
|
730
|
+
# @example
|
731
|
+
#
|
732
|
+
# # Modify the global config, setting the timeout for
|
733
|
+
# # delete_log to 20 seconds,
|
734
|
+
# # and all remaining timeouts to 10 seconds.
|
735
|
+
# ::Google::Cloud::Logging::V2::LoggingService::Client.configure do |config|
|
736
|
+
# config.timeout = 10.0
|
737
|
+
# config.rpcs.delete_log.timeout = 20.0
|
738
|
+
# end
|
739
|
+
#
|
740
|
+
# # Apply the above configuration only to a new client.
|
741
|
+
# client = ::Google::Cloud::Logging::V2::LoggingService::Client.new do |config|
|
742
|
+
# config.timeout = 10.0
|
743
|
+
# config.rpcs.delete_log.timeout = 20.0
|
744
|
+
# end
|
758
745
|
#
|
759
746
|
# @!attribute [rw] endpoint
|
760
747
|
# The hostname or hostname:port of the service endpoint.
|
@@ -41,13 +41,12 @@ module Google
|
|
41
41
|
# See {::Google::Cloud::Logging::V2::MetricsService::Client::Configuration}
|
42
42
|
# for a description of the configuration fields.
|
43
43
|
#
|
44
|
-
#
|
44
|
+
# @example
|
45
45
|
#
|
46
|
-
#
|
47
|
-
#
|
48
|
-
#
|
49
|
-
#
|
50
|
-
# end
|
46
|
+
# # Modify the configuration for all MetricsService clients
|
47
|
+
# ::Google::Cloud::Logging::V2::MetricsService::Client.configure do |config|
|
48
|
+
# config.timeout = 10.0
|
49
|
+
# end
|
51
50
|
#
|
52
51
|
# @yield [config] Configure the Client client.
|
53
52
|
# @yieldparam config [Client::Configuration]
|
@@ -67,36 +66,24 @@ module Google
|
|
67
66
|
|
68
67
|
default_config.rpcs.list_log_metrics.timeout = 60.0
|
69
68
|
default_config.rpcs.list_log_metrics.retry_policy = {
|
70
|
-
initial_delay: 0.1,
|
71
|
-
max_delay: 60.0,
|
72
|
-
multiplier: 1.3,
|
73
|
-
retry_codes: [4, 13, 14]
|
69
|
+
initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [4, 13, 14]
|
74
70
|
}
|
75
71
|
|
76
72
|
default_config.rpcs.get_log_metric.timeout = 60.0
|
77
73
|
default_config.rpcs.get_log_metric.retry_policy = {
|
78
|
-
initial_delay: 0.1,
|
79
|
-
max_delay: 60.0,
|
80
|
-
multiplier: 1.3,
|
81
|
-
retry_codes: [4, 13, 14]
|
74
|
+
initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [4, 13, 14]
|
82
75
|
}
|
83
76
|
|
84
77
|
default_config.rpcs.create_log_metric.timeout = 60.0
|
85
78
|
|
86
79
|
default_config.rpcs.update_log_metric.timeout = 60.0
|
87
80
|
default_config.rpcs.update_log_metric.retry_policy = {
|
88
|
-
initial_delay: 0.1,
|
89
|
-
max_delay: 60.0,
|
90
|
-
multiplier: 1.3,
|
91
|
-
retry_codes: [4, 13, 14]
|
81
|
+
initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [4, 13, 14]
|
92
82
|
}
|
93
83
|
|
94
84
|
default_config.rpcs.delete_log_metric.timeout = 60.0
|
95
85
|
default_config.rpcs.delete_log_metric.retry_policy = {
|
96
|
-
initial_delay: 0.1,
|
97
|
-
max_delay: 60.0,
|
98
|
-
multiplier: 1.3,
|
99
|
-
retry_codes: [4, 13, 14]
|
86
|
+
initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [4, 13, 14]
|
100
87
|
}
|
101
88
|
|
102
89
|
default_config
|
@@ -128,19 +115,15 @@ module Google
|
|
128
115
|
##
|
129
116
|
# Create a new MetricsService client object.
|
130
117
|
#
|
131
|
-
#
|
132
|
-
#
|
133
|
-
# To create a new MetricsService client with the default
|
134
|
-
# configuration:
|
135
|
-
#
|
136
|
-
# client = ::Google::Cloud::Logging::V2::MetricsService::Client.new
|
118
|
+
# @example
|
137
119
|
#
|
138
|
-
#
|
139
|
-
#
|
120
|
+
# # Create a client using the default configuration
|
121
|
+
# client = ::Google::Cloud::Logging::V2::MetricsService::Client.new
|
140
122
|
#
|
141
|
-
#
|
142
|
-
#
|
143
|
-
#
|
123
|
+
# # Create a client using a custom configuration
|
124
|
+
# client = ::Google::Cloud::Logging::V2::MetricsService::Client.new do |config|
|
125
|
+
# config.timeout = 10.0
|
126
|
+
# end
|
144
127
|
#
|
145
128
|
# @yield [config] Configure the MetricsService client.
|
146
129
|
# @yieldparam config [Client::Configuration]
|
@@ -160,14 +143,13 @@ module Google
|
|
160
143
|
|
161
144
|
# Create credentials
|
162
145
|
credentials = @config.credentials
|
163
|
-
# Use self-signed JWT if the
|
146
|
+
# Use self-signed JWT if the endpoint is unchanged from default,
|
164
147
|
# but only if the default endpoint does not have a region prefix.
|
165
|
-
enable_self_signed_jwt = @config.
|
166
|
-
@config.endpoint == Client.configure.endpoint &&
|
148
|
+
enable_self_signed_jwt = @config.endpoint == Client.configure.endpoint &&
|
167
149
|
!@config.endpoint.split(".").first.include?("-")
|
168
150
|
credentials ||= Credentials.default scope: @config.scope,
|
169
151
|
enable_self_signed_jwt: enable_self_signed_jwt
|
170
|
-
if credentials.is_a?(String) || credentials.is_a?(Hash)
|
152
|
+
if credentials.is_a?(::String) || credentials.is_a?(::Hash)
|
171
153
|
credentials = Credentials.new credentials, scope: @config.scope
|
172
154
|
end
|
173
155
|
@quota_project_id = @config.quota_project
|
@@ -250,7 +232,9 @@ module Google
|
|
250
232
|
options.apply_defaults timeout: @config.rpcs.list_log_metrics.timeout,
|
251
233
|
metadata: metadata,
|
252
234
|
retry_policy: @config.rpcs.list_log_metrics.retry_policy
|
253
|
-
|
235
|
+
|
236
|
+
options.apply_defaults timeout: @config.timeout,
|
237
|
+
metadata: @config.metadata,
|
254
238
|
retry_policy: @config.retry_policy
|
255
239
|
|
256
240
|
@metrics_service_stub.call_rpc :list_log_metrics, request, options: options do |response, operation|
|
@@ -319,7 +303,9 @@ module Google
|
|
319
303
|
options.apply_defaults timeout: @config.rpcs.get_log_metric.timeout,
|
320
304
|
metadata: metadata,
|
321
305
|
retry_policy: @config.rpcs.get_log_metric.retry_policy
|
322
|
-
|
306
|
+
|
307
|
+
options.apply_defaults timeout: @config.timeout,
|
308
|
+
metadata: @config.metadata,
|
323
309
|
retry_policy: @config.retry_policy
|
324
310
|
|
325
311
|
@metrics_service_stub.call_rpc :get_log_metric, request, options: options do |response, operation|
|
@@ -392,7 +378,9 @@ module Google
|
|
392
378
|
options.apply_defaults timeout: @config.rpcs.create_log_metric.timeout,
|
393
379
|
metadata: metadata,
|
394
380
|
retry_policy: @config.rpcs.create_log_metric.retry_policy
|
395
|
-
|
381
|
+
|
382
|
+
options.apply_defaults timeout: @config.timeout,
|
383
|
+
metadata: @config.metadata,
|
396
384
|
retry_policy: @config.retry_policy
|
397
385
|
|
398
386
|
@metrics_service_stub.call_rpc :create_log_metric, request, options: options do |response, operation|
|
@@ -466,7 +454,9 @@ module Google
|
|
466
454
|
options.apply_defaults timeout: @config.rpcs.update_log_metric.timeout,
|
467
455
|
metadata: metadata,
|
468
456
|
retry_policy: @config.rpcs.update_log_metric.retry_policy
|
469
|
-
|
457
|
+
|
458
|
+
options.apply_defaults timeout: @config.timeout,
|
459
|
+
metadata: @config.metadata,
|
470
460
|
retry_policy: @config.retry_policy
|
471
461
|
|
472
462
|
@metrics_service_stub.call_rpc :update_log_metric, request, options: options do |response, operation|
|
@@ -534,7 +524,9 @@ module Google
|
|
534
524
|
options.apply_defaults timeout: @config.rpcs.delete_log_metric.timeout,
|
535
525
|
metadata: metadata,
|
536
526
|
retry_policy: @config.rpcs.delete_log_metric.retry_policy
|
537
|
-
|
527
|
+
|
528
|
+
options.apply_defaults timeout: @config.timeout,
|
529
|
+
metadata: @config.metadata,
|
538
530
|
retry_policy: @config.retry_policy
|
539
531
|
|
540
532
|
@metrics_service_stub.call_rpc :delete_log_metric, request, options: options do |response, operation|
|
@@ -558,22 +550,21 @@ module Google
|
|
558
550
|
# Configuration can be applied globally to all clients, or to a single client
|
559
551
|
# on construction.
|
560
552
|
#
|
561
|
-
#
|
562
|
-
#
|
563
|
-
#
|
564
|
-
# to 20 seconds,
|
565
|
-
#
|
566
|
-
#
|
567
|
-
#
|
568
|
-
#
|
569
|
-
#
|
570
|
-
#
|
571
|
-
#
|
572
|
-
#
|
573
|
-
#
|
574
|
-
#
|
575
|
-
#
|
576
|
-
# end
|
553
|
+
# @example
|
554
|
+
#
|
555
|
+
# # Modify the global config, setting the timeout for
|
556
|
+
# # list_log_metrics to 20 seconds,
|
557
|
+
# # and all remaining timeouts to 10 seconds.
|
558
|
+
# ::Google::Cloud::Logging::V2::MetricsService::Client.configure do |config|
|
559
|
+
# config.timeout = 10.0
|
560
|
+
# config.rpcs.list_log_metrics.timeout = 20.0
|
561
|
+
# end
|
562
|
+
#
|
563
|
+
# # Apply the above configuration only to a new client.
|
564
|
+
# client = ::Google::Cloud::Logging::V2::MetricsService::Client.new do |config|
|
565
|
+
# config.timeout = 10.0
|
566
|
+
# config.rpcs.list_log_metrics.timeout = 20.0
|
567
|
+
# end
|
577
568
|
#
|
578
569
|
# @!attribute [rw] endpoint
|
579
570
|
# The hostname or hostname:port of the service endpoint.
|
@@ -49,7 +49,7 @@ module Google
|
|
49
49
|
#
|
50
50
|
# Sum[i=1..n]((x_i - mean)^2)
|
51
51
|
#
|
52
|
-
# Knuth, "The Art of Computer Programming", Vol. 2, page
|
52
|
+
# Knuth, "The Art of Computer Programming", Vol. 2, page 232, 3rd edition
|
53
53
|
# describes Welford's method for accumulating this sum in one pass.
|
54
54
|
#
|
55
55
|
# If `count` is zero then this field must be zero.
|
@@ -207,7 +207,7 @@ module Google
|
|
207
207
|
# @return [::Array<::Google::Protobuf::Any>]
|
208
208
|
# Contextual information about the example value. Examples are:
|
209
209
|
#
|
210
|
-
# Trace
|
210
|
+
# Trace: type.googleapis.com/google.monitoring.v3.SpanContext
|
211
211
|
#
|
212
212
|
# Literal string: type.googleapis.com/google.protobuf.StringValue
|
213
213
|
#
|
@@ -57,9 +57,15 @@ module Google
|
|
57
57
|
|
58
58
|
# Denotes that a (repeated) field is an unordered list.
|
59
59
|
# This indicates that the service may provide the elements of the list
|
60
|
-
# in any arbitrary
|
60
|
+
# in any arbitrary order, rather than the order the user originally
|
61
61
|
# provided. Additionally, the list's order may or may not be stable.
|
62
62
|
UNORDERED_LIST = 6
|
63
|
+
|
64
|
+
# Denotes that this field returns a non-empty default value if not set.
|
65
|
+
# This indicates that if the user provides the empty value in a request,
|
66
|
+
# a non-empty value will be returned. The user will not be aware of what
|
67
|
+
# non-empty value to expect.
|
68
|
+
NON_EMPTY_DEFAULT = 7
|
63
69
|
end
|
64
70
|
end
|
65
71
|
end
|