Skip to content

Commit cf3ccff

Browse files
committed
improve examples
Signed-off-by: Markus Blaschke <mblaschke82@gmail.com>
1 parent bddf06f commit cf3ccff

File tree

3 files changed

+85
-9
lines changed

3 files changed

+85
-9
lines changed

README.md

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,8 +54,12 @@ Global metrics
5454
| `azure_loganalytics_query_requests` | Count of requests (eg paged subqueries) per query |
5555

5656

57-
Example
58-
-------
57+
Examples
58+
--------
59+
60+
see [example.yaml](example.yaml) for general ingestion metrics (number of rows per second and number of bytes per second per table)
61+
62+
see [example.aks.yaml](example.aks.yaml) for AKS namespace ingestion metrics (number of rows per second and number of bytes per AKS namespace)
5963

6064
more examples of result processing can be found within [azure-resourcegraph-expoter](https://github.com/webdevops/azure-resourcegraph-exporter) (uses same processing library)
6165

example.aks.yaml

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
queries:
2+
#########################################################
3+
## rows metric for tables (per second)
4+
- metric: azure_metrics_loganalytics_ingestion_aks_rows
5+
query: |-
6+
ContainerLog
7+
| join kind = inner (KubePodInventory
8+
| project ContainerID, PodName=Name, ControllerKind, ControllerName, Namespace
9+
| distinct *
10+
) on ContainerID
11+
| project Namespace
12+
| summarize count_ = count() by Namespace
13+
| project Namespace, count_ = (todouble(count_) / 3600)
14+
timespan: PT1H
15+
fields:
16+
-
17+
name: Namespace
18+
target: sourceNamespace
19+
type: id
20+
-
21+
name: count_
22+
type: value
23+
defaultField:
24+
type: ignore
25+
26+
#########################################################
27+
## bytes metric for tables (per second)
28+
- metric: azure_metrics_loganalytics_ingestion_aks_bytes
29+
query: |-
30+
ContainerLog
31+
| where _IsBillable == true
32+
| join kind = inner (KubePodInventory
33+
| project ContainerID, PodName=Name, ControllerKind, ControllerName, Namespace
34+
| distinct *
35+
) on ContainerID
36+
| summarize count_ = sum(_BilledSize) by Namespace
37+
| project Namespace, count_ = (todouble(count_) / 3600)
38+
timespan: PT1H
39+
fields:
40+
-
41+
name: Namespace
42+
target: sourceNamespace
43+
type: id
44+
-
45+
name: count_
46+
type: value
47+
defaultField:
48+
type: ignore

example.yaml

Lines changed: 31 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,38 @@
11
queries:
2+
#########################################################
3+
## rows metric for tables (per second)
4+
- metric: azure_metrics_loganalytics_ingestion_overall_rows
5+
query: |-
6+
union withsource=sourceTable *
7+
| project sourceTable
8+
| summarize count_ = count() by sourceTable
9+
| project sourceTable, count_ = (todouble(count_) / 3600)
10+
timespan: PT1H
11+
fields:
12+
-
13+
name: sourceTable
14+
type: id
15+
-
16+
name: count_
17+
type: value
18+
defaultField:
19+
type: ignore
220

3-
# name of metric
4-
- metric: azure_loganalytics_operationstatus_count
5-
6-
# Azure ResourceGraph query
21+
#########################################################
22+
## bytes metric for tables (per second)
23+
- metric: azure_metrics_loganalytics_ingestion_overall_bytes
724
query: |-
8-
Operation
9-
| summarize count() by OperationStatus
10-
timespan: PT24H
25+
union withsource=sourceTable *
26+
| where _IsBillable == true
27+
| summarize count_ = sum(_BilledSize) by sourceTable
28+
| project sourceTable, count_ = (todouble(count_) / 3600)
29+
timespan: PT1H
1130
fields:
31+
-
32+
name: sourceTable
33+
type: id
1234
-
1335
name: count_
1436
type: value
37+
defaultField:
38+
type: ignore

0 commit comments

Comments
 (0)