GCP Stackdriver Trace (version v1.*.*)

create_span

Creates a new span.

Parameters

name (required)

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; it is a 32-character hexadecimal encoding of a 16-byte array.

[SPAN_ID] is a unique identifier for a span within a trace; it is a 16-character hexadecimal encoding of an 8-byte array.

Type: string

$.xgafv

V1 error format.

Type: string

Potential values: 1, 2

$body

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.

Type: object

{
  "displayName" : {
    "truncatedByteCount" : "The number of bytes removed from the original string. If this\nvalue is 0, then the string was not shortened.",
    "value" : "The shortened string. For example, if the original string is 500\nbytes long and the limit of the string is 128 bytes, then\n`value` contains the first 128 bytes of the 500-byte string.\n\nTruncation always happens on a UTF8 character boundary. If there\nare multi-byte characters in the string, then the length of the\nshortened string might be less than the size limit."
  },
  "spanKind" : "Distinguishes between spans generated in a particular context. For example,\ntwo spans with the same name may be distinguished using `CLIENT` (caller)\nand `SERVER` (callee) to identify an RPC call.",
  "parentSpanId" : "The [SPAN_ID] of this span's parent span. If this is a root span,\nthen this field must be empty.",
  "spanId" : "Required. The [SPAN_ID] portion of the span's resource name.",
  "childSpanCount" : "Optional. The number of child spans that were generated while this span\nwas active. If set, allows implementation to detect missing child spans.",
  "name" : "The resource name of the span in the following format:\n\n    projects/[PROJECT_ID]/traces/[TRACE_ID]/spans/SPAN_ID is a unique identifier for a trace within a project;\nit is a 32-character hexadecimal encoding of a 16-byte array.\n\n[SPAN_ID] is a unique identifier for a span within a trace; it\nis a 16-character hexadecimal encoding of an 8-byte array.",
  "attributes" : {
    "attributeMap" : "The set of attributes. Each attribute's key can be up to 128 bytes\nlong. The value can be a string up to 256 bytes, a signed 64-bit integer,\nor the Boolean values `true` and `false`. For example:\n\n    \"/instance_id\": \"my-instance\"\n    \"/http/user_agent\": \"\"\n    \"/http/request_bytes\": 300\n    \"abc.com/myattribute\": true",
    "droppedAttributesCount" : "The number of attributes that were discarded. Attributes can be discarded\nbecause their keys are too long or because there are too many attributes.\nIf this value is 0 then all attributes are valid."
  },
  "links" : {
    "droppedLinksCount" : "The number of dropped links after the maximum size was enforced. If\nthis value is 0, then no links were dropped.",
    "link" : [ {
      "spanId" : "The [SPAN_ID] for a span within a trace.",
      "traceId" : "The [TRACE_ID] for a trace within a project.",
      "attributes" : {
        "attributeMap" : "The set of attributes. Each attribute's key can be up to 128 bytes\nlong. The value can be a string up to 256 bytes, a signed 64-bit integer,\nor the Boolean values `true` and `false`. For example:\n\n    \"/instance_id\": \"my-instance\"\n    \"/http/user_agent\": \"\"\n    \"/http/request_bytes\": 300\n    \"abc.com/myattribute\": true",
        "droppedAttributesCount" : "The number of attributes that were discarded. Attributes can be discarded\nbecause their keys are too long or because there are too many attributes.\nIf this value is 0 then all attributes are valid."
      },
      "type" : "The relationship of the current span relative to the linked span."
    } ]
  },
  "startTime" : "Required. The start time of the span. On the client side, this is the time kept by\nthe local machine where the span execution starts. On the server side, this\nis the time when the server's application handler starts running.",
  "endTime" : "Required. The end time of the span. On the client side, this is the time kept by\nthe local machine where the span execution ends. On the server side, this\nis the time when the server application handler stops running.",
  "sameProcessAsParentSpan" : "Optional. Set this parameter to indicate whether this span is in\nthe same process as its parent. If you do not set this parameter,\nStackdriver Trace is unable to take advantage of this helpful\ninformation.",
  "stackTrace" : {
    "stackFrames" : {
      "droppedFramesCount" : "The number of stack frames that were dropped because there\nwere too many stack frames.\nIf this value is 0, then no stack frames were dropped.",
      "frame" : [ {
        "fileName" : {
          "truncatedByteCount" : "The number of bytes removed from the original string. If this\nvalue is 0, then the string was not shortened.",
          "value" : "The shortened string. For example, if the original string is 500\nbytes long and the limit of the string is 128 bytes, then\n`value` contains the first 128 bytes of the 500-byte string.\n\nTruncation always happens on a UTF8 character boundary. If there\nare multi-byte characters in the string, then the length of the\nshortened string might be less than the size limit."
        },
        "originalFunctionName" : {
          "truncatedByteCount" : "The number of bytes removed from the original string. If this\nvalue is 0, then the string was not shortened.",
          "value" : "The shortened string. For example, if the original string is 500\nbytes long and the limit of the string is 128 bytes, then\n`value` contains the first 128 bytes of the 500-byte string.\n\nTruncation always happens on a UTF8 character boundary. If there\nare multi-byte characters in the string, then the length of the\nshortened string might be less than the size limit."
        },
        "columnNumber" : "The column number where the function call appears, if available.\nThis is important in JavaScript because of its anonymous functions.",
        "functionName" : {
          "truncatedByteCount" : "The number of bytes removed from the original string. If this\nvalue is 0, then the string was not shortened.",
          "value" : "The shortened string. For example, if the original string is 500\nbytes long and the limit of the string is 128 bytes, then\n`value` contains the first 128 bytes of the 500-byte string.\n\nTruncation always happens on a UTF8 character boundary. If there\nare multi-byte characters in the string, then the length of the\nshortened string might be less than the size limit."
        },
        "sourceVersion" : {
          "truncatedByteCount" : "The number of bytes removed from the original string. If this\nvalue is 0, then the string was not shortened.",
          "value" : "The shortened string. For example, if the original string is 500\nbytes long and the limit of the string is 128 bytes, then\n`value` contains the first 128 bytes of the 500-byte string.\n\nTruncation always happens on a UTF8 character boundary. If there\nare multi-byte characters in the string, then the length of the\nshortened string might be less than the size limit."
        },
        "loadModule" : {
          "module" : {
            "truncatedByteCount" : "The number of bytes removed from the original string. If this\nvalue is 0, then the string was not shortened.",
            "value" : "The shortened string. For example, if the original string is 500\nbytes long and the limit of the string is 128 bytes, then\n`value` contains the first 128 bytes of the 500-byte string.\n\nTruncation always happens on a UTF8 character boundary. If there\nare multi-byte characters in the string, then the length of the\nshortened string might be less than the size limit."
          },
          "buildId" : {
            "truncatedByteCount" : "The number of bytes removed from the original string. If this\nvalue is 0, then the string was not shortened.",
            "value" : "The shortened string. For example, if the original string is 500\nbytes long and the limit of the string is 128 bytes, then\n`value` contains the first 128 bytes of the 500-byte string.\n\nTruncation always happens on a UTF8 character boundary. If there\nare multi-byte characters in the string, then the length of the\nshortened string might be less than the size limit."
          }
        },
        "lineNumber" : "The line number in `file_name` where the function call appears."
      } ]
    },
    "stackTraceHashId" : "The hash ID is used to conserve network bandwidth for duplicate\nstack traces within a single trace.\n\nOften multiple spans will have identical stack traces.\nThe first occurrence of a stack trace should contain both the\n`stackFrame` content and a value in `stackTraceHashId`.\n\nSubsequent spans within the same request can refer\nto that stack trace by only setting `stackTraceHashId`."
  },
  "timeEvents" : {
    "droppedMessageEventsCount" : "The number of dropped message events in all the included time events.\nIf the value is 0, then no message events were dropped.",
    "droppedAnnotationsCount" : "The number of dropped annotations in all the included time events.\nIf the value is 0, then no annotations were dropped.",
    "timeEvent" : [ {
      "annotation" : {
        "description" : {
          "truncatedByteCount" : "The number of bytes removed from the original string. If this\nvalue is 0, then the string was not shortened.",
          "value" : "The shortened string. For example, if the original string is 500\nbytes long and the limit of the string is 128 bytes, then\n`value` contains the first 128 bytes of the 500-byte string.\n\nTruncation always happens on a UTF8 character boundary. If there\nare multi-byte characters in the string, then the length of the\nshortened string might be less than the size limit."
        },
        "attributes" : {
          "attributeMap" : "The set of attributes. Each attribute's key can be up to 128 bytes\nlong. The value can be a string up to 256 bytes, a signed 64-bit integer,\nor the Boolean values `true` and `false`. For example:\n\n    \"/instance_id\": \"my-instance\"\n    \"/http/user_agent\": \"\"\n    \"/http/request_bytes\": 300\n    \"abc.com/myattribute\": true",
          "droppedAttributesCount" : "The number of attributes that were discarded. Attributes can be discarded\nbecause their keys are too long or because there are too many attributes.\nIf this value is 0 then all attributes are valid."
        }
      },
      "messageEvent" : {
        "compressedSizeBytes" : "The number of compressed bytes sent or received. If missing assumed to\nbe the same size as uncompressed.",
        "id" : "An identifier for the MessageEvent's message that can be used to match\nSENT and RECEIVED MessageEvents. It is recommended to be unique within\na Span.",
        "type" : "Type of MessageEvent. Indicates whether the message was sent or\nreceived.",
        "uncompressedSizeBytes" : "The number of uncompressed bytes sent or received."
      },
      "time" : "The timestamp indicating the time the event occurred."
    } ]
  },
  "status" : {
    "code" : "The status code, which should be an enum value of google.rpc.Code.",
    "details" : [ { } ],
    "message" : "A developer-facing error message, which should be in English. Any\nuser-facing error message should be localized and sent in the\ngoogle.rpc.Status.details field, or localized by the client."
  }
}

