Reference documentation and code samples for the Stackdriver Trace V2 Client class Link.
A pointer from the current span to another span in the same trace or in a
different trace. For example, this can be used in batching operations,
where a single batch handler processes multiple requests from different
traces or when the handler receives a request from a different project.
Generated from protobuf messagegoogle.devtools.cloudtrace.v2.Span.Link
Namespace
Google \ Cloud \ Trace \ V2 \ Span
Methods
__construct
Constructor.
Parameters
Name
Description
data
array
Optional. Data for populating the Message object.
↳ trace_id
string
The[TRACE_ID]for a trace within a project.
↳ span_id
string
The[SPAN_ID]for a span within a trace.
↳ type
int
The relationship of the current span relative to the linked span.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Hard to understand","hardToUnderstand","thumb-down"],["Incorrect information or sample code","incorrectInformationOrSampleCode","thumb-down"],["Missing the information/samples I need","missingTheInformationSamplesINeed","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-09-09 UTC."],[],[],null,["# Stackdriver Trace V2 Client - Class Link (1.8.10)\n\nVersion latestkeyboard_arrow_down\n\n- [1.8.10 (latest)](/php/docs/reference/cloud-trace/latest/V2.Span.Link)\n- [1.8.9](/php/docs/reference/cloud-trace/1.8.9/V2.Span.Link)\n- [1.7.0](/php/docs/reference/cloud-trace/1.7.0/V2.Span.Link)\n- [1.6.5](/php/docs/reference/cloud-trace/1.6.5/V2.Span.Link)\n- [1.5.3](/php/docs/reference/cloud-trace/1.5.3/V2.Span.Link)\n- [1.4.11](/php/docs/reference/cloud-trace/1.4.11/V2.Span.Link) \nReference documentation and code samples for the Stackdriver Trace V2 Client class Link.\n\nA pointer from the current span to another span in the same trace or in a\ndifferent trace. For example, this can be used in batching operations,\nwhere a single batch handler processes multiple requests from different\ntraces or when the handler receives a request from a different project.\n\nGenerated from protobuf message `google.devtools.cloudtrace.v2.Span.Link`\n\nNamespace\n---------\n\nGoogle \\\\ Cloud \\\\ Trace \\\\ V2 \\\\ Span\n\nMethods\n-------\n\n### __construct\n\nConstructor.\n\n### getTraceId\n\nThe `[TRACE_ID]` for a trace within a project.\n\n### setTraceId\n\nThe `[TRACE_ID]` for a trace within a project.\n\n### getSpanId\n\nThe `[SPAN_ID]` for a span within a trace.\n\n### setSpanId\n\nThe `[SPAN_ID]` for a span within a trace.\n\n### getType\n\nThe relationship of the current span relative to the linked span.\n\n### setType\n\nThe relationship of the current span relative to the linked span.\n\n### getAttributes\n\nA set of attributes on the link. Up to 32 attributes can be\nspecified per link.\n\n### hasAttributes\n\n### clearAttributes\n\n### setAttributes\n\nA set of attributes on the link. Up to 32 attributes can be\nspecified per link."]]