@@ -16,12 +16,12 @@ syntax = "proto3";
16
16
17
17
import "google/protobuf/struct.proto" ;
18
18
19
- import "mixer/v1/config/descriptor/attribute_descriptor.proto" ;
20
19
import "mixer/v1/config/descriptor/log_entry_descriptor.proto" ;
21
20
import "mixer/v1/config/descriptor/metric_descriptor.proto" ;
22
21
import "mixer/v1/config/descriptor/monitored_resource_descriptor.proto" ;
23
22
import "mixer/v1/config/descriptor/principal_descriptor.proto" ;
24
23
import "mixer/v1/config/descriptor/quota_descriptor.proto" ;
24
+ import "mixer/v1/config/descriptor/value_type.proto" ;
25
25
26
26
27
27
package istio.mixer.v1.config ;
@@ -119,7 +119,7 @@ message Aspect {
119
119
//
120
120
// In the following example we define a `metrics` adapter using the Mixer's prepackaged
121
121
// prometheus adapter. This adapter doesn't require any parameters.
122
- //
122
+ //
123
123
// ```yaml
124
124
// kind: metrics
125
125
// name: prometheus-adapter
@@ -177,9 +177,68 @@ message AttributeManifest {
177
177
// `attributes` kind adapter in Mixer.
178
178
string name = 2 ;
179
179
180
- // The set of attributes this Istio component will be responsible for
181
- // producing at runtime.
182
- repeated istio.mixer.v1.config.descriptor.AttributeDescriptor attributes = 3 ;
180
+ // AttributeInfo describes the schema of an Istio `Attribute`.
181
+ //
182
+ // ## Istio Attributes
183
+ //
184
+ // Istio uses `attributes` to describe runtime activities of Istio services.
185
+ // An Istio attribute carries a specific piece of information about an activity,
186
+ // such as the error code of an API request, the latency of an API request, or the
187
+ // original IP address of a TCP connection. The attributes are often generated
188
+ // and consumed by different services. For example, a frontend service can
189
+ // generate an authenticated user attribute and pass it to a backend service for
190
+ // access control purpose.
191
+ //
192
+ // To simplify the system and improve developer experience, Istio uses
193
+ // shared attribute definitions across all components. For example, the same
194
+ // authenticated user attribute will be used for logging, monitoring, analytics,
195
+ // billing, access control, auditing. Many Istio components provide their
196
+ // functionality by collecting, generating, and operating on attributes.
197
+ // For example, the proxy collects the error code attribute, and the logging
198
+ // stores it into a log.
199
+ //
200
+ // ## Design
201
+ //
202
+ // Each Istio attribute must conform to an `AttributeInfo` in an
203
+ // `AttributeManifest` in the current Istio deployment at runtime. An
204
+ // [`AttributeInfo`][istio.mixer.v1.config] is used to define an attribute's
205
+ // metadata: the type of its value and a detailed description that explains
206
+ // the semantics of the attribute type. Each attribute's name is globally unique;
207
+ // in other words an attribute name can only appear once across all manifests.
208
+ //
209
+ // The runtime presentation of an attribute is intentionally left out of this
210
+ // specification, because passing attribute using JSON, XML, or Protocol Buffers
211
+ // does not change the semantics of the attribute. Different implementations
212
+ // can choose different representations based on their needs.
213
+ //
214
+ // ## HTTP Mapping
215
+ //
216
+ // Because many systems already have REST APIs, it makes sense to define a
217
+ // standard HTTP mapping for Istio attributes that are compatible with typical
218
+ // REST APIs. The design is to map one attribute to one HTTP header, the
219
+ // attribute name and value becomes the HTTP header name and value. The actual
220
+ // encoding scheme will be decided later.
221
+ message AttributeInfo {
222
+ // Optional. A human-readable description of the attribute's purpose.
223
+ string description = 1 ;
224
+
225
+ // Required. The type of data carried by this attribute.
226
+ istio.mixer.v1.config.descriptor.ValueType value_type = 2 ;
227
+ }
228
+ // The set of attributes this Istio component will be responsible for producing at runtime.
229
+ // We map from attribute name to the attribute's specification. The name of an attribute,
230
+ // which is how attributes are referred to in aspect configuration, must conform to:
231
+ //
232
+ // Name = IDENT { SEPARATOR IDENT };
233
+ //
234
+ // Where `IDENT` must match the regular expression `[a-z][a-z0-9]+` and `SEPARATOR` must
235
+ // match the regular expression `[\.-]`.
236
+ //
237
+ // Attribute names must be unique within a single Istio deployment. The set of canonical
238
+ // attributes are described at https://istio.io/docs/reference/attribute-vocabulary.html.
239
+ // Attributes not in that list should be named with a component-specific suffix such as
240
+ // request.count-my.component
241
+ map <string , AttributeInfo > attributes = 3 ;
183
242
}
184
243
185
244
// Uri represents a properly formed URI.
0 commit comments