access_token

OAuth access token.

Type: string

alt

Data format for response.

Type: string

Potential values: json, media, proto

callback

JSONP

Type: string

fields

Selector specifying which fields to include in a partial response.

Type: string

key

API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token.

Type: string

oauth_token

OAuth 2.0 token for the current user.

Type: string

prettyPrint

Returns response with indentations and line breaks.

Type: boolean

quotaUser

Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters.

Type: string

uploadType

Legacy upload protocol for media (e.g. "media", "multipart").

Type: string

upload_protocol

Upload protocol for media (e.g. "raw", "multipart").

Type: string

send_new_spans

Sends new spans to new or existing traces. You cannot update existing spans.

Parameters

name (required)

Required. The name of the project where the spans belong. The format is projects/[PROJECT_ID].

Type: string

$.xgafv

V1 error format.

Type: string

Potential values: 1, 2

$body

The request message for the BatchWriteSpans method.

Type: object

{
  "spans" : [ {
    "displayName" : {
      "truncatedByteCount" : "The number of bytes removed from the original string. If this\nvalue is 0, then the string was not shortened.",
      "value" : "The shortened string. For example, if the original string is 500\nbytes long and the limit of the string is 128 bytes, then\n`value` contains the first 128 bytes of the 500-byte string.\n\nTruncation always happens on a UTF8 character boundary. If there\nare multi-byte characters in the string, then the length of the\nshortened string might be less than the size limit."
    },
    "spanKind" : "Distinguishes between spans generated in a particular context. For example,\ntwo spans with the same name may be distinguished using `CLIENT` (caller)\nand `SERVER` (callee) to identify an RPC call.",
    "parentSpanId" : "The [SPAN_ID] of this span's parent span. If this is a root span,\nthen this field must be empty.",
    "spanId" : "Required. The [SPAN_ID] portion of the span's resource name.",
    "childSpanCount" : "Optional. The number of child spans that were generated while this span\nwas active. If set, allows implementation to detect missing child spans.",
    "name" : "The resource name of the span in the following format:\n\n    projects/[PROJECT_ID]/traces/[TRACE_ID]/spans/SPAN_ID is a unique identifier for a trace within a project;\nit is a 32-character hexadecimal encoding of a 16-byte array.\n\n[SPAN_ID] is a unique identifier for a span within a trace; it\nis a 16-character hexadecimal encoding of an 8-byte array.",
    "attributes" : {
      "attributeMap" : "The set of attributes. Each attribute's key can be up to 128 bytes\nlong. The value can be a string up to 256 bytes, a signed 64-bit integer,\nor the Boolean values `true` and `false`. For example:\n\n    \"/instance_id\": \"my-instance\"\n    \"/http/user_agent\": \"\"\n    \"/http/request_bytes\": 300\n    \"abc.com/myattribute\": true",
      "droppedAttributesCount" : "The number of attributes that were discarded. Attributes can be discarded\nbecause their keys are too long or because there are too many attributes.\nIf this value is 0 then all attributes are valid."
    },
    "links" : {
      "droppedLinksCount" : "The number of dropped links after the maximum size was enforced. If\nthis value is 0, then no links were dropped.",
      "link" : [ {
        "spanId" : "The [SPAN_ID] for a span within a trace.",
        "traceId" : "The [TRACE_ID] for a trace within a project.",
        "attributes" : {
          "attributeMap" : "The set of attributes. Each attribute's key can be up to 128 bytes\nlong. The value can be a string up to 256 bytes, a signed 64-bit integer,\nor the Boolean values `true` and `false`. For example:\n\n    \"/instance_id\": \"my-instance\"\n    \"/http/user_agent\": \"\"\n    \"/http/request_bytes\": 300\n    \"abc.com/myattribute\": true",
          "droppedAttributesCount" : "The number of attributes that were discarded. Attributes can be discarded\nbecause their keys are too long or because there are too many attributes.\nIf this value is 0 then all attributes are valid."
        },
        "type" : "The relationship of the current span relative to the linked span."
      } ]
    },
    "startTime" : "Required. The start time of the span. On the client side, this is the time kept by\nthe local machine where the span execution starts. On the server side, this\nis the time when the server's application handler starts running.",
    "endTime" : "Required. The end time of the span. On the client side, this is the time kept by\nthe local machine where the span execution ends. On the server side, this\nis the time when the server application handler stops running.",
    "sameProcessAsParentSpan" : "Optional. Set this parameter to indicate whether this span is in\nthe same process as its parent. If you do not set this parameter,\nStackdriver Trace is unable to take advantage of this helpful\ninformation.",
    "stackTrace" : {
      "stackFrames" : {
        "droppedFramesCount" : "The number of stack frames that were dropped because there\nwere too many stack frames.\nIf this value is 0, then no stack frames were dropped.",
        "frame" : [ {
          "fileName" : {
            "truncatedByteCount" : "The number of bytes removed from the original string. If this\nvalue is 0, then the string was not shortened.",
            "value" : "The shortened string. For example, if the original string is 500\nbytes long and the limit of the string is 128 bytes, then\n`value` contains the first 128 bytes of the 500-byte string.\n\nTruncation always happens on a UTF8 character boundary. If there\nare multi-byte characters in the string, then the length of the\nshortened string might be less than the size limit."
          },
          "originalFunctionName" : {
            "truncatedByteCount" : "The number of bytes removed from the original string. If this\nvalue is 0, then the string was not shortened.",
            "value" : "The shortened string. For example, if the original string is 500\nbytes long and the limit of the string is 128 bytes, then\n`value` contains the first 128 bytes of the 500-byte string.\n\nTruncation always happens on a UTF8 character boundary. If there\nare multi-byte characters in the string, then the length of the\nshortened string might be less than the size limit."
          },
          "columnNumber" : "The column number where the function call appears, if available.\nThis is important in JavaScript because of its anonymous functions.",
          "functionName" : {
            "truncatedByteCount" : "The number of bytes removed from the original string. If this\nvalue is 0, then the string was not shortened.",
            "value" : "The shortened string. For example, if the original string is 500\nbytes long and the limit of the string is 128 bytes, then\n`value` contains the first 128 bytes of the 500-byte string.\n\nTruncation always happens on a UTF8 character boundary. If there\nare multi-byte characters in the string, then the length of the\nshortened string might be less than the size limit."
          },
          "sourceVersion" : {
            "truncatedByteCount" : "The number of bytes removed from the original string. If this\nvalue is 0, then the string was not shortened.",
            "value" : "The shortened string. For example, if the original string is 500\nbytes long and the limit of the string is 128 bytes, then\n`value` contains the first 128 bytes of the 500-byte string.\n\nTruncation always happens on a UTF8 character boundary. If there\nare multi-byte characters in the string, then the length of the\nshortened string might be less than the size limit."
          },
          "loadModule" : {
            "module" : {
              "truncatedByteCount" : "The number of bytes removed from the original string. If this\nvalue is 0, then the string was not shortened.",
              "value" : "The shortened string. For example, if the original string is 500\nbytes long and the limit of the string is 128 bytes, then\n`value` contains the first 128 bytes of the 500-byte string.\n\nTruncation always happens on a UTF8 character boundary. If there\nare multi-byte characters in the string, then the length of the\nshortened string might be less than the size limit."
            },
            "buildId" : {
              "truncatedByteCount" : "The number of bytes removed from the original string. If this\nvalue is 0, then the string was not shortened.",
              "value" : "The shortened string. For example, if the original string is 500\nbytes long and the limit of the string is 128 bytes, then\n`value` contains the first 128 bytes of the 500-byte string.\n\nTruncation always happens on a UTF8 character boundary. If there\nare multi-byte characters in the string, then the length of the\nshortened string might be less than the size limit."
            }
          },
          "lineNumber" : "The line number in `file_name` where the function call appears."
        } ]
      },
      "stackTraceHashId" : "The hash ID is used to conserve network bandwidth for duplicate\nstack traces within a single trace.\n\nOften multiple spans will have identical stack traces.\nThe first occurrence of a stack trace should contain both the\n`stackFrame` content and a value in `stackTraceHashId`.\n\nSubsequent spans within the same request can refer\nto that stack trace by only setting `stackTraceHashId`."
    },
    "timeEvents" : {
      "droppedMessageEventsCount" : "The number of dropped message events in all the included time events.\nIf the value is 0, then no message events were dropped.",
      "droppedAnnotationsCount" : "The number of dropped annotations in all the included time events.\nIf the value is 0, then no annotations were dropped.",
      "timeEvent" : [ {
        "annotation" : {
          "description" : {
            "truncatedByteCount" : "The number of bytes removed from the original string. If this\nvalue is 0, then the string was not shortened.",
            "value" : "The shortened string. For example, if the original string is 500\nbytes long and the limit of the string is 128 bytes, then\n`value` contains the first 128 bytes of the 500-byte string.\n\nTruncation always happens on a UTF8 character boundary. If there\nare multi-byte characters in the string, then the length of the\nshortened string might be less than the size limit."
          },
          "attributes" : {
            "attributeMap" : "The set of attributes. Each attribute's key can be up to 128 bytes\nlong. The value can be a string up to 256 bytes, a signed 64-bit integer,\nor the Boolean values `true` and `false`. For example:\n\n    \"/instance_id\": \"my-instance\"\n    \"/http/user_agent\": \"\"\n    \"/http/request_bytes\": 300\n    \"abc.com/myattribute\": true",
            "droppedAttributesCount" : "The number of attributes that were discarded. Attributes can be discarded\nbecause their keys are too long or because there are too many attributes.\nIf this value is 0 then all attributes are valid."
          }
        },
        "messageEvent" : {
          "compressedSizeBytes" : "The number of compressed bytes sent or received. If missing assumed to\nbe the same size as uncompressed.",
          "id" : "An identifier for the MessageEvent's message that can be used to match\nSENT and RECEIVED MessageEvents. It is recommended to be unique within\na Span.",
          "type" : "Type of MessageEvent. Indicates whether the message was sent or\nreceived.",
          "uncompressedSizeBytes" : "The number of uncompressed bytes sent or received."
        },
        "time" : "The timestamp indicating the time the event occurred."
      } ]
    },
    "status" : {
      "code" : "The status code, which should be an enum value of google.rpc.Code.",
      "details" : [ { } ],
      "message" : "A developer-facing error message, which should be in English. Any\nuser-facing error message should be localized and sent in the\ngoogle.rpc.Status.details field, or localized by the client."
    }
  } ]
}

access_token

OAuth access token.

Type: string

alt

Data format for response.

Type: string

Potential values: json, media, proto

callback

JSONP

Type: string

fields

Selector specifying which fields to include in a partial response.

Type: string

key

API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token.

Type: string

oauth_token

OAuth 2.0 token for the current user.

Type: string

prettyPrint

Returns response with indentations and line breaks.

Type: boolean

quotaUser

Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters.

Type: string

uploadType

Legacy upload protocol for media (e.g. "media", "multipart").

Type: string

upload_protocol

Upload protocol for media (e.g. "raw", "multipart").

Type: string