google-cloud-profiler 1.4.2 → 1.5.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 849d1db11fa8699f177d94454760ec507785c54e88b0513ccbd514bc2a3913ff
4
- data.tar.gz: 9edaebf1fd7616af15307bd47c0ec48317d5622bf2300b86581580b56e1f41db
3
+ metadata.gz: 47ad53b7a691d03278c4983ee6dcffded4d9a241406af4061946e2bf84ad741f
4
+ data.tar.gz: dfd863222e9c939eae08fac90777b2ddfc8b151da65289fcf3550d97ef1ff9d8
5
5
  SHA512:
6
- metadata.gz: 154aa6f3f4bc1ed9995960de02a5209f3edc599d070b778a7e8c03e520b43b28afa3be1f08ef101d1787a1ef80c2057a71f7fbcc14752bf1aa77e9a3c8e6d3b3
7
- data.tar.gz: 80b4f1fd678c49741c9ad83f5c7497092bef6428b2fded777dfdaab3cc9e5e9704fbb8df8c84b441f95a51ced598e3115d605780b2977c7dffce698b8206148c
6
+ metadata.gz: 117698e347343a2f872fc31a4b7f016150bb19c3bcf05cd1c855be5d96ceac340056424841682410a121b6cf961c1589ef998ef26b6ae065fdeed1436e9f0b64
7
+ data.tar.gz: c4c3ec2bcd2c30bef20533023a7a73839404e2602b07c0535aea1b535b0b65fc983a972febb68c44c367c357120fc239c7ddbbb14ef3d5cb829b8da469e1d4c0
data/README.md CHANGED
@@ -7,7 +7,7 @@ Cloud Profiler is a statistical, low-overhead profiler that continuously gathers
7
7
  Actual client classes for the various versions of this API are defined in
8
8
  _versioned_ client gems, with names of the form `google-cloud-profiler-v*`.
9
9
  The gem `google-cloud-profiler` is the main client library that brings the
10
- verisoned gems in as dependencies, and provides high-level methods for
10
+ versioned gems in as dependencies, and provides high-level methods for
11
11
  constructing clients. More information on versioned clients can be found below
12
12
  in the section titled *Which client should I use?*.
13
13
 
