Skip to content

Commit a06f6a1

Browse files
author
Shriram Rajagopalan
committed
2 parents 2ac27ed + 95cde56 commit a06f6a1

File tree

2 files changed

+33
-115
lines changed

2 files changed

+33
-115
lines changed

docs/concepts/mixer-config.md

Lines changed: 18 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ This page describes the Istio mixer's configuration model.
1818
## Background
1919

2020
Istio is a sophisticated system with hundreds of independent features. An Istio deployment can be a sprawling
21-
affair potentially involving dozens of microservices, with a swarm of Istio proxy and mixer instances to
21+
affair potentially involving dozens of microservices, with a swarm of Envoy proxies and Mixer instances to
2222
support them. In large deployments, many different operators, each with different scope and areas of responsibility,
2323
may be involved in managing the overall deployment.
2424

@@ -312,21 +312,34 @@ metrics:
312312
source: STRING
313313
target: STRING
314314
service: STRING
315-
method: STRING
316315
response_code: INT64
317316
```
318317

319318
The above is declaring that the system can produce metrics called `request_count`.
320319
Such metrics will hold 64-bit integer values and be managed as absolute counters. Each
321-
metric reported will have five labels, two specifying the source and
322-
target names, one being the service name, one being the name of an API method and
323-
the other being the response code for the request. Given this descriptor, Mixer
320+
metric reported will have four labels, two specifying the source and
321+
target names, one being the service name, the other being the response code for the request.
322+
Given this descriptor, Mixer
324323
can ensure that generated metrics are always properly formed, can arrange for efficient
325324
storage for these metrics, and can ensure backend systems are ready to accept
326325
these metrics. The `display_name` and `description` fields are optional and
327326
are communicated to backend systems which can use the text to enhance their
328327
metric visualization interfaces.
329328

329+
Explicitly defining descriptors and creating adapter parameters using them is akin to types and objects in a traditional
330+
programming language. Doing so enables a few important scenarios:
331+
332+
- Having the set of descriptors explicitly defined enables Istio to program backend systems to accept traffic produced
333+
by Mixer. For example, a metric descriptor provides all the information needed to program a backend system to accept metrics
334+
that conform to the descriptor's shape (it's value type and its set of labels).
335+
336+
- It enables type checking of the deployment's configuration. Since attributes have strong types, and so do descriptors,
337+
Istio can provide a number of strong correctness guarantees of the system's configuration. Basically, if a chunk of
338+
configuration is accepted into the Istio system, it means the configuration passes a minimum correctness bar. Again, this
339+
plays the same role as types in a programming language.
340+
341+
- It enables Istio to provide a strongly-typed scripting environment as discussed [here](./mixer.md#scripting)
342+
330343
The different descriptor types are detailed in *TBD*
331344

332345
### Scopes

docs/concepts/mixer.md

Lines changed: 15 additions & 110 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ layout: docs
77
type: markdown
88
---
99
{% capture overview %}
10-
The page explains Istio's Mixer's role and general architecture.
10+
The page explains Mixer's role and general architecture.
1111
{% endcapture %}
1212

1313
{% capture body %}
@@ -21,7 +21,8 @@ to Mixer, which proceeds to repackage and redirect the data towards configured b
2121
Services within the Istio mesh can also directly integrate with Mixer. For example, services may wish to provide rich telemetry
2222
for particular operations beyond what Envoy automatically collects. Or services may use Mixer for resource-oriented quota
2323
management. Services that leverage Mixer in this way are abstracted from environment-specific control plane details, greatly
24-
easing the process of hosting the code in different environments (different clouds and on-prem)
24+
easing the process of hosting the code in different environments (different clouds and on-prem). (Please note that
25+
as of the Alpha release of Istio, only Envoy can calls Mixer directly.)
2526

2627
<img style="display:block;width:60%;margin:auto;" src="./mixer/traffic.svg" alt="Flow of traffic." />
2728
<p style="text-align:center;">Mixer Traffic Flow</p>
@@ -40,119 +41,23 @@ examples of quotas.
4041

4142
These mechanisms are applied based on a set of [attributes]({{site.baseurl}}/docs/concepts/attributes.html) that are
4243
materialized for every request into Mixer. Within Istio, Envoy depends heavily on Mixer. Services running within the mesh
43-
can also use Mixer to report telemetry or manage quotas.
44+
can also use Mixer to report telemetry or manage quotas. (Note: as of Istio Alpha, only Envoy can call Mixer.)
4445

4546
## Adapters
4647

47-
Mixer abstracts away the implementation details of individual policy and telemetry backend systems. This insulates
48-
Envoy and services within the mesh from those details, keeping them portable.
48+
Mixer is a highly modular and extensible component. One of it's key functions is to abstract
49+
away the details of different policy and telemetry backend systems, allowing Envoy and Istio-based
50+
services to be agnostic of those backends, which keeps them portable.
4951

50-
Adapters are binary-level plugins to Mixer which allow Mixer to interface
51-
to different backend systems that deliver core control-plane functionality, such as logging, monitoring, quotas, ACL checking, and more. Adapters
52-
enable Mixer to expose a single consistent control API, independent of the backends in use. The exact set of adapters
53-
used at runtime is determined through configuration.
52+
Mixer's flexibility in dealing with different backend systems is achieved by having a general-purpose
53+
plug-in model. Individual plug-ins are known as *adapters* and they allow
54+
Mixer to interface to different backend systems that deliver core functionality, such as logging, monitoring, quotas, ACL
55+
checking, and more. Adapters enable Mixer to expose a single consistent API, independent of the backends in use.
56+
The exact set of adapters used at runtime is determined through configuration and can easily be extended
57+
to target new or custom backend systems.
5458

5559
<img style="width:65%;display:block;margin:auto;" src="./mixer/adapters.svg" alt="Mixer and its adapters." />
5660

57-
## Descriptors and Adapter Parameters
58-
59-
Mixer is essentially an attribute processing machine. It takes in a number of attributes from
60-
its caller and produces as a result a set of calls into its adapters, which in turn trigger calls to
61-
associated backend systems such as Prometheus or NewRelic. As Mixer calls its adapters, it provides them
62-
*adapter parameters* as input. These tell the adapters what to do. For example, when
63-
reporting metrics to an adapter, Mixer produces parameters that hold the metric data.
64-
65-
Descriptors let you define the *shape* of the parameters produced during Mixer's [attribute processing phase](#request-phases).
66-
In other words, descriptors let you control the set and type of values carried by these parameters. Some facts:
67-
68-
- Mixer supports a variety of different descriptor kinds (Metric Descriptor, Log Entry Descriptor, Quota Descriptor, etc)
69-
70-
- For each descriptor kind, you can declare any number of descriptors within a given deployment.
71-
72-
- While handling a request, Mixer's attribute processing phase can produce any number of distinct adapter parameters for each of the
73-
configured descriptors.
74-
75-
An example can help clarify the concepts. Let's consider the `MetricDescriptor` type which is defined as follows:
76-
77-
```proto
78-
message MetricDescriptor {
79-
string name = 1;
80-
string display_name = 2;
81-
string description = 3;
82-
83-
enum MetricKind {
84-
METRIC_KIND_UNSPECIFIED = 0;
85-
GAUGE = 1;
86-
COUNTER = 2;
87-
}
88-
89-
MetricKind kind = 4;
90-
ValueType value = 5;
91-
repeated LabelDescriptor labels = 6;
92-
}
93-
```
94-
95-
Within a deployment configuration, you can declare a metric descriptor using a snippet of YAML:
96-
97-
```yaml
98-
name: request_count
99-
kind: COUNTER
100-
value: INT64
101-
description: request count by source, target, service, and code
102-
labels:
103-
- name: source
104-
valueType: STRING
105-
- name: target
106-
valueType: STRING
107-
- name: service
108-
valueType: STRING
109-
- name: method
110-
valueType: STRING
111-
- name: response_code
112-
valueType: INT64
113-
```
114-
115-
This is declaring a descriptor called `request_count`. Because of the kind and value fields, policy objects associated with this
116-
descriptor represent 64-bit integer counters. Additionally, each associated policy object will be uniquely identified via the 5
117-
listed labels. Producing a policy object for such a descriptor requires 6 pieces of information:
118-
119-
- a 64-bit integer metric value
120-
- a source string
121-
- a target string
122-
- a service string
123-
- a method string
124-
- a 64-bit integer response code
125-
126-
Here is an example snippet of Istio configuration which produces adapter parameters given the above descriptor:
127-
128-
```yaml
129-
descriptor_name: request_count
130-
value: "1"
131-
labels:
132-
source: source.name | "unknown"
133-
target: target.name | "unknown"
134-
service: api.name | "unknown"
135-
method: api.method | "unknown"
136-
response_code: response.code | 200
137-
```
138-
139-
Many such parameters are are typically created as part of attribute processing and they ultimately determine what
140-
adapters do.
141-
142-
Explicitly defining descriptors and creating adapter parameters using them is akin to types and objects in a traditional
143-
programming language. Doing so enables a few important scenarios:
144-
145-
- Having the set of descriptors explicitly defined enables Istio to program backend systems to accept traffic produced
146-
by Mixer. For example, a `MetricDescriptor` provides all the information needed to program a backend system to accept metrics
147-
that conform to the descriptor's shape (it's value type and its set of labels).
148-
149-
- It enables type checking of the deployment's configuration. Since attributes have strong types, and so do descriptors,
150-
Istio can provide a number of strong correctness guarantees of the system's configuration. Basically, if a chunk of
151-
configuration is accepted into the Istio system, it means the configuration passes a minimum correctness bar. Again, this
152-
plays the same role as types in a programming language.
153-
154-
- It enables Istio to provide a strongly-typed scripting environment as discussed [below](#scripting)
155-
15661
## Configuration state
15762

15863
Mixer's core runtime methods (`Check`, `Report`, and `Quota`) all accept a set of attributes on input and
@@ -164,15 +69,15 @@ for:
16469
state that configures an adapter (adapters being binary plugins as described [below](#adapters)).
16570

16671
- Establishing the types of adapter parameters that Mixer can manipulate. These
167-
types are described in configuration through a set of *descriptors* (as described [above](#descriptors))
72+
types are described in configuration through a set of *descriptors* (as described [here](./mixer-config/#descriptors))
16873

16974
- Creating rules to map the attributes of every incoming request into a
17075
specific set of aspects and adapter parameters.
17176

17277
The above configuration state is required to have Mixer know what to do with incoming attributes
17378
and dispatch to the appropriate backend systems.
17479

175-
Refer to *TBD* for detailed information on Mixer's configuration format.
80+
Refer [here](./mixer-config.md) for detailed information on Mixer's configuration model.
17681

17782
## Request phases
17883

0 commit comments

Comments
 (0)