public sealed class AttributeContext : IMessage<AttributeContext>, IEquatable<AttributeContext>, IDeepCloneable<AttributeContext>, IBufferMessage, IMessage
This message defines the standard attribute vocabulary for Google APIs.
An attribute is a piece of metadata that describes an activity on a network
service. For example, the size of an HTTP request, or the status code of
an HTTP response.
Each attribute has a type and a name, which is logically defined as
a proto message field in AttributeContext. The field type becomes the
attribute type, and the field path becomes the attribute name. For example,
the attribute source.ip maps to field AttributeContext.source.ip.
This message definition is guaranteed not to have any wire breaking change.
So you can use it directly for passing attributes across different systems.
NOTE: Different system may generate different subset of attributes. Please
verify the system specification before relying on an attribute generated
a system.
public AttributeContext.Types.Peer Destination { get; set; }
The destination of a network activity, such as accepting a TCP connection.
In a multi hop network activity, the destination represents the receiver of
the last hop.
public AttributeContext.Types.Peer Origin { get; set; }
The origin of a network activity. In a multi hop network activity,
the origin represents the sender of the first hop. For the first hop,
the source and the origin must have the same content.
public AttributeContext.Types.Resource Resource { get; set; }
Represents a target resource that is involved with a network activity.
If multiple resources are involved with an activity, this must be the
primary one.
public AttributeContext.Types.Peer Source { get; set; }
The source of a network activity, such as starting a TCP connection.
In a multi hop network activity, the source represents the sender of the
last hop.
[[["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."],[[["\u003cp\u003e\u003ccode\u003eAttributeContext\u003c/code\u003e is a standard vocabulary for Google APIs, defining metadata for network service activities.\u003c/p\u003e\n"],["\u003cp\u003eAttributes in \u003ccode\u003eAttributeContext\u003c/code\u003e describe network activities using a type and name, which correspond to proto message fields.\u003c/p\u003e\n"],["\u003cp\u003eThe \u003ccode\u003eAttributeContext\u003c/code\u003e message is designed to avoid breaking changes, allowing its use across different systems without issue.\u003c/p\u003e\n"],["\u003cp\u003e\u003ccode\u003eAttributeContext\u003c/code\u003e provides information on various network aspects, including source, destination, request, response, origin, api and extensions.\u003c/p\u003e\n"],["\u003cp\u003e\u003ccode\u003eAttributeContext\u003c/code\u003e offers methods to calculate size, clone, compare, get hash code, merge, convert to string, and write to a stream.\u003c/p\u003e\n"]]],[],null,["# Class AttributeContext (2.17.0)\n\nVersion latestkeyboard_arrow_down\n\n- [2.17.0 (latest)](/dotnet/docs/reference/Google.Api.CommonProtos/latest/Google.Rpc.Context.AttributeContext)\n- [2.15.0](/dotnet/docs/reference/Google.Api.CommonProtos/2.15.0/Google.Rpc.Context.AttributeContext)\n- [2.10.0](/dotnet/docs/reference/Google.Api.CommonProtos/2.10.0/Google.Rpc.Context.AttributeContext)\n- [2.2.0](/dotnet/docs/reference/Google.Api.CommonProtos/2.2.0/Google.Rpc.Context.AttributeContext) \n\n public sealed class AttributeContext : IMessage\u003cAttributeContext\u003e, IEquatable\u003cAttributeContext\u003e, IDeepCloneable\u003cAttributeContext\u003e, IBufferMessage, IMessage\n\nThis message defines the standard attribute vocabulary for Google APIs.\n\nAn attribute is a piece of metadata that describes an activity on a network\nservice. For example, the size of an HTTP request, or the status code of\nan HTTP response.\n\nEach attribute has a type and a name, which is logically defined as\na proto message field in `AttributeContext`. The field type becomes the\nattribute type, and the field path becomes the attribute name. For example,\nthe attribute `source.ip` maps to field `AttributeContext.source.ip`.\n\nThis message definition is guaranteed not to have any wire breaking change.\nSo you can use it directly for passing attributes across different systems.\n\nNOTE: Different system may generate different subset of attributes. Please\nverify the system specification before relying on an attribute generated\na system. \n\nInheritance\n-----------\n\n[object](https://learn.microsoft.com/dotnet/api/system.object) \\\u003e AttributeContext \n\nImplements\n----------\n\n[IMessage](https://cloud.google.com/dotnet/docs/reference/Google.Protobuf/latest/Google.Protobuf.IMessage-1.html)[AttributeContext](/dotnet/docs/reference/Google.Api.CommonProtos/latest/Google.Rpc.Context.AttributeContext), [IEquatable](https://learn.microsoft.com/dotnet/api/system.iequatable-1)[AttributeContext](/dotnet/docs/reference/Google.Api.CommonProtos/latest/Google.Rpc.Context.AttributeContext), [IDeepCloneable](https://cloud.google.com/dotnet/docs/reference/Google.Protobuf/latest/Google.Protobuf.IDeepCloneable-1.html)[AttributeContext](/dotnet/docs/reference/Google.Api.CommonProtos/latest/Google.Rpc.Context.AttributeContext), [IBufferMessage](https://cloud.google.com/dotnet/docs/reference/Google.Protobuf/latest/Google.Protobuf.IBufferMessage.html), [IMessage](https://cloud.google.com/dotnet/docs/reference/Google.Protobuf/latest/Google.Protobuf.IMessage.html) \n\nInherited Members\n-----------------\n\n[object.Equals(object, object)](https://learn.microsoft.com/dotnet/api/system.object.equals#system-object-equals(system-object-system-object)) \n[object.GetType()](https://learn.microsoft.com/dotnet/api/system.object.gettype) \n[object.ReferenceEquals(object, object)](https://learn.microsoft.com/dotnet/api/system.object.referenceequals)\n\nNamespace\n---------\n\n[Google.Rpc.Context](/dotnet/docs/reference/Google.Api.CommonProtos/latest/Google.Rpc.Context)\n\nAssembly\n--------\n\nGoogle.Api.CommonProtos.dll\n\nConstructors\n------------\n\n### AttributeContext()\n\n public AttributeContext()\n\n### AttributeContext(AttributeContext)\n\n public AttributeContext(AttributeContext other)\n\nFields\n------\n\n### ApiFieldNumber\n\n public const int ApiFieldNumber = 6\n\nField number for the \"api\" field.\n\n### DestinationFieldNumber\n\n public const int DestinationFieldNumber = 2\n\nField number for the \"destination\" field.\n\n### ExtensionsFieldNumber\n\n public const int ExtensionsFieldNumber = 8\n\nField number for the \"extensions\" field.\n\n### OriginFieldNumber\n\n public const int OriginFieldNumber = 7\n\nField number for the \"origin\" field.\n\n### RequestFieldNumber\n\n public const int RequestFieldNumber = 3\n\nField number for the \"request\" field.\n\n### ResourceFieldNumber\n\n public const int ResourceFieldNumber = 5\n\nField number for the \"resource\" field.\n\n### ResponseFieldNumber\n\n public const int ResponseFieldNumber = 4\n\nField number for the \"response\" field.\n\n### SourceFieldNumber\n\n public const int SourceFieldNumber = 1\n\nField number for the \"source\" field.\n\nProperties\n----------\n\n### Api\n\n public AttributeContext.Types.Api Api { get; set; }\n\nRepresents an API operation that is involved to a network activity.\n\n### Descriptor\n\n public static MessageDescriptor Descriptor { get; }\n\n### Destination\n\n public AttributeContext.Types.Peer Destination { get; set; }\n\nThe destination of a network activity, such as accepting a TCP connection.\nIn a multi hop network activity, the destination represents the receiver of\nthe last hop.\n\n### Extensions\n\n public RepeatedField\u003cAny\u003e Extensions { get; }\n\nSupports extensions for advanced use cases, such as logs and metrics.\n\n### Origin\n\n public AttributeContext.Types.Peer Origin { get; set; }\n\nThe origin of a network activity. In a multi hop network activity,\nthe origin represents the sender of the first hop. For the first hop,\nthe `source` and the `origin` must have the same content.\n\n### Parser\n\n public static MessageParser\u003cAttributeContext\u003e Parser { get; }\n\n### Request\n\n public AttributeContext.Types.Request Request { get; set; }\n\nRepresents a network request, such as an HTTP request.\n\n### Resource\n\n public AttributeContext.Types.Resource Resource { get; set; }\n\nRepresents a target resource that is involved with a network activity.\nIf multiple resources are involved with an activity, this must be the\nprimary one.\n\n### Response\n\n public AttributeContext.Types.Response Response { get; set; }\n\nRepresents a network response, such as an HTTP response.\n\n### Source\n\n public AttributeContext.Types.Peer Source { get; set; }\n\nThe source of a network activity, such as starting a TCP connection.\nIn a multi hop network activity, the source represents the sender of the\nlast hop.\n\nMethods\n-------\n\n### CalculateSize()\n\n public int CalculateSize()\n\n### Clone()\n\n public AttributeContext Clone()\n\n### Equals(AttributeContext)\n\n public bool Equals(AttributeContext other)\n\n### Equals(object)\n\n public override bool Equals(object other)\n\n**Overrides** \n[object.Equals(object)](https://learn.microsoft.com/dotnet/api/system.object.equals#system-object-equals(system-object))\n\n### GetHashCode()\n\n public override int GetHashCode()\n\n**Overrides** \n[object.GetHashCode()](https://learn.microsoft.com/dotnet/api/system.object.gethashcode)\n\n### MergeFrom(CodedInputStream)\n\n public void MergeFrom(CodedInputStream input)\n\n### MergeFrom(AttributeContext)\n\n public void MergeFrom(AttributeContext other)\n\n### ToString()\n\n public override string ToString()\n\n**Overrides** \n[object.ToString()](https://learn.microsoft.com/dotnet/api/system.object.tostring)\n\n### WriteTo(CodedOutputStream)\n\n public void WriteTo(CodedOutputStream output)"]]