@@ -34,9 +34,39 @@ In order to use this library, you first need to go through the following steps:
34
34
  1. [Enable the API.](https://console.cloud.google.com/apis/library/cloudprofiler.googleapis.com)
35
35
  1. {file:AUTHENTICATION.md Set up authentication.}
36
36
 
37
+ ## Debug Logging
38
+
39
+ This library comes with opt-in Debug Logging that can help you troubleshoot
40
+ your application's integration with the API. When logging is activated, key
41
+ events such as requests and responses, along with data payloads and metadata
42
+ such as headers and client configuration, are logged to the standard error
43
+ stream.
44
+
45
+ **WARNING:** Client Library Debug Logging includes your data payloads in
46
+ plaintext, which could include sensitive data such as PII for yourself or your
47
+ customers, private keys, or other security data that could be compromising if
48
+ leaked. Always practice good data hygiene with your application logs, and follow
49
+ the principle of least access. Google also recommends that Client Library Debug
50
+ Logging be enabled only temporarily during active debugging, and not used
51
+ permanently in production.
52
+
53
+ To enable logging, set the environment variable `GOOGLE_SDK_RUBY_LOGGING_GEMS`
54
+ to the value `all`. Alternatively, you can set the value to a comma-delimited
55
+ list of client library gem names. This will select the default logging behavior,
56
+ which writes logs to the standard error stream. On a local workstation, this may
57
+ result in logs appearing on the console. When running on a Google Cloud hosting
58
+ service such as [Google Cloud Run](https://cloud.google.com/run), this generally
59
+ results in logs appearing alongside your application logs in the
60
+ [Google Cloud Logging](https://cloud.google.com/logging/) service.
61
+
62
+ Debug logging also requires that the versioned clients for this service be
63
+ sufficiently recent, released after about Dec 10, 2024. If logging is not
64
+ working, try updating the versioned clients in your bundle or installed gems:
65
+ [google-cloud-profiler-v2](https://cloud.google.com/ruby/docs/reference/google-cloud-profiler-v2/latest).
66
+
37
67
  ## Supported Ruby Versions
38
68
 
39
- This library is supported on Ruby 2.7+.
69
+ This library is supported on Ruby 3.0+.
40
70
 
41
71
  Google provides official support for Ruby versions that are actively supported
42
72
  by Ruby Core—that is, Ruby versions that are either in normal maintenance or
@@ -20,7 +20,7 @@
20
20
  module Google
21
21
  module Cloud
22
22
  module Profiler
23
- VERSION = "1.4.2"
23
+ VERSION = "1.5.1"
24
24
  end
25
25
  end
26
26
  end
@@ -58,6 +58,11 @@ module Google
58
58
  # You can also specify a different transport by passing `:rest` or `:grpc` in
59
59
  # the `transport` parameter.
60
60
  #
61
+ # Raises an exception if the currently installed versioned client gem for the
62
+ # given API version does not support the given transport of the ProfilerService service.
63
+ # You can determine whether the method will succeed by calling
64
+ # {Google::Cloud::Profiler.profiler_service_available?}.
65
+ #
61
66
  # ## About ProfilerService
62
67
  #
63
68
  # Manage the collection of continuous profiling data provided by profiling
@@ -83,6 +88,37 @@ module Google
83
88
  service_module.const_get(:Client).new(&block)
84
89
  end
85
90
 
91
+ ##
92
+ # Determines whether the ProfilerService service is supported by the current client.
93
+ # If true, you can retrieve a client object by calling {Google::Cloud::Profiler.profiler_service}.
94
+ # If false, that method will raise an exception. This could happen if the given
95
+ # API version does not exist or does not support the ProfilerService service,
96
+ # or if the versioned client gem needs an update to support the ProfilerService service.
97
+ #
98
+ # @param version [::String, ::Symbol] The API version to connect to. Optional.
99
+ # Defaults to `:v2`.
100
+ # @param transport [:grpc, :rest] The transport to use. Defaults to `:grpc`.
101
+ # @return [boolean] Whether the service is available.
102
+ #
103
+ def self.profiler_service_available? version: :v2, transport: :grpc
104
+ require "google/cloud/profiler/#{version.to_s.downcase}"
105
+ package_name = Google::Cloud::Profiler
106
+ .constants
107
+ .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") }
108
+ .first
109
+ return false unless package_name
110
+ service_module = Google::Cloud::Profiler.const_get package_name
111
+ return false unless service_module.const_defined? :ProfilerService
112
+ service_module = service_module.const_get :ProfilerService
113
+ if transport == :rest
114
+ return false unless service_module.const_defined? :Rest
115
+ service_module = service_module.const_get :Rest
116
+ end
117
+ service_module.const_defined? :Client
118
+ rescue ::LoadError
119
+ false
120
+ end
121
+
86
122
  ##
87
123
  # Create a new client object for ExportService.
88
124
  #
@@ -96,6 +132,11 @@ module Google
96
132
  # You can also specify a different transport by passing `:rest` or `:grpc` in
97
133
  # the `transport` parameter.
98
134
  #
135
+ # Raises an exception if the currently installed versioned client gem for the
136
+ # given API version does not support the given transport of the ExportService service.
137
+ # You can determine whether the method will succeed by calling
138
+ # {Google::Cloud::Profiler.export_service_available?}.
139
+ #
99
140
  # ## About ExportService
100
141
  #
101
142
  # Service allows existing Cloud Profiler customers to export their profile data
@@ -118,6 +159,37 @@ module Google
118
159
  service_module.const_get(:Client).new(&block)
119
160
  end
120
161
 
162
+ ##
163
+ # Determines whether the ExportService service is supported by the current client.
164
+ # If true, you can retrieve a client object by calling {Google::Cloud::Profiler.export_service}.
165
+ # If false, that method will raise an exception. This could happen if the given
166
+ # API version does not exist or does not support the ExportService service,
167
+ # or if the versioned client gem needs an update to support the ExportService service.
168
+ #
169
+ # @param version [::String, ::Symbol] The API version to connect to. Optional.
170
+ # Defaults to `:v2`.
171
+ # @param transport [:grpc, :rest] The transport to use. Defaults to `:grpc`.
172
+ # @return [boolean] Whether the service is available.
173
+ #
174
+ def self.export_service_available? version: :v2, transport: :grpc
175
+ require "google/cloud/profiler/#{version.to_s.downcase}"
176
+ package_name = Google::Cloud::Profiler
177
+ .constants
178
+ .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") }
179
+ .first
180
+ return false unless package_name
181
+ service_module = Google::Cloud::Profiler.const_get package_name
182
+ return false unless service_module.const_defined? :ExportService
183
+ service_module = service_module.const_get :ExportService
184
+ if transport == :rest
185
+ return false unless service_module.const_defined? :Rest
186
+ service_module = service_module.const_get :Rest
187
+ end
188
+ service_module.const_defined? :Client
189
+ rescue ::LoadError
190
+ false
191
+ end
192
+
121
193
  ##
122
194
  # Configure the google-cloud-profiler library.
123
195
  #
metadata CHANGED
@@ -1,14 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: google-cloud-profiler
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.4.2
4
+ version: 1.5.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Google LLC
8
- autorequire:
9
8
  bindir: bin
10
9
  cert_chain: []
11
- date: 2024-08-09 00:00:00.000000000 Z
10
+ date: 1980-01-02 00:00:00.000000000 Z
12
11
  dependencies:
13
12
  - !ruby/object:Gem::Dependency
14
13
  name: google-cloud-core
@@ -65,7 +64,6 @@ homepage: https://github.com/googleapis/google-cloud-ruby
65
64
  licenses:
66
65
  - Apache-2.0
67
66
  metadata: {}
68
- post_install_message:
69
67
  rdoc_options: []
70
68
  require_paths:
71
69
  - lib
@@ -73,15 +71,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
73
71
  requirements:
74
72
  - - ">="
75
73
  - !ruby/object:Gem::Version
76
- version: '2.7'
74
+ version: '3.0'
77
75
  required_rubygems_version: !ruby/object:Gem::Requirement
78
76
  requirements:
79
77
  - - ">="
80
78
  - !ruby/object:Gem::Version
81
79
  version: '0'
82
80
  requirements: []
83
- rubygems_version: 3.5.6
84
- signing_key:
81
+ rubygems_version: 3.6.8
85
82
  specification_version: 4
86
83
  summary: API Client library for the Cloud Profiler API
87
84
  test_files: []