google-cloud-trace 0.38.3 → 0.41.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (48) hide show
  1. checksums.yaml +4 -4
  2. data/AUTHENTICATION.md +1 -1
  3. data/CHANGELOG.md +49 -0
  4. data/CONTRIBUTING.md +4 -5
  5. data/LOGGING.md +1 -1
  6. data/OVERVIEW.md +1 -2
  7. data/lib/google-cloud-trace.rb +20 -12
  8. data/lib/google/cloud/trace.rb +18 -14
  9. data/lib/google/cloud/trace/async_reporter.rb +7 -6
  10. data/lib/google/cloud/trace/credentials.rb +2 -2
  11. data/lib/google/cloud/trace/errors.rb +2 -2
  12. data/lib/google/cloud/trace/faraday_middleware.rb +5 -7
  13. data/lib/google/cloud/trace/label_key.rb +1 -1
  14. data/lib/google/cloud/trace/middleware.rb +7 -8
  15. data/lib/google/cloud/trace/notifications.rb +13 -14
  16. data/lib/google/cloud/trace/patches/active_call_with_trace.rb +2 -2
  17. data/lib/google/cloud/trace/patches/call_with_trace.rb +2 -2
  18. data/lib/google/cloud/trace/rails.rb +2 -2
  19. data/lib/google/cloud/trace/result_set.rb +20 -12
  20. data/lib/google/cloud/trace/service.rb +37 -60
  21. data/lib/google/cloud/trace/span.rb +7 -7
  22. data/lib/google/cloud/trace/trace_record.rb +4 -5
  23. data/lib/google/cloud/trace/utils.rb +1 -1
  24. data/lib/google/cloud/trace/version.rb +1 -1
  25. metadata +23 -72
  26. data/lib/google/cloud/trace/v1.rb +0 -16
  27. data/lib/google/cloud/trace/v1/credentials.rb +0 -39
  28. data/lib/google/cloud/trace/v1/doc/google/devtools/cloudtrace/v1/trace.rb +0 -253
  29. data/lib/google/cloud/trace/v1/doc/google/protobuf/empty.rb +0 -29
  30. data/lib/google/cloud/trace/v1/doc/google/protobuf/timestamp.rb +0 -113
  31. data/lib/google/cloud/trace/v1/trace_service_client.rb +0 -425
  32. data/lib/google/cloud/trace/v1/trace_service_client_config.json +0 -41
  33. data/lib/google/cloud/trace/v2.rb +0 -123
  34. data/lib/google/cloud/trace/v2/credentials.rb +0 -39
  35. data/lib/google/cloud/trace/v2/doc/google/devtools/cloudtrace/v2/trace.rb +0 -321
  36. data/lib/google/cloud/trace/v2/doc/google/devtools/cloudtrace/v2/tracing.rb +0 -33
  37. data/lib/google/cloud/trace/v2/doc/google/protobuf/any.rb +0 -131
  38. data/lib/google/cloud/trace/v2/doc/google/protobuf/empty.rb +0 -29
  39. data/lib/google/cloud/trace/v2/doc/google/protobuf/timestamp.rb +0 -113
  40. data/lib/google/cloud/trace/v2/doc/google/protobuf/wrappers.rb +0 -34
  41. data/lib/google/cloud/trace/v2/doc/google/rpc/status.rb +0 -39
  42. data/lib/google/cloud/trace/v2/trace_service_client.rb +0 -412
  43. data/lib/google/cloud/trace/v2/trace_service_client_config.json +0 -36
  44. data/lib/google/devtools/cloudtrace/v1/trace_pb.rb +0 -82
  45. data/lib/google/devtools/cloudtrace/v1/trace_services_pb.rb +0 -58
  46. data/lib/google/devtools/cloudtrace/v2/trace_pb.rb +0 -132
  47. data/lib/google/devtools/cloudtrace/v2/tracing_pb.rb +0 -29
  48. data/lib/google/devtools/cloudtrace/v2/tracing_services_pb.rb +0 -54
