Class: Google::Apis::CloudtraceV2::Span
- Inherits:
-
Object
- Object
- Google::Apis::CloudtraceV2::Span
- Defined in:
- generated/google/apis/cloudtrace_v2/classes.rb,
generated/google/apis/cloudtrace_v2/representations.rb,
generated/google/apis/cloudtrace_v2/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 one or more subspans for its sub-operations. A trace can also contain multiple root spans, or none at all. Spans do not need to be contiguous—there may be gaps or overlaps between spans in a trace.
Instance Attribute Summary collapse
-
#attributes ⇒ Google::Apis::CloudtraceV2::Attributes
A set of attributes, each in the format
[KEY]:[VALUE]. -
#child_span_count ⇒ Fixnum
An optional number of child spans that were generated while this span was active.
-
#display_name ⇒ Google::Apis::CloudtraceV2::TruncatableString
Represents a string that might be shortened to a specified length.
-
#end_time ⇒ String
The end time of the span.
-
#links ⇒ Google::Apis::CloudtraceV2::Links
A collection of links, which are references from this span to a span in the same or different trace.
-
#name ⇒ String
The resource name of the span in the following format: projects/[PROJECT_ID]/traces/[TRACE_ID]/spans/SPAN_ID is a unique identifier for a trace within a project.
-
#parent_span_id ⇒ String
The [SPAN_ID] of this span's parent span.
-
#same_process_as_parent_span ⇒ Boolean
(also: #same_process_as_parent_span?)
A highly recommended but not required flag that identifies when a trace crosses a process boundary.
-
#span_id ⇒ String
The [SPAN_ID] portion of the span's resource name.
-
#stack_trace ⇒ Google::Apis::CloudtraceV2::StackTrace
A call stack appearing in a trace.
-
#start_time ⇒ String
The start time of the span.
-
#status ⇒ Google::Apis::CloudtraceV2::Status
The
Statustype defines a logical error model that is suitable for different programming environments, including REST APIs and RPC APIs. -
#time_events ⇒ Google::Apis::CloudtraceV2::TimeEvents
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 Google::Apis::Core::JsonObjectSupport
Methods included from Google::Apis::Core::Hashable
Constructor Details
#initialize(**args) ⇒ Span
Returns a new instance of Span
415 416 417 |
# File 'generated/google/apis/cloudtrace_v2/classes.rb', line 415 def initialize(**args) update!(**args) end |
Instance Attribute Details
#attributes ⇒ Google::Apis::CloudtraceV2::Attributes
A set of attributes, each in the format [KEY]:[VALUE].
Corresponds to the JSON property attributes
298 299 300 |
# File 'generated/google/apis/cloudtrace_v2/classes.rb', line 298 def attributes @attributes end |
#child_span_count ⇒ Fixnum
An optional number of child spans that were generated while this span
was active. If set, allows implementation to detect missing child spans.
Corresponds to the JSON property childSpanCount
304 305 306 |
# File 'generated/google/apis/cloudtrace_v2/classes.rb', line 304 def child_span_count @child_span_count end |
#display_name ⇒ Google::Apis::CloudtraceV2::TruncatableString
Represents a string that might be shortened to a specified length.
Corresponds to the JSON property displayName
309 310 311 |
# File 'generated/google/apis/cloudtrace_v2/classes.rb', line 309 def display_name @display_name end |
#end_time ⇒ String
The end time of the span. On the client side, this is the time kept by
the local machine where the span execution ends. On the server side, this
is the time when the server application handler stops running.
Corresponds to the JSON property endTime
316 317 318 |
# File 'generated/google/apis/cloudtrace_v2/classes.rb', line 316 def end_time @end_time end |
#links ⇒ Google::Apis::CloudtraceV2::Links
A collection of links, which are references from this span to a span
in the same or different trace.
Corresponds to the JSON property links
322 323 324 |
# File 'generated/google/apis/cloudtrace_v2/classes.rb', line 322 def links @links end |
#name ⇒ String
The resource name of the span in the following format:
projects/[PROJECT_ID]/traces/[TRACE_ID]/spans/SPAN_ID is a unique
identifier for a trace within a project.
[SPAN_ID] is a unique identifier for a span within a trace,
assigned when the span is created.
Corresponds to the JSON property name
331 332 333 |
# File 'generated/google/apis/cloudtrace_v2/classes.rb', line 331 def name @name end |
#parent_span_id ⇒ String
The [SPAN_ID] of this span's parent span. If this is a root span,
then this field must be empty.
Corresponds to the JSON property parentSpanId
337 338 339 |
# File 'generated/google/apis/cloudtrace_v2/classes.rb', line 337 def parent_span_id @parent_span_id end |
#same_process_as_parent_span ⇒ Boolean Also known as: same_process_as_parent_span?
A highly recommended but not required flag that identifies when a trace
crosses a process boundary. True when the parent_span belongs to the
same process as the current span.
Corresponds to the JSON property sameProcessAsParentSpan
344 345 346 |
# File 'generated/google/apis/cloudtrace_v2/classes.rb', line 344 def same_process_as_parent_span @same_process_as_parent_span end |
#span_id ⇒ String
The [SPAN_ID] portion of the span's resource name.
The ID is a 16-character hexadecimal encoding of an 8-byte array.
Corresponds to the JSON property spanId
351 352 353 |
# File 'generated/google/apis/cloudtrace_v2/classes.rb', line 351 def span_id @span_id end |
#stack_trace ⇒ Google::Apis::CloudtraceV2::StackTrace
A call stack appearing in a trace.
Corresponds to the JSON property stackTrace
356 357 358 |
# File 'generated/google/apis/cloudtrace_v2/classes.rb', line 356 def stack_trace @stack_trace end |
#start_time ⇒ String
The start time of the span. On the client side, this is the time kept by
the local machine where the span execution starts. On the server side, this
is the time when the server's application handler starts running.
Corresponds to the JSON property startTime
363 364 365 |
# File 'generated/google/apis/cloudtrace_v2/classes.rb', line 363 def start_time @start_time end |
#status ⇒ Google::Apis::CloudtraceV2::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.rpcthat 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. - 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
406 407 408 |
# File 'generated/google/apis/cloudtrace_v2/classes.rb', line 406 def status @status end |
#time_events ⇒ Google::Apis::CloudtraceV2::TimeEvents
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 a message sent/received between Spans.
Corresponds to the JSON property timeEvents
413 414 415 |
# File 'generated/google/apis/cloudtrace_v2/classes.rb', line 413 def time_events @time_events end |
Instance Method Details
#update!(**args) ⇒ Object
Update properties of this object
420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 |
# File 'generated/google/apis/cloudtrace_v2/classes.rb', line 420 def update!(**args) @attributes = args[:attributes] if args.key?(:attributes) @child_span_count = args[:child_span_count] if args.key?(:child_span_count) @display_name = args[:display_name] if args.key?(:display_name) @end_time = args[:end_time] if args.key?(:end_time) @links = args[:links] if args.key?(:links) @name = args[:name] if args.key?(:name) @parent_span_id = args[:parent_span_id] if args.key?(:parent_span_id) @same_process_as_parent_span = args[:same_process_as_parent_span] if args.key?(:same_process_as_parent_span) @span_id = args[:span_id] if args.key?(:span_id) @stack_trace = args[:stack_trace] if args.key?(:stack_trace) @start_time = args[:start_time] if args.key?(:start_time) @status = args[:status] if args.key?(:status) @time_events = args[:time_events] if args.key?(:time_events) end |