codeaprendiz.github.io

DevOps Essentials

View on GitHub

Kubernetes Monitoring

Stats Visualization
Nodes
Deployments
Available Pods Per Deployment
Desired-pods
Available pods
Unavailable pods
Unavailable pods per deployment
CPU Usage by node
Memory usage by node
Network out by node
Network in by node
Top CPU intensive pods
Top memory intensive pods

Nodes

Aggregation

## Cardinality ##
a = Cardinality(kubernetes.node.name)

GroupBy-Everything

Deployments

Aggregation

## Cardinality ##
a = Cardinality(kubernetes.deployment.name)

GroupBy-Everything

Available-pods-per-deployment

Aggregation

## Average ##
a = Avg(kubernetes.deployment.replicas.available)

GroupBy-Terms : kubernetes.deployment.name
Top - 10000
OrderBy - Doc Count(default)
Desc

Desired-pods

Aggregation

## Sum ##
a = Sum(kubernetes.deployment.replicas.desired)

GroupBy-Everything

Available-pods

Aggregation

## Sum ##
a = Sum(kubernetes.deployment.replicas.available)

GroupBy-Everything

Unavailable-pods

Aggregation

## Sum ##
a = Sum(kubernetes.deployment.replicas.unavailable)

GroupBy-Everything

Unavailable-pods-per-deployment

Aggregation

## Average ##
a = Avg(kubernetes.deployment.replicas.unavailable)

GroupBy-Terms : kubernetes.deployment.name
Top : 10000
OrderBy : Doc Count(default)
Desc

CPU-usage-by-node

Aggregation

## Sum ##
a = Sum(kubernetes.container.cpu.usage.nanocores)

GroupBy-Terms : kubernetes.node.name
Top : 10000
OrderBy : a
Desc

Aggregation

## Average ##
cores = Average(kubernetes.node.cpu.capacity.cores)

## Bucket Script ##
expression = params.cores * 1000000000

GroupBy-Terms : kubernetes.node.name
Top : 10000
OrderBy : cores
Desc

Memory-usage-by-node

Aggregation

## Sum ##
a = Sum(kubernetes.container.memory.usage.bytes)

## CumulativeSum ##
b = CumulativeSum(a)

## Derivative ##
c = Derivative(b)/10s


GroupBy-Terms : kubernetes.node.name
Top : 10000
OrderBy : a
Desc

Node Capacity

Aggregation

## Sum ##
a = Sum(kubernetes.node.memory.capacity.bytes)

## CumulativeSum ##
b = CumulativeSum(a)

## Derivative ##
c = Derivative(b)/10s


GroupBy-Terms : kubernetes.node.name
Top : 10000
OrderBy : a
Desc

Network-out-by-node

Aggregation

## Max ##
a = Max(kubernetes.pod.network.tx.bytes)

## Derivative ##
b = Derivative(a)

## Positive Only ##
c = PositiveOnly(b)

GroupBy-Terms - kubernetes.node.name
Top - 10000
OrderBy : a
Desc

Network-in-by-node

Aggregation

## Max ##
a = Max(kubernetes.pod.network.rx.bytes)

## Derivative ##
b = Derivative(a)

## Positive Only ##
c = PositiveOnly(b)

GroupBy-Terms - kubernetes.node.name
Top - 100000
OrderBy : a
Desc

#Top-CPU-intensive-pods

Aggregation

## Max ##
a = Max(kubernetes.container.cpu.usage.core.ns)

## Derivative ##
b = Derivative(a)/1s

## Positive Only ##
c = PositiveOnly(b)

GroupBy-Terms - kubernetes.pod.name
Top - 10
OrderBy : a
Desc

Top-memory-intensive-pods

Aggregation

## Sum ##
a = Sum(kubernetes.container.memory.usage.bytes)

## Cumulative Sum ##
b = CumulativeSum(a)

## Derivative ##
c = Derivative(b)/10s

GroupBy-Terms - kubernetes.pod.name
Top - 10
OrderBy : a
Desc