@@ -1,123 +0,0 @@
1
- # Copyright 2017 Google LLC
2
- #
3
- # Licensed under the Apache License, Version 2.0 (the "License");
4
- # you may not use this file except in compliance with the License.
5
- # You may obtain a copy of the License at
6
- #
7
- # https://www.apache.org/licenses/LICENSE-2.0
8
- #
9
- # Unless required by applicable law or agreed to in writing, software
10
- # distributed under the License is distributed on an "AS IS" BASIS,
11
- # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12
- # See the License for the specific language governing permissions and
13
- # limitations under the License.
14
-
15
-
16
- require "google/cloud/trace/v2/trace_service_client"
17
-
18
- module Google
19
- module Cloud
20
- # rubocop:disable LineLength
21
-
22
- ##
23
- # # Ruby Client for Stackdriver Trace API
24
- #
25
- # [Stackdriver Trace API][Product Documentation]:
26
- # Sends application trace data to Stackdriver Trace for viewing. Trace data is
27
- # collected for all App Engine applications by default. Trace data from other
28
- # applications can be provided using this API.
29
- # - [Product Documentation][]
30
- #
31
- # ## Quick Start
32
- # In order to use this library, you first need to go through the following
33
- # steps:
34
- #
35
- # 1. [Select or create a Cloud Platform project.](https://console.cloud.google.com/project)
36
- # 2. [Enable billing for your project.](https://cloud.google.com/billing/docs/how-to/modify-project#enable_billing_for_a_project)
37
- # 3. [Enable the Stackdriver Trace API.](https://console.cloud.google.com/apis/api/trace)
38
- # 4. [Setup Authentication.](https://googleapis.dev/ruby/google-cloud-trace/latest/file.AUTHENTICATION.html)
39
- #
40
- # ### Preview
41
- # #### TraceServiceClient
42
- # ```rb
43
- # require "google/cloud/trace/v2"
44
- #
45
- # trace_service_client = Google::Cloud::Trace::V2.new
46
- # formatted_name = Google::Cloud::Trace::V2::TraceServiceClient.project_path(project_id)
47
- # spans = []
48
- # trace_service_client.batch_write_spans(formatted_name, spans)
49
- # ```
50
- #
51
- # ### Next Steps
52
- # - Read the [Stackdriver Trace API Product documentation][Product Documentation]
53
- # to learn more about the product and see How-to Guides.
54
- # - View this [repository's main README](https://github.com/googleapis/google-cloud-ruby/blob/master/README.md)
55
- # to see the full list of Cloud APIs that we cover.
56
- #
57
- # [Product Documentation]: https://cloud.google.com/trace
58
- #
59
- #
60
- module Trace
61
- module V2
62
- # rubocop:enable LineLength
63
-
64
- ##
65
- # This file describes an API for collecting and viewing traces and spans
66
- # within a trace. A Trace is a collection of spans corresponding to a single
67
- # operation or set of operations for an application. A span is an individual
68
- # timed event which forms a node of the trace tree. A single trace may
69
- # contain span(s) from multiple services.
70
- #
71
- # @param credentials [Google::Auth::Credentials, String, Hash, GRPC::Core::Channel, GRPC::Core::ChannelCredentials, Proc]
72
- # Provides the means for authenticating requests made by the client. This parameter can
73
- # be many types.
74
- # A `Google::Auth::Credentials` uses a the properties of its represented keyfile for
75
- # authenticating requests made by this client.
76
- # A `String` will be treated as the path to the keyfile to be used for the construction of
77
- # credentials for this client.
78
- # A `Hash` will be treated as the contents of a keyfile to be used for the construction of
79
- # credentials for this client.
80
- # A `GRPC::Core::Channel` will be used to make calls through.
81
- # A `GRPC::Core::ChannelCredentials` for the setting up the RPC client. The channel credentials
82
- # should already be composed with a `GRPC::Core::CallCredentials` object.
83
- # A `Proc` will be used as an updater_proc for the Grpc channel. The proc transforms the
84
- # metadata for requests, generally, to give OAuth credentials.
85
- # @param scopes [Array<String>]
86
- # The OAuth scopes for this service. This parameter is ignored if
87
- # an updater_proc is supplied.
88
- # @param client_config [Hash]
89
- # A Hash for call options for each method. See
90
- # Google::Gax#construct_settings for the structure of
91
- # this data. Falls back to the default config if not specified
92
- # or the specified config is missing data points.
93
- # @param timeout [Numeric]
94
- # The default timeout, in seconds, for calls made through this client.
95
- # @param service_address [String]
96
- # Override for the service hostname, or `nil` to leave as the default.
97
- # @param service_port [Integer]
98
- # Override for the service port, or `nil` to leave as the default.
99
- def self.new \
100
- credentials: nil,
101
- scopes: nil,
102
- client_config: nil,
103
- timeout: nil,
104
- lib_name: nil,
105
- lib_version: nil,
106
- service_address: nil,
107
- service_port: nil
108
- kwargs = {
109
- credentials: credentials,
110
- scopes: scopes,
111
- client_config: client_config,
112
- timeout: timeout,
113
- lib_name: lib_name,
114
- service_address: service_address,
115
- service_port: service_port,
116
- lib_version: lib_version
117
- }.select { |_, v| v != nil }
118
- Google::Cloud::Trace::V2::TraceServiceClient.new(**kwargs)
119
- end
120
- end
121
- end
122
- end
123
- end
@@ -1,39 +0,0 @@
1
- # Copyright 2020 Google LLC
2
- #
3
- # Licensed under the Apache License, Version 2.0 (the "License");
4
- # you may not use this file except in compliance with the License.
5
- # You may obtain a copy of the License at
6
- #
7
- # https://www.apache.org/licenses/LICENSE-2.0
8
- #
9
- # Unless required by applicable law or agreed to in writing, software
10
- # distributed under the License is distributed on an "AS IS" BASIS,
11
- # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12
- # See the License for the specific language governing permissions and
13
- # limitations under the License.
14
-
15
-
16
- require "googleauth"
17
-
18
- module Google
19
- module Cloud
20
- module Trace
21
- module V2
22
- class Credentials < Google::Auth::Credentials
23
- SCOPE = ["https://www.googleapis.com/auth/cloud-platform"].freeze
24
- PATH_ENV_VARS = %w(TRACE_CREDENTIALS
25
- TRACE_KEYFILE
26
- GOOGLE_CLOUD_CREDENTIALS
27
- GOOGLE_CLOUD_KEYFILE
28
- GCLOUD_KEYFILE)
29
- JSON_ENV_VARS = %w(TRACE_CREDENTIALS_JSON
30
- TRACE_KEYFILE_JSON
31
- GOOGLE_CLOUD_CREDENTIALS_JSON
32
- GOOGLE_CLOUD_KEYFILE_JSON
33
- GCLOUD_KEYFILE_JSON)
34
- DEFAULT_PATHS = ["~/.config/gcloud/application_default_credentials.json"]
35
- end
36
- end
37
- end
38
- end
39
- end
@@ -1,321 +0,0 @@
1
- # Copyright 2020 Google LLC
2
- #
3
- # Licensed under the Apache License, Version 2.0 (the "License");
4
- # you may not use this file except in compliance with the License.
5
- # You may obtain a copy of the License at
6
- #
7
- # https://www.apache.org/licenses/LICENSE-2.0
8
- #
9
- # Unless required by applicable law or agreed to in writing, software
10
- # distributed under the License is distributed on an "AS IS" BASIS,
11
- # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12
- # See the License for the specific language governing permissions and
13
- # limitations under the License.
14
-
15
-
16
- module Google
17
- module Devtools
18
- module Cloudtrace
19
- module V2
20
- # A span represents a single operation within a trace. Spans can be
21
- # nested to form a trace tree. Often, a trace contains a root span
22
- # that describes the end-to-end latency, and one or more subspans for
23
- # its sub-operations. A trace can also contain multiple root spans,
24
- # or none at all. Spans do not need to be contiguous&mdash;there may be
25
- # gaps or overlaps between spans in a trace.
26
- # @!attribute [rw] name
27
- # @return [String]
28
- # The resource name of the span in the following format:
29
- #
30
- # projects/[PROJECT_ID]/traces/[TRACE_ID]/spans/[SPAN_ID]
31
- #
32
- # [TRACE_ID] is a unique identifier for a trace within a project;
33
- # it is a 32-character hexadecimal encoding of a 16-byte array.
34
- #
35
- # [SPAN_ID] is a unique identifier for a span within a trace; it
36
- # is a 16-character hexadecimal encoding of an 8-byte array.
37
- # @!attribute [rw] span_id
38
- # @return [String]
39
- # The [SPAN_ID] portion of the span's resource name.
40
- # @!attribute [rw] parent_span_id
41
- # @return [String]
42
- # The [SPAN_ID] of this span's parent span. If this is a root span,
43
- # then this field must be empty.
44
- # @!attribute [rw] display_name
45
- # @return [Google::Devtools::Cloudtrace::V2::TruncatableString]
46
- # A description of the span's operation (up to 128 bytes).
47
- # Stackdriver Trace displays the description in the
48
- # Google Cloud Platform Console.
49
- # For example, the display name can be a qualified method name or a file name
50
- # and a line number where the operation is called. A best practice is to use
51
- # the same display name within an application and at the same call point.
52
- # This makes it easier to correlate spans in different traces.
53
- # @!attribute [rw] start_time
54
- # @return [Google::Protobuf::Timestamp]
55
- # The start time of the span. On the client side, this is the time kept by
56
- # the local machine where the span execution starts. On the server side, this
57
- # is the time when the server's application handler starts running.
58
- # @!attribute [rw] end_time
59
- # @return [Google::Protobuf::Timestamp]
60
- # The end time of the span. On the client side, this is the time kept by
61
- # the local machine where the span execution ends. On the server side, this
62
- # is the time when the server application handler stops running.
63
- # @!attribute [rw] attributes
64
- # @return [Google::Devtools::Cloudtrace::V2::Span::Attributes]
65
- # A set of attributes on the span. You can have up to 32 attributes per
66
- # span.
67
- # @!attribute [rw] stack_trace
68
- # @return [Google::Devtools::Cloudtrace::V2::StackTrace]
69
- # Stack trace captured at the start of the span.
70
- # @!attribute [rw] time_events
71
- # @return [Google::Devtools::Cloudtrace::V2::Span::TimeEvents]
72
- # A set of time events. You can have up to 32 annotations and 128 message
73
- # events per span.
74
- # @!attribute [rw] links
75
- # @return [Google::Devtools::Cloudtrace::V2::Span::Links]
76
- # Links associated with the span. You can have up to 128 links per Span.
77
- # @!attribute [rw] status
78
- # @return [Google::Rpc::Status]
79
- # Optional. The final status for this span.
80
- # @!attribute [rw] same_process_as_parent_span
81
- # @return [Google::Protobuf::BoolValue]
82
- # Optional. Set this parameter to indicate whether this span is in
83
- # the same process as its parent. If you do not set this parameter,
84
- # Stackdriver Trace is unable to take advantage of this helpful
85
- # information.
86
- # @!attribute [rw] child_span_count
87
- # @return [Google::Protobuf::Int32Value]
88
- # Optional. The number of child spans that were generated while this span
89
- # was active. If set, allows implementation to detect missing child spans.
90
- class Span
91
- # A set of attributes, each in the format `[KEY]:[VALUE]`.
92
- # @!attribute [rw] attribute_map
93
- # @return [Hash{String => Google::Devtools::Cloudtrace::V2::AttributeValue}]
94
- # The set of attributes. Each attribute's key can be up to 128 bytes
95
- # long. The value can be a string up to 256 bytes, a signed 64-bit integer,
96
- # or the Boolean values `true` and `false`. For example:
97
- #
98
- # "/instance_id": "my-instance"
99
- # "/http/user_agent": ""
100
- # "/http/request_bytes": 300
101
- # "abc.com/myattribute": true
102
- # @!attribute [rw] dropped_attributes_count
103
- # @return [Integer]
104
- # The number of attributes that were discarded. Attributes can be discarded
105
- # because their keys are too long or because there are too many attributes.
106
- # If this value is 0 then all attributes are valid.
107
- class Attributes; end
108
-
109
- # A time-stamped annotation or message event in the Span.
110
- # @!attribute [rw] time
111
- # @return [Google::Protobuf::Timestamp]
112
- # The timestamp indicating the time the event occurred.
113
- # @!attribute [rw] annotation
114
- # @return [Google::Devtools::Cloudtrace::V2::Span::TimeEvent::Annotation]
115
- # Text annotation with a set of attributes.
116
- # @!attribute [rw] message_event
117
- # @return [Google::Devtools::Cloudtrace::V2::Span::TimeEvent::MessageEvent]
118
- # An event describing a message sent/received between Spans.
119
- class TimeEvent
120
- # Text annotation with a set of attributes.
121
- # @!attribute [rw] description
122
- # @return [Google::Devtools::Cloudtrace::V2::TruncatableString]
123
- # A user-supplied message describing the event. The maximum length for
124
- # the description is 256 bytes.
125
- # @!attribute [rw] attributes
126
- # @return [Google::Devtools::Cloudtrace::V2::Span::Attributes]
127
- # A set of attributes on the annotation. You can have up to 4 attributes
128
- # per Annotation.
129
- class Annotation; end
130
-
131
- # An event describing a message sent/received between Spans.
132
- # @!attribute [rw] type
133
- # @return [Google::Devtools::Cloudtrace::V2::Span::TimeEvent::MessageEvent::Type]
134
- # Type of MessageEvent. Indicates whether the message was sent or
135
- # received.
136
- # @!attribute [rw] id
137
- # @return [Integer]
138
- # An identifier for the MessageEvent's message that can be used to match
139
- # SENT and RECEIVED MessageEvents. It is recommended to be unique within
140
- # a Span.
141
- # @!attribute [rw] uncompressed_size_bytes
142
- # @return [Integer]
143
- # The number of uncompressed bytes sent or received.
144
- # @!attribute [rw] compressed_size_bytes
145
- # @return [Integer]
146
- # The number of compressed bytes sent or received. If missing assumed to
147
- # be the same size as uncompressed.
148
- class MessageEvent
149
- # Indicates whether the message was sent or received.
150
- module Type
151
- # Unknown event type.
152
- TYPE_UNSPECIFIED = 0
153
-
154
- # Indicates a sent message.
155
- SENT = 1
156
-
157
- # Indicates a received message.
158
- RECEIVED = 2
159
- end
160
- end
161
- end
162
-
163
- # A collection of `TimeEvent`s. A `TimeEvent` is a time-stamped annotation
164
- # on the span, consisting of either user-supplied key:value pairs, or
165
- # details of a message sent/received between Spans.
166
- # @!attribute [rw] time_event
167
- # @return [Array<Google::Devtools::Cloudtrace::V2::Span::TimeEvent>]
168
- # A collection of `TimeEvent`s.
169
- # @!attribute [rw] dropped_annotations_count
170
- # @return [Integer]
171
- # The number of dropped annotations in all the included time events.
172
- # If the value is 0, then no annotations were dropped.
173
- # @!attribute [rw] dropped_message_events_count
174
- # @return [Integer]
175
- # The number of dropped message events in all the included time events.
176
- # If the value is 0, then no message events were dropped.
177
- class TimeEvents; end
178
-
179
- # A pointer from the current span to another span in the same trace or in a
180
- # different trace. For example, this can be used in batching operations,
181
- # where a single batch handler processes multiple requests from different
182
- # traces or when the handler receives a request from a different project.
183
- # @!attribute [rw] trace_id
184
- # @return [String]
185
- # The [TRACE_ID] for a trace within a project.
186
- # @!attribute [rw] span_id
187
- # @return [String]
188
- # The [SPAN_ID] for a span within a trace.
189
- # @!attribute [rw] type
190
- # @return [Google::Devtools::Cloudtrace::V2::Span::Link::Type]
191
- # The relationship of the current span relative to the linked span.
192
- # @!attribute [rw] attributes
193
- # @return [Google::Devtools::Cloudtrace::V2::Span::Attributes]
194
- # A set of attributes on the link. You have have up to 32 attributes per
195
- # link.
196
- class Link
197
- # The relationship of the current span relative to the linked span: child,
198
- # parent, or unspecified.
199
- module Type
200
- # The relationship of the two spans is unknown.
201
- TYPE_UNSPECIFIED = 0
202
-
203
- # The linked span is a child of the current span.
204
- CHILD_LINKED_SPAN = 1
205
-
206
- # The linked span is a parent of the current span.
207
- PARENT_LINKED_SPAN = 2
208
- end
209
- end
210
-
211
- # A collection of links, which are references from this span to a span
212
- # in the same or different trace.
213
- # @!attribute [rw] link
214
- # @return [Array<Google::Devtools::Cloudtrace::V2::Span::Link>]
215
- # A collection of links.
216
- # @!attribute [rw] dropped_links_count
217
- # @return [Integer]
218
- # The number of dropped links after the maximum size was enforced. If
219
- # this value is 0, then no links were dropped.
220
- class Links; end
221
- end
222
-
223
- # The allowed types for [VALUE] in a `[KEY]:[VALUE]` attribute.
224
- # @!attribute [rw] string_value
225
- # @return [Google::Devtools::Cloudtrace::V2::TruncatableString]
226
- # A string up to 256 bytes long.
227
- # @!attribute [rw] int_value
228
- # @return [Integer]
229
- # A 64-bit signed integer.
230
- # @!attribute [rw] bool_value
231
- # @return [true, false]
232
- # A Boolean value represented by `true` or `false`.
233
- class AttributeValue; end
234
-
235
- # A call stack appearing in a trace.
236
- # @!attribute [rw] stack_frames
237
- # @return [Google::Devtools::Cloudtrace::V2::StackTrace::StackFrames]
238
- # Stack frames in this stack trace. A maximum of 128 frames are allowed.
239
- # @!attribute [rw] stack_trace_hash_id
240
- # @return [Integer]
241
- # The hash ID is used to conserve network bandwidth for duplicate
242
- # stack traces within a single trace.
243
- #
244
- # Often multiple spans will have identical stack traces.
245
- # The first occurrence of a stack trace should contain both the
246
- # `stackFrame` content and a value in `stackTraceHashId`.
247
- #
248
- # Subsequent spans within the same request can refer
249
- # to that stack trace by only setting `stackTraceHashId`.
250
- class StackTrace
251
- # Represents a single stack frame in a stack trace.
252
- # @!attribute [rw] function_name
253
- # @return [Google::Devtools::Cloudtrace::V2::TruncatableString]
254
- # The fully-qualified name that uniquely identifies the function or
255
- # method that is active in this frame (up to 1024 bytes).
256
- # @!attribute [rw] original_function_name
257
- # @return [Google::Devtools::Cloudtrace::V2::TruncatableString]
258
- # An un-mangled function name, if `function_name` is
259
- # [mangled](http://www.avabodh.com/cxxin/namemangling.html). The name can
260
- # be fully-qualified (up to 1024 bytes).
261
- # @!attribute [rw] file_name
262
- # @return [Google::Devtools::Cloudtrace::V2::TruncatableString]
263
- # The name of the source file where the function call appears (up to 256
264
- # bytes).
265
- # @!attribute [rw] line_number
266
- # @return [Integer]
267
- # The line number in `file_name` where the function call appears.
268
- # @!attribute [rw] column_number
269
- # @return [Integer]
270
- # The column number where the function call appears, if available.
271
- # This is important in JavaScript because of its anonymous functions.
272
- # @!attribute [rw] load_module
273
- # @return [Google::Devtools::Cloudtrace::V2::Module]
274
- # The binary module from where the code was loaded.
275
- # @!attribute [rw] source_version
276
- # @return [Google::Devtools::Cloudtrace::V2::TruncatableString]
277
- # The version of the deployed source code (up to 128 bytes).
278
- class StackFrame; end
279
-
280
- # A collection of stack frames, which can be truncated.
281
- # @!attribute [rw] frame
282
- # @return [Array<Google::Devtools::Cloudtrace::V2::StackTrace::StackFrame>]
283
- # Stack frames in this call stack.
284
- # @!attribute [rw] dropped_frames_count
285
- # @return [Integer]
286
- # The number of stack frames that were dropped because there
287
- # were too many stack frames.
288
- # If this value is 0, then no stack frames were dropped.
289
- class StackFrames; end
290
- end
291
-
292
- # Binary module.
293
- # @!attribute [rw] module
294
- # @return [Google::Devtools::Cloudtrace::V2::TruncatableString]
295
- # For example: main binary, kernel modules, and dynamic libraries
296
- # such as libc.so, sharedlib.so (up to 256 bytes).
297
- # @!attribute [rw] build_id
298
- # @return [Google::Devtools::Cloudtrace::V2::TruncatableString]
299
- # A unique identifier for the module, usually a hash of its
300
- # contents (up to 128 bytes).
301
- class Module; end
302
-
303
- # Represents a string that might be shortened to a specified length.
304
- # @!attribute [rw] value
305
- # @return [String]
306
- # The shortened string. For example, if the original string is 500
307
- # bytes long and the limit of the string is 128 bytes, then
308
- # `value` contains the first 128 bytes of the 500-byte string.
309
- #
310
- # Truncation always happens on a UTF8 character boundary. If there
311
- # are multi-byte characters in the string, then the length of the
312
- # shortened string might be less than the size limit.
313
- # @!attribute [rw] truncated_byte_count
314
- # @return [Integer]
315
- # The number of bytes removed from the original string. If this
316
- # value is 0, then the string was not shortened.
317
- class TruncatableString; end
318
- end
319
- end
320
- end
321
- end