Class: Google::Apis::TracingV1::Span
- Inherits:
-
Object
- Object
- Google::Apis::TracingV1::Span
- Includes:
- Core::Hashable, Core::JsonObjectSupport
- Defined in:
- generated/google/apis/tracing_v1/classes.rb,
generated/google/apis/tracing_v1/representations.rb,
generated/google/apis/tracing_v1/representations.rb
Overview
A span represents a single operation within a trace. Spans can be nested to form a trace tree. Often, a trace contains a root span that describes the end-to-end latency and, optionally, one or more subspans for its sub-operations. (A trace could alternatively contain multiple root spans, or none at all.) Spans do not need to be contiguous. There may be gaps and/or overlaps between spans in a trace.
Instance Attribute Summary collapse
-
#attributes ⇒ Hash<String,Google::Apis::TracingV1::AttributeValue>
Properties of a span in key:value format.
-
#has_remote_parent ⇒ Boolean
(also: #has_remote_parent?)
True if this span has a remote parent (is an RPC server span).
-
#id ⇒ String
Identifier for the span.
-
#links ⇒ Array<Google::Apis::TracingV1::Link>
A collection of links, which are references from this span to another span in a different trace.
-
#local_end_time ⇒ String
End time of the span.
-
#local_start_time ⇒ String
Start time of the span.
-
#name ⇒ String
Name of the span.
-
#parent_id ⇒ String
ID of the parent span.
-
#stack_trace ⇒ Google::Apis::TracingV1::StackTrace
StackTrace collected in a trace.
-
#status ⇒ Google::Apis::TracingV1::Status
The
Statustype defines a logical error model that is suitable for different programming environments, including REST APIs and RPC APIs. -
#time_events ⇒ Array<Google::Apis::TracingV1::TimeEvent>
A collection of
TimeEvents.
Instance Method Summary collapse
-
#initialize(**args) ⇒ Span
constructor
A new instance of Span.
-
#update!(**args) ⇒ Object
Update properties of this object.
Methods included from Core::JsonObjectSupport
Methods included from Core::Hashable
Constructor Details
#initialize(**args) ⇒ Span
Returns a new instance of Span
326 327 328 |
# File 'generated/google/apis/tracing_v1/classes.rb', line 326 def initialize(**args) update!(**args) end |
Instance Attribute Details
#attributes ⇒ Hash<String,Google::Apis::TracingV1::AttributeValue>
Properties of a span in key:value format. The maximum length for the
key is 128 characters. The value can be a string (up to 2000 characters),
int, or boolean.
Some common pair examples:
"/instance_id": "my-instance"
"/zone": "us-central1-a"
"/grpc/peer_address": "ip:port" (dns, etc.)
"/grpc/deadline": "Duration"
"/http/user_agent"
"/http/request_bytes": 300
"/http/response_bytes": 1200
"/http/url": google.com/apis
"abc.com/myattribute": true
Corresponds to the JSON property attributes
303 304 305 |
# File 'generated/google/apis/tracing_v1/classes.rb', line 303 def attributes @attributes end |
#has_remote_parent ⇒ Boolean Also known as: has_remote_parent?
True if this span has a remote parent (is an RPC server span).
Corresponds to the JSON property hasRemoteParent
323 324 325 |
# File 'generated/google/apis/tracing_v1/classes.rb', line 323 def has_remote_parent @has_remote_parent end |
#id ⇒ String
Identifier for the span. Must be a 64-bit integer other than 0 and
unique within a trace.
Corresponds to the JSON property id
309 310 311 |
# File 'generated/google/apis/tracing_v1/classes.rb', line 309 def id @id end |
#links ⇒ Array<Google::Apis::TracingV1::Link>
A collection of links, which are references from this span to another span
in a different trace.
Corresponds to the JSON property links
286 287 288 |
# File 'generated/google/apis/tracing_v1/classes.rb', line 286 def links @links end |
#local_end_time ⇒ String
End time of the span.
On the client side, this is the local machine clock time at which the span
execution was ended; on the server
side, this is the time at which the server application handler stopped
running.
Corresponds to the JSON property localEndTime
209 210 211 |
# File 'generated/google/apis/tracing_v1/classes.rb', line 209 def local_end_time @local_end_time end |
#local_start_time ⇒ String
Start time of the span.
On the client side, this is the local machine clock time at which the span
execution was started; on the server
side, this is the time at which the server application handler started
running.
Corresponds to the JSON property localStartTime
318 319 320 |
# File 'generated/google/apis/tracing_v1/classes.rb', line 318 def local_start_time @local_start_time end |
#name ⇒ String
Name of the span. The span name is sanitized and displayed in the
Stackdriver Trace tool in the % dynamic print site_values.console_name %.
The name may be a method name or some other per-call site name.
For the same executable and the same call point, a best practice is
to use a consistent name, which makes it easier to correlate
cross-trace spans.
Corresponds to the JSON property name
275 276 277 |
# File 'generated/google/apis/tracing_v1/classes.rb', line 275 def name @name end |
#parent_id ⇒ String
ID of the parent span. If this is a root span, the value must be 0 or
empty.
Corresponds to the JSON property parentId
215 216 217 |
# File 'generated/google/apis/tracing_v1/classes.rb', line 215 def parent_id @parent_id end |
#stack_trace ⇒ Google::Apis::TracingV1::StackTrace
StackTrace collected in a trace.
Corresponds to the JSON property stackTrace
280 281 282 |
# File 'generated/google/apis/tracing_v1/classes.rb', line 280 def stack_trace @stack_trace end |
#status ⇒ Google::Apis::TracingV1::Status
The Status type defines a logical error model that is suitable for different
programming environments, including REST APIs and RPC APIs. It is used by
gRPC. The error model is designed to be:
- Simple to use and understand for most users
- Flexible enough to meet unexpected needs
# Overview
The
Statusmessage contains three pieces of data: error code, error message, and error details. The error code should be an enum value of google.rpc.Code, but it may accept additional error codes if needed. The error message should be a developer-facing English message that helps developers understand and resolve the error. If a localized user-facing error message is needed, put the localized message in the error details or localize it in the client. The optional error details may contain arbitrary information about the error. There is a predefined set of error detail types in the packagegoogle.rpcwhich can be used for common error conditions. # Language mapping TheStatusmessage is the logical representation of the error model, but it is not necessarily the actual wire format. When theStatusmessage is exposed in different client libraries and different wire protocols, it can be mapped differently. For example, it will likely be mapped to some exceptions in Java, but more likely mapped to some error codes in C. # Other uses The error model and theStatusmessage can be used in a variety of environments, either with or without APIs, to provide a consistent developer experience across different environments. Example uses of this error model include: - Partial errors. If a service needs to return partial errors to the client,
it may embed the
Statusin the normal response to indicate the partial errors. - Workflow errors. A typical workflow has multiple steps. Each step may
have a
Statusmessage for error reporting purpose. - Batch operations. If a client uses batch request and batch response, the
Statusmessage should be used directly inside batch response, one for each error sub-response. - Asynchronous operations. If an API call embeds asynchronous operation
results in its response, the status of those operations should be
represented directly using the
Statusmessage. - Logging. If some API errors are stored in logs, the message
Statuscould be used directly after any stripping needed for security/privacy reasons. Corresponds to the JSON propertystatus
265 266 267 |
# File 'generated/google/apis/tracing_v1/classes.rb', line 265 def status @status end |
#time_events ⇒ Array<Google::Apis::TracingV1::TimeEvent>
A collection of TimeEvents. A TimeEvent is a time-stamped annotation
on the span, consisting of either user-supplied key:value pairs, or
details of an RPC message sent/received on the network.
Corresponds to the JSON property timeEvents
222 223 224 |
# File 'generated/google/apis/tracing_v1/classes.rb', line 222 def time_events @time_events end |
Instance Method Details
#update!(**args) ⇒ Object
Update properties of this object
331 332 333 334 335 336 337 338 339 340 341 342 343 |
# File 'generated/google/apis/tracing_v1/classes.rb', line 331 def update!(**args) @local_end_time = args[:local_end_time] if args.key?(:local_end_time) @parent_id = args[:parent_id] if args.key?(:parent_id) @time_events = args[:time_events] if args.key?(:time_events) @status = args[:status] if args.key?(:status) @name = args[:name] if args.key?(:name) @stack_trace = args[:stack_trace] if args.key?(:stack_trace) @links = args[:links] if args.key?(:links) @attributes = args[:attributes] if args.key?(:attributes) @id = args[:id] if args.key?(:id) @local_start_time = args[:local_start_time] if args.key?(:local_start_time) @has_remote_parent = args[:has_remote_parent] if args.key?(:has_remote_parent) end |