Browse Source

Add instruction about stackdriver adapter config (#16388)

Pengyuan Bian 4 weeks ago
parent
commit
737dcadeb5

+ 28
- 0
mixer/adapter/stackdriver/README.md View File

@@ -0,0 +1,28 @@
1
+# Mixer Stackdriver Adapter
2
+
3
+To enable stackdriver adapter:
4
+
5
+1.  Download istio/installer repo:
6
+    ```
7
+    git clone https://github.com/istio/installer && cd installer`
8
+    ```
9
+2.  Render and apply Stackdriver adapter manifest:
10
+    ```
11
+    helm template istio-telemetry/mixer-telemetry --execute=templates/stackdriver.yaml -f global.yaml --set mixer.adapters.stackdriver.enabled=true --namespace istio-system | kubectl apply -f -
12
+    ```
13
+
14
+The full Stackdriver adapter template could be found [here](https://github.com/istio/installer/blob/master/istio-telemetry/mixer-telemetry/templates/stackdriver.yaml) with several values to set:
15
+```
16
+mixer:
17
+  stackdriver:
18
+    enabled: false
19
+
20
+  auth:
21
+    appCredentials: false
22
+    apiKey: ""
23
+    serviceAccountPath: ""
24
+
25
+  tracer:
26
+    enabled: false
27
+    sampleProbability: 1
28
+```

+ 0
- 799
mixer/adapter/stackdriver/operatorconfig/stackdriver.yaml View File

@@ -1,799 +0,0 @@
1
-apiVersion: "config.istio.io/v1alpha2"
2
-kind: stackdriver
3
-metadata:
4
-  name: handler
5
-  namespace: istio-system
6
-spec:
7
-  # We'll use the default value from the adapter, once per minute, so we don't need to supply a value.
8
-  # pushInterval: 1m
9
-  # Must be supplied for the stackdriver adapter to work
10
-  project_id: <your project ID>
11
-  # One of the following must be set; the preferred method is `appCredentials`, which corresponds to
12
-  # Google Application Default Credentials. See:
13
-  #    https://developers.google.com/identity/protocols/application-default-credentials
14
-  # If none is provided we default to app credentials.
15
-  # appCredentials:
16
-  # apiKey:
17
-  # serviceAccountPath:
18
-
19
-  # Describes how to map Istio metrics into Stackdriver.
20
-  # Note: most of this config is copied over from prometheus.yaml to keep our metrics consistent across backends
21
-  metricInfo:
22
-    server-request-count.metric.istio-system:
23
-      # Due to a bug in gogoproto deserialization, Enums in maps must be
24
-      # specified by their integer value, not variant name. See
25
-      # https://github.com/googleapis/googleapis/blob/master/google/api/metric.proto
26
-      # MetricKind and ValueType for the values to provide.
27
-      kind: 3 # CUMULATIVE
28
-      value: 2 # INT64
29
-      metric_type: "istio.io/service/server/request_count"
30
-    server-request-bytes.metric.istio-system:
31
-      kind: 3 # CUMULATIVE
32
-      value: 5 # DISTRIBUTION
33
-      buckets:
34
-        exponentialBuckets:
35
-          numFiniteBuckets: 20
36
-          scale: 1
37
-          growthFactor: 2
38
-      metric_type: "istio.io/service/server/request_bytes"
39
-    server-response-bytes.metric.istio-system:
40
-      kind: 3 # CUMULATIVE
41
-      value: 5 # DISTRIBUTION
42
-      buckets:
43
-        exponentialBuckets:
44
-          numFiniteBuckets: 20
45
-          scale: 1
46
-          growthFactor: 2
47
-      metric_type: "istio.io/service/server/response_bytes"
48
-    server-response-latencies.metric.istio-system:
49
-      kind: 3 # CUMULATIVE
50
-      value: 5 # DISTRIBUTION
51
-      buckets:
52
-        exponentialBuckets:
53
-          numFiniteBuckets: 20
54
-          scale: 1
55
-          growthFactor: 2
56
-      metric_type: "istio.io/service/server/response_latencies"
57
-    server-received-bytes-count.metric.istio-system:
58
-      kind: 3 # CUMULATIVE
59
-      value: 2 # INT64
60
-      metric_type: "istio.io/service/server/received_bytes_count"
61
-    server-sent-bytes-count.metric.istio-system:
62
-      kind: 3 # CUMULATIVE
63
-      value: 2 # INT64
64
-      metric_type: "istio.io/service/server/sent_bytes_count"
65
-    client-request-count.metric.istio-system:
66
-      kind: 3 # CUMULATIVE
67
-      value: 2 # INT64
68
-      metric_type: "istio.io/service/client/request_count"
69
-    client-request-bytes.metric.istio-system:
70
-      kind: 3 # CUMULATIVE
71
-      value: 5 # DISTRIBUTION
72
-      buckets:
73
-        exponentialBuckets:
74
-          numFiniteBuckets: 20
75
-          scale: 1
76
-          growthFactor: 2
77
-      metric_type: "istio.io/service/client/request_bytes"
78
-    client-response-bytes.metric.istio-system:
79
-      kind: 3 # CUMULATIVE
80
-      value: 5 # DISTRIBUTION
81
-      buckets:
82
-        exponentialBuckets:
83
-          numFiniteBuckets: 20
84
-          scale: 1
85
-          growthFactor: 2
86
-      metric_type: "istio.io/service/client/response_bytes"
87
-    client-roundtrip-latencies.metric.istio-system:
88
-      kind: 3 # CUMULATIVE
89
-      value: 5 # DISTRIBUTION
90
-      buckets:
91
-        exponentialBuckets:
92
-          numFiniteBuckets: 20
93
-          scale: 1
94
-          growthFactor: 2
95
-      metric_type: "istio.io/service/client/roundtrip_latencies"
96
-    client-received-bytes-count.metric.istio-system:
97
-      kind: 3 # CUMULATIVE
98
-      value: 2 # INT64
99
-      metric_type: "istio.io/service/client/received_bytes_count"
100
-    client-sent-bytes-count.metric.istio-system:
101
-      kind: 3 # CUMULATIVE
102
-      value: 2 # INT64
103
-      metric_type: "istio.io/service/client/sent_bytes_count"
104
-
105
-  # Describes how to map Istio logs into Stackdriver.
106
-  logInfo:
107
-    server-accesslog-stackdriver.logentry.istio-system:
108
-      labelNames:
109
-      - source_uid
110
-      - source_ip
111
-      - source_app
112
-      - source_principal
113
-      - source_name
114
-      - source_workload
115
-      - source_namespace
116
-      - source_owner
117
-      - destination_uid
118
-      - destination_app
119
-      - destination_ip
120
-      - destination_service_host
121
-      - destination_workload
122
-      - destination_name
123
-      - destination_namespace
124
-      - destination_owner
125
-      - destination_principal
126
-      - api_name
127
-      - api_version
128
-      - api_claims
129
-      - api_key
130
-      - request_operation
131
-      - protocol
132
-      - method
133
-      - url
134
-      - response_code
135
-      - response_size
136
-      - request_size
137
-      - request_id
138
-      - latency
139
-      - service_authentication_policy
140
-      - user_agent
141
-      - response_timestamp
142
-      - received_bytes
143
-      - sent_bytes
144
-      - referer
145
-    server-tcp-accesslog-stackdriver.logentry.istio-system:
146
-      labelNames:
147
-      - connection_id
148
-      - connection_event
149
-      - source_uid
150
-      - source_ip
151
-      - source_app
152
-      - source_principal
153
-      - source_name
154
-      - source_workload
155
-      - source_namespace
156
-      - source_owner
157
-      - destination_uid
158
-      - destination_app
159
-      - destination_ip
160
-      - destination_service_host
161
-      - destination_workload
162
-      - destination_name
163
-      - destination_namespace
164
-      - destination_owner
165
-      - destination_principal
166
-      - protocol
167
-      - connction_duration
168
-      - service_authentication_policy
169
-      - received_bytes
170
-      - sent_bytes
171
-      - total_received_bytes
172
-      - total_sent_bytes
173
-      # sinkInfo is a optional field which contains information about sink to export Stackdriver logs to. 
174
-      sinkInfo:
175
-        id: '<sink_id>'
176
-        destination: '<sink_destination>'
177
-        filter: '<log_filter>'
178
-  trace:
179
-    sampleProbability: 1
180
----
181
-#################################################
182
-############## Metric Config ####################
183
-#################################################
184
-apiVersion: "config.istio.io/v1alpha2"
185
-kind: rule
186
-metadata:
187
-  name: stackdriver-server
188
-  namespace: istio-system
189
-spec:
190
-  match: (context.protocol == "http" || context.protocol == "grpc") && (context.reporter.kind | "inbound" == "inbound")
191
-  actions:
192
-  - handler: handler.stackdriver
193
-    instances:
194
-    - server-request-count.metric
195
-    - server-request-bytes.metric
196
-    - server-response-bytes.metric
197
-    - server-response-latencies.metric
198
----
199
-apiVersion: "config.istio.io/v1alpha2"
200
-kind: rule
201
-metadata:
202
-  name: stackdriver-client
203
-  namespace: istio-system
204
-spec:
205
-  match: (context.protocol == "http" || context.protocol == "grpc") && (context.reporter.kind | "inbound" == "outbound")
206
-  actions:
207
-  - handler: handler.stackdriver
208
-    instances:
209
-    - client-request-count.metric
210
-    - client-request-bytes.metric
211
-    - client-response-bytes.metric
212
-    - client-roundtrip-latencies.metric
213
----
214
-apiVersion: "config.istio.io/v1alpha2"
215
-kind: rule
216
-metadata:
217
-  name: stackdriver-tcp-server
218
-  namespace: istio-system
219
-spec:
220
-  match: context.protocol == "tcp" && (context.reporter.kind | "inbound" == "inbound")
221
-  actions:
222
-  - handler: handler.stackdriver
223
-    instances:
224
-    - server-received-bytes-count.metric
225
-    - server-sent-bytes-count.metric
226
----
227
-apiVersion: "config.istio.io/v1alpha2"
228
-kind: rule
229
-metadata:
230
-  name: stackdriver-tcp-client
231
-  namespace: istio-system
232
-spec:
233
-  match: context.protocol == "tcp" && (context.reporter.kind | "inbound" == "outbound")
234
-  actions:
235
-  - handler: handler.stackdriver
236
-    instances:
237
-    - client-received-bytes-count.metric
238
-    - client-sent-bytes-count.metric
239
----
240
-apiVersion: "config.istio.io/v1alpha2"
241
-kind: metric
242
-metadata:
243
-  name: server-request-count
244
-  namespace: istio-system
245
-spec:
246
-  value: "1"
247
-  dimensions:
248
-    destination_service_name: destination.service.name | "unknown"
249
-    destination_service_namespace: destination.service.namespace | "unknown"
250
-    destination_port: destination.port | 0
251
-    request_operation: conditional((context.protocol | "unknown") == "grpc", request.path | "unknown", request.method | "unknown")
252
-    request_protocol: context.protocol | "unknown"
253
-    api_version: api.version | "unknown"
254
-    api_name: api.service | "unknown"
255
-    response_code: response.code | 0
256
-    service_authentication_policy: conditional((context.reporter.kind | "inbound") == "outbound", "unknown", conditional(connection.mtls | false, "mutual_tls", "none"))
257
-    source_workload_namespace: source.workload.namespace | "unknown"
258
-    source_workload_name: source.workload.name | "unknown"
259
-    source_owner: source.owner | "unknown"
260
-    destination_workload_namespace: destination.workload.namespace | "unknown"
261
-    destination_workload_name: destination.workload.name | "unknown"
262
-    destination_owner: destination.owner | "unknown"
263
-    destination_principal: destination.principal | "unknown"
264
-    source_principal: source.principal | "unknown"
265
-  monitoredResourceType: '"k8s_container"'
266
-  monitoredResourceDimensions:
267
-    project_id: '""'
268
-    cluster_name: '""'
269
-    namespace_name: destination.workload.namespace | "unknown"
270
-    location: '""'
271
-    container_name: conditional((destination.name | "unknown").startsWith("istio-telemetry") || (destination.name | "unknown").startsWith("istio-policy"), "mixer", destination.container.name | "unknown")
272
-    pod_name: destination.name | "unknown"
273
----
274
-apiVersion: "config.istio.io/v1alpha2"
275
-kind: metric
276
-metadata:
277
-  name: client-request-count
278
-  namespace: istio-system
279
-spec:
280
-  value: "1"
281
-  dimensions:
282
-    destination_service_name: destination.service.name | "unknown"
283
-    destination_service_namespace: destination.service.namespace | "unknown"
284
-    destination_port: destination.port | 0
285
-    request_operation: conditional((context.protocol | "unknown") == "grpc", request.path | "unknown", request.method | "unknown")
286
-    request_protocol: context.protocol | "unknown"
287
-    api_version: api.version | "unknown"
288
-    api_name: api.service | "unknown"
289
-    response_code: response.code | 0
290
-    service_authentication_policy: conditional((context.reporter.kind | "inbound") == "outbound", "unknown", conditional(connection.mtls | false, "mutual_tls", "none"))
291
-    source_workload_namespace: source.workload.namespace | "unknown"
292
-    source_workload_name: source.workload.name | "unknown"
293
-    source_owner: source.owner | "unknown"
294
-    destination_workload_namespace: destination.workload.namespace | "unknown"
295
-    destination_workload_name: destination.workload.name | "unknown"
296
-    destination_owner: destination.owner | "unknown"
297
-    destination_principal: destination.principal | "unknown"
298
-    source_principal: source.principal | "unknown"
299
-  monitoredResourceType: '"k8s_pod"'
300
-  monitoredResourceDimensions:
301
-    project_id: '""'
302
-    cluster_name: '""'
303
-    namespace_name: source.workload.namespace | "unknown"
304
-    location: '""'
305
-    pod_name: source.name | "unknown"
306
----
307
-apiVersion: "config.istio.io/v1alpha2"
308
-kind: metric
309
-metadata:
310
-  name: server-request-bytes
311
-  namespace: istio-system
312
-spec:
313
-  value: request.total_size
314
-  dimensions:
315
-    destination_service_name: destination.service.name | "unknown"
316
-    destination_service_namespace: destination.service.namespace | "unknown"
317
-    destination_port: destination.port | 0
318
-    request_operation: conditional((context.protocol | "unknown") == "grpc", request.path | "unknown", request.method | "unknown")
319
-    request_protocol: context.protocol | "unknown"
320
-    api_version: api.version | "unknown"
321
-    api_name: api.service | "unknown"
322
-    response_code: response.code | 0
323
-    service_authentication_policy: conditional((context.reporter.kind | "inbound") == "outbound", "unknown", conditional(connection.mtls | false, "mutual_tls", "none"))
324
-    source_workload_namespace: source.workload.namespace | "unknown"
325
-    source_workload_name: source.workload.name | "unknown"
326
-    source_owner: source.owner | "unknown"
327
-    destination_workload_namespace: destination.workload.namespace | "unknown"
328
-    destination_workload_name: destination.workload.name | "unknown"
329
-    destination_owner: destination.owner | "unknown"
330
-    destination_principal: destination.principal | "unknown"
331
-    source_principal: source.principal | "unknown"
332
-  monitoredResourceType: '"k8s_container"'
333
-  monitoredResourceDimensions:
334
-    project_id: '""'
335
-    cluster_name: '""'
336
-    namespace_name: destination.workload.namespace | "unknown"
337
-    location: '""'
338
-    container_name: conditional((destination.name | "unknown").startsWith("istio-telemetry") || (destination.name | "unknown").startsWith("istio-policy"), "mixer", destination.container.name | "unknown")
339
-    pod_name: destination.name | "unknown"
340
----
341
-apiVersion: "config.istio.io/v1alpha2"
342
-kind: metric
343
-metadata:
344
-  name: client-request-bytes
345
-  namespace: istio-system
346
-spec:
347
-  value: request.total_size
348
-  dimensions:
349
-    destination_service_name: destination.service.name | "unknown"
350
-    destination_service_namespace: destination.service.namespace | "unknown"
351
-    destination_port: destination.port | 0
352
-    request_operation: conditional((context.protocol | "unknown") == "grpc", request.path | "unknown", request.method | "unknown")
353
-    request_protocol: context.protocol | "unknown"
354
-    api_version: api.version | "unknown"
355
-    api_name: api.service | "unknown"
356
-    response_code: response.code | 0
357
-    service_authentication_policy: conditional((context.reporter.kind | "inbound") == "outbound", "unknown", conditional(connection.mtls | false, "mutual_tls", "none"))
358
-    source_workload_namespace: source.workload.namespace | "unknown"
359
-    source_workload_name: source.workload.name | "unknown"
360
-    source_owner: source.owner | "unknown"
361
-    destination_workload_namespace: destination.workload.namespace | "unknown"
362
-    destination_workload_name: destination.workload.name | "unknown"
363
-    destination_owner: destination.owner | "unknown"
364
-    destination_principal: destination.principal | "unknown"
365
-    source_principal: source.principal | "unknown"
366
-  monitoredResourceType: '"k8s_pod"'
367
-  monitoredResourceDimensions:
368
-    project_id: '""'
369
-    cluster_name: '""'
370
-    namespace_name: source.workload.namespace | "unknown"
371
-    location: '""'
372
-    pod_name: source.name | "unknown"
373
----
374
-apiVersion: "config.istio.io/v1alpha2"
375
-kind: metric
376
-metadata:
377
-  name: server-response-bytes
378
-  namespace: istio-system
379
-spec:
380
-  value: response.total_size
381
-  dimensions:
382
-    destination_service_name: destination.service.name | "unknown"
383
-    destination_service_namespace: destination.service.namespace | "unknown"
384
-    destination_port: destination.port | 0
385
-    request_operation: conditional((context.protocol | "unknown") == "grpc", request.path | "unknown", request.method | "unknown")
386
-    request_protocol: context.protocol | "unknown"
387
-    api_version: api.version | "unknown"
388
-    api_name: api.service | "unknown"
389
-    response_code: response.code | 0
390
-    service_authentication_policy: conditional((context.reporter.kind | "inbound") == "outbound", "unknown", conditional(connection.mtls | false, "mutual_tls", "none"))
391
-    source_workload_namespace: source.workload.namespace | "unknown"
392
-    source_workload_name: source.workload.name | "unknown"
393
-    source_owner: source.owner | "unknown"
394
-    destination_workload_namespace: destination.workload.namespace | "unknown"
395
-    destination_workload_name: destination.workload.name | "unknown"
396
-    destination_owner: destination.owner | "unknown"
397
-    destination_principal: destination.principal | "unknown"
398
-    source_principal: source.principal | "unknown"
399
-  monitoredResourceType: '"k8s_container"'
400
-  monitoredResourceDimensions:
401
-    project_id: '""'
402
-    cluster_name: '""'
403
-    namespace_name: destination.workload.namespace | "unknown"
404
-    location: '""'
405
-    container_name: conditional((destination.name | "unknown").startsWith("istio-telemetry") || (destination.name | "unknown").startsWith("istio-policy"), "mixer", destination.container.name | "unknown")
406
-    pod_name: destination.name | "unknown"
407
----
408
-apiVersion: "config.istio.io/v1alpha2"
409
-kind: metric
410
-metadata:
411
-  name: client-response-bytes
412
-  namespace: istio-system
413
-spec:
414
-  value: response.total_size
415
-  dimensions:
416
-    destination_service_name: destination.service.name | "unknown"
417
-    destination_service_namespace: destination.service.namespace | "unknown"
418
-    destination_port: destination.port | 0
419
-    request_operation: conditional((context.protocol | "unknown") == "grpc", request.path | "unknown", request.method | "unknown")
420
-    request_protocol: context.protocol | "unknown"
421
-    api_version: api.version | "unknown"
422
-    api_name: api.service | "unknown"
423
-    response_code: response.code | 0
424
-    service_authentication_policy: conditional((context.reporter.kind | "inbound") == "outbound", "unknown", conditional(connection.mtls | false, "mutual_tls", "none"))
425
-    source_workload_namespace: source.workload.namespace | "unknown"
426
-    source_workload_name: source.workload.name | "unknown"
427
-    source_owner: source.owner | "unknown"
428
-    destination_workload_namespace: destination.workload.namespace | "unknown"
429
-    destination_workload_name: destination.workload.name | "unknown"
430
-    destination_owner: destination.owner | "unknown"
431
-    destination_principal: destination.principal | "unknown"
432
-    source_principal: source.principal | "unknown"
433
-  monitoredResourceType: '"k8s_pod"'
434
-  monitoredResourceDimensions:
435
-    project_id: '""'
436
-    cluster_name: '""'
437
-    namespace_name: source.workload.namespace | "unknown"
438
-    location: '""'
439
-    pod_name: source.name | "unknown"
440
----
441
-apiVersion: "config.istio.io/v1alpha2"
442
-kind: metric
443
-metadata:
444
-  name: server-response-latencies
445
-  namespace: istio-system
446
-spec:
447
-  value: response.duration
448
-  dimensions:
449
-    destination_service_name: destination.service.name | "unknown"
450
-    destination_service_namespace: destination.service.namespace | "unknown"
451
-    destination_port: destination.port | 0
452
-    request_operation: conditional((context.protocol | "unknown") == "grpc", request.path | "unknown", request.method | "unknown")
453
-    request_protocol: context.protocol | "unknown"
454
-    api_version: api.version | "unknown"
455
-    api_name: api.service | "unknown"
456
-    response_code: response.code | 0
457
-    service_authentication_policy: conditional((context.reporter.kind | "inbound") == "outbound", "unknown", conditional(connection.mtls | false, "mutual_tls", "none"))
458
-    source_workload_namespace: source.workload.namespace | "unknown"
459
-    source_workload_name: source.workload.name | "unknown"
460
-    source_owner: source.owner | "unknown"
461
-    destination_workload_namespace: destination.workload.namespace | "unknown"
462
-    destination_workload_name: destination.workload.name | "unknown"
463
-    destination_owner: destination.owner | "unknown"
464
-    destination_principal: destination.principal | "unknown"
465
-    source_principal: source.principal | "unknown"
466
-  monitoredResourceType: '"k8s_container"'
467
-  monitoredResourceDimensions:
468
-    project_id: '""'
469
-    cluster_name: '""'
470
-    namespace_name: destination.workload.namespace | "unknown"
471
-    location: '""'
472
-    container_name: conditional((destination.name | "unknown").startsWith("istio-telemetry") || (destination.name | "unknown").startsWith("istio-policy"), "mixer", destination.container.name | "unknown")
473
-    pod_name: destination.name | "unknown"
474
----
475
-apiVersion: "config.istio.io/v1alpha2"
476
-kind: metric
477
-metadata:
478
-  name: client-roundtrip-latencies
479
-  namespace: istio-system
480
-spec:
481
-  value: response.duration
482
-  dimensions:
483
-    destination_service_name: destination.service.name | "unknown"
484
-    destination_service_namespace: destination.service.namespace | "unknown"
485
-    destination_port: destination.port | 0
486
-    request_operation: conditional((context.protocol | "unknown") == "grpc", request.path | "unknown", request.method | "unknown")
487
-    request_protocol: context.protocol | "unknown"
488
-    api_version: api.version | "unknown"
489
-    api_name: api.service | "unknown"
490
-    response_code: response.code | 0
491
-    service_authentication_policy: conditional((context.reporter.kind | "inbound") == "outbound", "unknown", conditional(connection.mtls | false, "mutual_tls", "none"))
492
-    source_workload_namespace: source.workload.namespace | "unknown"
493
-    source_workload_name: source.workload.name | "unknown"
494
-    source_owner: source.owner | "unknown"
495
-    destination_workload_namespace: destination.workload.namespace | "unknown"
496
-    destination_workload_name: destination.workload.name | "unknown"
497
-    destination_owner: destination.owner | "unknown"
498
-    destination_principal: destination.principal | "unknown"
499
-    source_principal: source.principal | "unknown"
500
-  monitoredResourceType: '"k8s_pod"'
501
-  monitoredResourceDimensions:
502
-    project_id: '""'
503
-    cluster_name: '""'
504
-    namespace_name: source.workload.namespace | "unknown"
505
-    location: '""'
506
-    pod_name: source.name | "unknown"
507
----
508
-apiVersion: "config.istio.io/v1alpha2"
509
-kind: metric
510
-metadata:
511
-  name: server-received-bytes-count
512
-  namespace: istio-system
513
-spec:
514
-  value: connection.received.bytes | 0
515
-  dimensions:
516
-    destination_service_name: destination.service.name | "unknown"
517
-    destination_service_namespace: destination.service.namespace | "unknown"
518
-    destination_port: destination.port | 0
519
-    request_protocol: context.protocol | "unknown"
520
-    service_authentication_policy: conditional((context.reporter.kind | "inbound") == "outbound", "unknown", conditional(connection.mtls | false, "mutual_tls", "none"))
521
-    source_workload_namespace: source.workload.namespace | "unknown"
522
-    source_workload_name: source.workload.name | "unknown"
523
-    source_owner: source.owner | "unknown"
524
-    destination_workload_namespace: destination.workload.namespace | "unknown"
525
-    destination_workload_name: destination.workload.name | "unknown"
526
-    destination_owner: destination.owner | "unknown"
527
-    destination_principal: destination.principal | "unknown"
528
-    source_principal: source.principal | "unknown"
529
-  monitoredResourceType: '"k8s_container"'
530
-  monitoredResourceDimensions:
531
-    project_id: '""'
532
-    cluster_name: '""'
533
-    namespace_name: destination.workload.namespace | "unknown"
534
-    location: '""'
535
-    container_name: conditional((destination.name | "unknown").startsWith("istio-telemetry") || (destination.name | "unknown").startsWith("istio-policy"), "mixer", destination.container.name | "unknown")
536
-    pod_name: destination.name | "unknown"
537
----
538
-apiVersion: "config.istio.io/v1alpha2"
539
-kind: metric
540
-metadata:
541
-  name: client-received-bytes-count
542
-  namespace: istio-system
543
-spec:
544
-  value: connection.received.bytes | 0
545
-  dimensions:
546
-    destination_service_name: destination.service.name | "unknown"
547
-    destination_service_namespace: destination.service.namespace | "unknown"
548
-    destination_port: destination.port | 0
549
-    request_protocol: context.protocol | "unknown"
550
-    service_authentication_policy: conditional((context.reporter.kind | "inbound") == "outbound", "unknown", conditional(connection.mtls | false, "mutual_tls", "none"))
551
-    source_workload_namespace: source.workload.namespace | "unknown"
552
-    source_workload_name: source.workload.name | "unknown"
553
-    source_owner: source.owner | "unknown"
554
-    destination_workload_namespace: destination.workload.namespace | "unknown"
555
-    destination_workload_name: destination.workload.name | "unknown"
556
-    destination_owner: destination.owner | "unknown"
557
-    destination_principal: destination.principal | "unknown"
558
-    source_principal: source.principal | "unknown"
559
-  monitoredResourceType: '"k8s_pod"'
560
-  monitoredResourceDimensions:
561
-    project_id: '""'
562
-    cluster_name: '""'
563
-    namespace_name: source.workload.namespace | "unknown"
564
-    location: '""'
565
-    pod_name: source.name | "unknown"
566
----
567
-apiVersion: "config.istio.io/v1alpha2"
568
-kind: metric
569
-metadata:
570
-  name: server-sent-bytes-count
571
-  namespace: istio-system
572
-spec:
573
-  value: connection.sent.bytes | 0
574
-  dimensions:
575
-    destination_service_name: destination.service.name | "unknown"
576
-    destination_service_namespace: destination.service.namespace | "unknown"
577
-    destination_port: destination.port | 0
578
-    request_protocol: context.protocol | "unknown"
579
-    service_authentication_policy: conditional((context.reporter.kind | "inbound") == "outbound", "unknown", conditional(connection.mtls | false, "mutual_tls", "none"))
580
-    source_workload_namespace: source.workload.namespace | "unknown"
581
-    source_workload_name: source.workload.name | "unknown"
582
-    source_owner: source.owner | "unknown"
583
-    destination_workload_namespace: destination.workload.namespace | "unknown"
584
-    destination_workload_name: destination.workload.name | "unknown"
585
-    destination_owner: destination.owner | "unknown"
586
-    destination_principal: destination.principal | "unknown"
587
-    source_principal: source.principal | "unknown"
588
-  monitoredResourceType: '"k8s_container"'
589
-  monitoredResourceDimensions:
590
-    project_id: '""'
591
-    cluster_name: '""'
592
-    namespace_name: destination.workload.namespace | "unknown"
593
-    location: '""'
594
-    container_name: conditional((destination.name | "unknown").startsWith("istio-telemetry") || (destination.name | "unknown").startsWith("istio-policy"), "mixer", destination.container.name | "unknown")
595
-    pod_name: destination.name | "unknown"
596
----
597
-apiVersion: "config.istio.io/v1alpha2"
598
-kind: metric
599
-metadata:
600
-  name: client-sent-bytes-count
601
-  namespace: istio-system
602
-spec:
603
-  value: connection.sent.bytes | 0
604
-  dimensions:
605
-    destination_service_name: destination.service.name | "unknown"
606
-    destination_service_namespace: destination.service.namespace | "unknown"
607
-    destination_port: destination.port | 0
608
-    request_protocol: context.protocol | "unknown"
609
-    service_authentication_policy: conditional((context.reporter.kind | "inbound") == "outbound", "unknown", conditional(connection.mtls | false, "mutual_tls", "none"))
610
-    source_workload_namespace: source.workload.namespace | "unknown"
611
-    source_workload_name: source.workload.name | "unknown"
612
-    source_owner: source.owner | "unknown"
613
-    destination_workload_namespace: destination.workload.namespace | "unknown"
614
-    destination_workload_name: destination.workload.name | "unknown"
615
-    destination_owner: destination.owner | "unknown"
616
-    destination_principal: destination.principal | "unknown"
617
-    source_principal: source.principal | "unknown"
618
-  monitoredResourceType: '"k8s_pod"'
619
-  monitoredResourceDimensions:
620
-    project_id: '""'
621
-    cluster_name: '""'
622
-    namespace_name: source.workload.namespace | "unknown"
623
-    location: '""'
624
-    pod_name: source.name | "unknown"
625
----
626
-#################################################
627
-############## Logging Config ###################
628
-#################################################
629
-apiVersion: "config.istio.io/v1alpha2"
630
-kind: logentry
631
-metadata:
632
-  name: server-accesslog-stackdriver
633
-  namespace: istio-system
634
-spec:
635
-  severity: '"Info"'
636
-  timestamp: request.time
637
-  variables:
638
-    source_uid: source.uid | ""
639
-    source_ip: source.ip | ip("0.0.0.0")
640
-    source_app: source.labels["app"] | ""
641
-    source_principal: source.principal | ""
642
-    source_name: source.name | ""
643
-    source_workload: source.workload.name | ""
644
-    source_namespace: source.namespace | ""
645
-    source_owner: source.owner | ""
646
-    destination_uid: destination.uid | ""
647
-    destination_app: destination.labels["app"] | ""
648
-    destination_ip: destination.ip | ip("0.0.0.0")
649
-    destination_service_host: destination.service.host | ""
650
-    destination_workload: destination.workload.name | ""
651
-    destination_name: destination.name | ""
652
-    destination_namespace: destination.namespace | ""
653
-    destination_owner: destination.owner | ""
654
-    destination_principal: destination.principal | ""
655
-    api_name: api.service | ""
656
-    api_version: api.version | ""
657
-    api_claims: request.auth.raw_claims | ""
658
-    api_key: request.api_key | request.headers["x-api-key"] | ""
659
-    request_operation: conditional((context.protocol | "unknown") == "grpc", request.path | "unknown", request.method | "unknown")
660
-    protocol: request.scheme | context.protocol | "http"
661
-    method: request.method | ""
662
-    url: request.path | ""
663
-    response_code: response.code | 0
664
-    response_size: response.size | 0
665
-    request_size: request.size | 0
666
-    request_id: request.headers["x-request-id"] | ""
667
-    latency: response.duration | "0ms"
668
-    service_authentication_policy: conditional((context.reporter.kind | "inbound") == "outbound", "unknown", conditional(connection.mtls | false, "mutual_tls", "none"))
669
-    user_agent: request.useragent | ""
670
-    response_timestamp: response.time
671
-    received_bytes: request.total_size | 0
672
-    sent_bytes: response.total_size | 0
673
-    referer: request.referer | ""
674
-  monitored_resource_type: '"k8s_container"'
675
-  monitoredResourceDimensions:
676
-    project_id: '""'
677
-    cluster_name: '""'
678
-    namespace_name: destination.namespace | "unknown"
679
-    location: '""'
680
-    container_name: conditional((destination.name | "unknown").startsWith("istio-telemetry") || (destination.name | "unknown").startsWith("istio-policy"), "mixer", destination.container.name | "unknown")
681
-    pod_name: destination.name | "unknown"
682
----
683
-apiVersion: "config.istio.io/v1alpha2"
684
-kind: logentry
685
-metadata:
686
-  name: server-tcp-accesslog-stackdriver
687
-  namespace: istio-system
688
-spec:
689
-  severity: '"Info"'
690
-  timestamp: context.time | timestamp("2017-01-01T00:00:00Z")
691
-  variables:
692
-    source_uid: source.uid | ""
693
-    connection_id: connection.id | ""
694
-    connection_event: connection.event | ""
695
-    source_ip: source.ip | ip("0.0.0.0")
696
-    source_app: source.labels["app"] | ""
697
-    source_principal: source.principal | ""
698
-    source_name: source.name | ""
699
-    source_workload: source.workload.name | ""
700
-    source_namespace: source.namespace | ""
701
-    source_owner: source.owner | ""
702
-    destination_uid: destination.uid | ""
703
-    destination_app: destination.labels["app"] | ""
704
-    destination_ip: destination.ip | ip("0.0.0.0")
705
-    destination_service_host: destination.service.host | ""
706
-    destination_workload: destination.workload.name | ""
707
-    destination_name: destination.name | ""
708
-    destination_namespace: destination.namespace | ""
709
-    destination_owner: destination.owner | ""
710
-    destination_principal: destination.principal | ""
711
-    protocol: context.protocol | "tcp"
712
-    connction_duration: connection.duration | "0ms"
713
-    service_authentication_policy: conditional((context.reporter.kind | "inbound") == "outbound", "unknown", conditional(connection.mtls | false, "mutual_tls", "none"))
714
-    received_bytes: connection.received.bytes | 0
715
-    sent_bytes: connection.sent.bytes | 0
716
-    total_received_bytes: connection.received.bytes_total | 0
717
-    total_sent_bytes: connection.sent.bytes_total | 0
718
-  monitored_resource_type: '"k8s_container"'
719
-  monitoredResourceDimensions:
720
-    project_id: '""'
721
-    cluster_name: '""'
722
-    namespace_name: destination.namespace | "unknown"
723
-    location: '""'
724
-    container_name: conditional((destination.name | "unknown").startsWith("istio-telemetry") || (destination.name | "unknown").startsWith("istio-policy"), "mixer", destination.container.name | "unknown")
725
-    pod_name: destination.name | "unknown"
726
----
727
-apiVersion: "config.istio.io/v1alpha2"
728
-kind: rule
729
-metadata:
730
-  name: stackdriver-log
731
-  namespace: istio-system
732
-spec:
733
-  match: (context.protocol == "http" || context.protocol == "grpc") && (context.reporter.kind | "inbound" == "inbound")
734
-  actions:
735
-  - handler: handler.stackdriver
736
-    instances:
737
-    - server-accesslog-stackdriver.logentry
738
----
739
-apiVersion: "config.istio.io/v1alpha2"
740
-kind: rule
741
-metadata:
742
-  name: stackdriver-log-tcp
743
-  namespace: istio-system
744
-spec:
745
-  match: (context.protocol == "tcp") && (context.reporter.kind | "inbound" == "inbound")
746
-  actions:
747
-  - handler: handler.stackdriver
748
-    instances:
749
-    - server-tcp-accesslog-stackdriver.logentry
750
----
751
-#################################################
752
-############## Tracing Config ###################
753
-#################################################
754
-apiVersion: "config.istio.io/v1alpha2"
755
-kind: tracespan
756
-metadata:
757
-  name: stackdriver-span
758
-  namespace: istio-system
759
-spec:
760
-  traceId: request.headers["x-b3-traceid"]
761
-  spanId: request.headers["x-b3-spanid"] | ""
762
-  parentSpanId: request.headers["x-b3-parentspanid"] | ""
763
-  spanName: destination.service.host | destination.service.name | destination.workload.name | "unknown"
764
-  startTime: request.time
765
-  endTime: response.time
766
-  clientSpan: (context.reporter.kind | "inbound") == "outbound"
767
-  rewriteClientSpanId: "true"
768
-  spanTags:
769
-    destination_service_name: destination.service.name | "unknown"
770
-    destination_service_namespace: destination.service.namespace | "unknown"
771
-    destination_port: destination.port | 0
772
-    request_operation: conditional((context.protocol | "unknown") == "grpc", request.path | "unknown", request.method | "unknown")
773
-    request_protocol: context.protocol | "unknown"
774
-    api_version: api.version | "unknown"
775
-    api_name: api.service | "unknown"
776
-    response_code: response.code | 0
777
-    service_authentication_policy: conditional((context.reporter.kind | "inbound") == "outbound", "unknown", conditional(connection.mtls | false, "mutual_tls", "none"))
778
-    source_workload_namespace: source.workload.namespace | "unknown"
779
-    source_workload_name: source.workload.name | "unknown"
780
-    source_owner: source.owner | "unknown"
781
-    destination_workload_namespace: destination.workload.namespace | "unknown"
782
-    destination_workload_name: destination.workload.name | "unknown"
783
-    destination_owner: destination.owner | "unknown"
784
-    http_url: request.path | ""
785
-    request_size: request.size | 0
786
-    response_size: response.size | 0
787
-    source_ip: source.ip | ip("0.0.0.0")
788
----
789
-apiVersion: "config.istio.io/v1alpha2"
790
-kind: rule
791
-metadata:
792
-  name: stackdriver-tracing-rule
793
-  namespace: istio-system
794
-spec:
795
-  match: (context.protocol == "http" || context.protocol == "grpc") && request.headers["x-b3-sampled"] == "1" && destination.workload.name != "istio-telemetry" && destination.workload.name != "istio-pilot"
796
-  actions:
797
-  - handler: handler.stackdriver
798
-    instances:
799
-    - stackdriver-span.tracespan

Loading…
Cancel
Save