-
Notifications
You must be signed in to change notification settings - Fork 3
/
example.aks-multi.yaml
69 lines (68 loc) · 2.14 KB
/
example.aks-multi.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
#################################
# This example sends the query to multiple LogAnalytics workspaces and fetches AKS log information (multi mode):
#
# azure_metrics_loganalytics_ingestion_aks_rows: number of log lines per namespace and cluster in 1 hour
# azure_metrics_loganalytics_ingestion_aks_bytes: log bytes per namespace and cluster in 1 hour
#
#################################
queries:
#########################################################
## rows metric for tables (per second)
- metric: azure_metrics_loganalytics_ingestion_aks_rows
queryMode: multi
query: |-
ContainerLog
| join kind = inner (KubePodInventory
| project ContainerID, PodName=Name, ControllerKind, ControllerName, Namespace
| distinct *
) on ContainerID
| project Namespace, _ResourceId
| summarize count_ = count() by Namespace,_ResourceId
| project _ResourceId, Namespace, count_ = (todouble(count_) / 3600)
timespan: PT1H
fields:
-
name: _ResourceId
target: cluster
type: id
filters: [toLower]
-
name: Namespace
target: sourceNamespace
type: id
filters: [toLower]
-
name: count_
type: value
defaultField:
type: ignore
#########################################################
## bytes metric for tables (per second)
- metric: azure_metrics_loganalytics_ingestion_aks_bytes
queryMode: multi
query: |-
ContainerLog
| where _IsBillable == true
| join kind = inner (KubePodInventory
| project ContainerID, PodName=Name, ControllerKind, ControllerName, Namespace
| distinct *
) on ContainerID
| summarize count_ = sum(_BilledSize) by Namespace, _ResourceId
| project _ResourceId, Namespace, count_ = (todouble(count_) / 3600)
timespan: PT1H
fields:
-
name: _ResourceId
target: cluster
type: id
filters: [toLower]
-
name: Namespace
target: sourceNamespace
type: id
filters: [toLower]
-
name: count_
type: value
defaultField:
type: ignore