Reference documentation and code samples for the Cloud Logging V2 API class Google::Api::Distribution::Exemplar.
Exemplars are example points that may be used to annotate aggregated
distribution values. They are metadata that gives information about a
particular value added to a Distribution bucket, such as a trace ID that
was active when a value was added. They may contain further information,
such as a example values and timestamps, origin, etc.
[[["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-08-28 UTC."],[],[],null,["# Cloud Logging V2 API - Class Google::Api::Distribution::Exemplar (v1.3.0)\n\nVersion latestkeyboard_arrow_down\n\n- [1.3.0 (latest)](/ruby/docs/reference/google-cloud-logging-v2/latest/Google-Api-Distribution-Exemplar)\n- [1.2.1](/ruby/docs/reference/google-cloud-logging-v2/1.2.1/Google-Api-Distribution-Exemplar)\n- [1.1.0](/ruby/docs/reference/google-cloud-logging-v2/1.1.0/Google-Api-Distribution-Exemplar)\n- [1.0.1](/ruby/docs/reference/google-cloud-logging-v2/1.0.1/Google-Api-Distribution-Exemplar)\n- [0.13.0](/ruby/docs/reference/google-cloud-logging-v2/0.13.0/Google-Api-Distribution-Exemplar)\n- [0.12.2](/ruby/docs/reference/google-cloud-logging-v2/0.12.2/Google-Api-Distribution-Exemplar)\n- [0.11.0](/ruby/docs/reference/google-cloud-logging-v2/0.11.0/Google-Api-Distribution-Exemplar)\n- [0.10.1](/ruby/docs/reference/google-cloud-logging-v2/0.10.1/Google-Api-Distribution-Exemplar)\n- [0.9.0](/ruby/docs/reference/google-cloud-logging-v2/0.9.0/Google-Api-Distribution-Exemplar)\n- [0.8.1](/ruby/docs/reference/google-cloud-logging-v2/0.8.1/Google-Api-Distribution-Exemplar)\n- [0.7.0](/ruby/docs/reference/google-cloud-logging-v2/0.7.0/Google-Api-Distribution-Exemplar)\n- [0.6.0](/ruby/docs/reference/google-cloud-logging-v2/0.6.0/Google-Api-Distribution-Exemplar)\n- [0.5.6](/ruby/docs/reference/google-cloud-logging-v2/0.5.6/Google-Api-Distribution-Exemplar) \nReference documentation and code samples for the Cloud Logging V2 API class Google::Api::Distribution::Exemplar.\n\nExemplars are example points that may be used to annotate aggregated\ndistribution values. They are metadata that gives information about a\nparticular value added to a Distribution bucket, such as a trace ID that\nwas active when a value was added. They may contain further information,\nsuch as a example values and timestamps, origin, etc. \n\nInherits\n--------\n\n- Object \n\nExtended By\n-----------\n\n- Google::Protobuf::MessageExts::ClassMethods \n\nIncludes\n--------\n\n- Google::Protobuf::MessageExts\n\nMethods\n-------\n\n### #attachments\n\n def attachments() -\u003e ::Array\u003c::Google::Protobuf::Any\u003e\n\n**Returns**\n\n- (::Array\\\u003c[::Google::Protobuf::Any](./Google-Protobuf-Any)\\\u003e) --- Contextual information about the example value. Examples are:\n\n\n Trace: type.googleapis.com/google.monitoring.v3.SpanContext\n\n Literal string: type.googleapis.com/google.protobuf.StringValue\n\n Labels dropped during aggregation:\n type.googleapis.com/google.monitoring.v3.DroppedLabels\n\n There may be only a single attachment of any given message type in a\n single exemplar, and this is enforced by the system.\n\n### #attachments=\n\n def attachments=(value) -\u003e ::Array\u003c::Google::Protobuf::Any\u003e\n\n**Parameter**\n\n- **value** (::Array\\\u003c[::Google::Protobuf::Any](./Google-Protobuf-Any)\\\u003e) --- Contextual information about the example value. Examples are:\n\n\n Trace: type.googleapis.com/google.monitoring.v3.SpanContext\n\n Literal string: type.googleapis.com/google.protobuf.StringValue\n\n Labels dropped during aggregation:\n type.googleapis.com/google.monitoring.v3.DroppedLabels\n\n There may be only a single attachment of any given message type in a\nsingle exemplar, and this is enforced by the system. \n**Returns**\n\n- (::Array\\\u003c[::Google::Protobuf::Any](./Google-Protobuf-Any)\\\u003e) --- Contextual information about the example value. Examples are:\n\n\n Trace: type.googleapis.com/google.monitoring.v3.SpanContext\n\n Literal string: type.googleapis.com/google.protobuf.StringValue\n\n Labels dropped during aggregation:\n type.googleapis.com/google.monitoring.v3.DroppedLabels\n\n There may be only a single attachment of any given message type in a\n single exemplar, and this is enforced by the system.\n\n### #timestamp\n\n def timestamp() -\u003e ::Google::Protobuf::Timestamp\n\n**Returns**\n\n- ([::Google::Protobuf::Timestamp](./Google-Protobuf-Timestamp)) --- The observation (sampling) time of the above value.\n\n### #timestamp=\n\n def timestamp=(value) -\u003e ::Google::Protobuf::Timestamp\n\n**Parameter**\n\n- **value** ([::Google::Protobuf::Timestamp](./Google-Protobuf-Timestamp)) --- The observation (sampling) time of the above value. \n**Returns**\n\n- ([::Google::Protobuf::Timestamp](./Google-Protobuf-Timestamp)) --- The observation (sampling) time of the above value.\n\n### #value\n\n def value() -\u003e ::Float\n\n**Returns**\n\n- (::Float) --- Value of the exemplar point. This value determines to which bucket the exemplar belongs.\n\n### #value=\n\n def value=(value) -\u003e ::Float\n\n**Parameter**\n\n- **value** (::Float) --- Value of the exemplar point. This value determines to which bucket the exemplar belongs. \n**Returns**\n\n- (::Float) --- Value of the exemplar point. This value determines to which bucket the exemplar belongs."]]