Skip to content

Commit 0e27422

Browse files
authored
Merge pull request #4240 from ClickHouse/clickstack_k8s
Guide for monitoring kubernetes with clickstack
2 parents 85f4ce4 + 8d6fd51 commit 0e27422

File tree

11 files changed

+836
-131
lines changed

11 files changed

+836
-131
lines changed
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
import Image from '@theme/IdealImage';
2+
import architecture from '@site/static/images/use-cases/observability/hyperdx-demo/architecture.png';
3+
4+
### Demo Architecture {#demo-architecture}
5+
6+
The demo is composed of microservices written in different programming languages that talk to each other over gRPC and HTTP and a load generator that uses Locust to fake user traffic. The original source code for this demo has been modified to use [ClickStack instrumentation](/use-cases/observability/clickstack/sdks).
7+
8+
<Image img={architecture} alt="Architecture" size="lg"/>
9+
10+
_Credit: https://opentelemetry.io/docs/demo/architecture/_
11+
12+
Further details on the demo can be found in:
13+
14+
- [OpenTelemetry documentation](https://opentelemetry.io/docs/demo/)
15+
- [ClickStack maintained fork](https://github.com/ClickHouse/opentelemetry-demo)
Lines changed: 100 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,100 @@
1+
# daemonset.yaml
2+
mode: daemonset
3+
4+
image:
5+
repository: otel/opentelemetry-collector-contrib
6+
tag: 0.123.0
7+
8+
# Required to use the kubeletstats cpu/memory utilization metrics
9+
clusterRole:
10+
create: true
11+
rules:
12+
- apiGroups:
13+
- ''
14+
resources:
15+
- nodes/proxy
16+
verbs:
17+
- get
18+
19+
presets:
20+
logsCollection:
21+
enabled: true
22+
hostMetrics:
23+
enabled: true
24+
# Configures the Kubernetes Processor to add Kubernetes metadata.
25+
# Adds the k8sattributes processor to all the pipelines and adds the necessary rules to ClusterRole.
26+
# More Info: https://opentelemetry.io/docs/kubernetes/collector/components/#kubernetes-attributes-processor
27+
kubernetesAttributes:
28+
enabled: true
29+
# When enabled the processor will extra all labels for an associated pod and add them as resource attributes.
30+
# The label's exact name will be the key.
31+
extractAllPodLabels: true
32+
# When enabled the processor will extra all annotations for an associated pod and add them as resource attributes.
33+
# The annotation's exact name will be the key.
34+
extractAllPodAnnotations: true
35+
# Configures the collector to collect node, pod, and container metrics from the API server on a kubelet..
36+
# Adds the kubeletstats receiver to the metrics pipeline and adds the necessary rules to ClusterRole.
37+
# More Info: https://opentelemetry.io/docs/kubernetes/collector/components/#kubeletstats-receiver
38+
kubeletMetrics:
39+
enabled: true
40+
41+
extraEnvs:
42+
- name: HYPERDX_API_KEY
43+
valueFrom:
44+
secretKeyRef:
45+
name: hyperdx-secret
46+
key: HYPERDX_API_KEY
47+
optional: true
48+
- name: YOUR_OTEL_COLLECTOR_ENDPOINT
49+
valueFrom:
50+
configMapKeyRef:
51+
name: otel-config-vars
52+
key: YOUR_OTEL_COLLECTOR_ENDPOINT
53+
54+
config:
55+
receivers:
56+
# Configures additional kubelet metrics
57+
kubeletstats:
58+
collection_interval: 20s
59+
auth_type: 'serviceAccount'
60+
endpoint: '${env:K8S_NODE_NAME}:10250'
61+
insecure_skip_verify: true
62+
metrics:
63+
k8s.pod.cpu_limit_utilization:
64+
enabled: true
65+
k8s.pod.cpu_request_utilization:
66+
enabled: true
67+
k8s.pod.memory_limit_utilization:
68+
enabled: true
69+
k8s.pod.memory_request_utilization:
70+
enabled: true
71+
k8s.pod.uptime:
72+
enabled: true
73+
k8s.node.uptime:
74+
enabled: true
75+
k8s.container.cpu_limit_utilization:
76+
enabled: true
77+
k8s.container.cpu_request_utilization:
78+
enabled: true
79+
k8s.container.memory_limit_utilization:
80+
enabled: true
81+
k8s.container.memory_request_utilization:
82+
enabled: true
83+
container.uptime:
84+
enabled: true
85+
86+
exporters:
87+
otlphttp:
88+
endpoint: "${env:YOUR_OTEL_COLLECTOR_ENDPOINT}"
89+
compression: gzip
90+
headers:
91+
authorization: "${env:HYPERDX_API_KEY}"
92+
93+
service:
94+
pipelines:
95+
logs:
96+
exporters:
97+
- otlphttp
98+
metrics:
99+
exporters:
100+
- otlphttp
Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
# deployment.yaml
2+
mode: deployment
3+
4+
image:
5+
repository: otel/opentelemetry-collector-contrib
6+
tag: 0.123.0
7+
8+
# We only want one of these collectors - any more and we'd produce duplicate data
9+
replicaCount: 1
10+
11+
presets:
12+
kubernetesAttributes:
13+
enabled: true
14+
# When enabled the processor will extra all labels for an associated pod and add them as resource attributes.
15+
# The label's exact name will be the key.
16+
extractAllPodLabels: true
17+
# When enabled the processor will extra all annotations for an associated pod and add them as resource attributes.
18+
# The annotation's exact name will be the key.
19+
extractAllPodAnnotations: true
20+
# Configures the collector to collect kubernetes events.
21+
# Adds the k8sobject receiver to the logs pipeline and collects kubernetes events by default.
22+
# More Info: https://opentelemetry.io/docs/kubernetes/collector/components/#kubernetes-objects-receiver
23+
kubernetesEvents:
24+
enabled: true
25+
# Configures the Kubernetes Cluster Receiver to collect cluster-level metrics.
26+
# Adds the k8s_cluster receiver to the metrics pipeline and adds the necessary rules to ClusteRole.
27+
# More Info: https://opentelemetry.io/docs/kubernetes/collector/components/#kubernetes-cluster-receiver
28+
clusterMetrics:
29+
enabled: true
30+
31+
extraEnvs:
32+
- name: HYPERDX_API_KEY
33+
valueFrom:
34+
secretKeyRef:
35+
name: hyperdx-secret
36+
key: HYPERDX_API_KEY
37+
optional: true
38+
- name: YOUR_OTEL_COLLECTOR_ENDPOINT
39+
valueFrom:
40+
configMapKeyRef:
41+
name: otel-config-vars
42+
key: YOUR_OTEL_COLLECTOR_ENDPOINT
43+
44+
config:
45+
exporters:
46+
otlphttp:
47+
endpoint: "${env:YOUR_OTEL_COLLECTOR_ENDPOINT}"
48+
compression: gzip
49+
headers:
50+
authorization: "${env:HYPERDX_API_KEY}"
51+
service:
52+
pipelines:
53+
logs:
54+
exporters:
55+
- otlphttp
56+
metrics:
57+
exporters:
58+
- otlphttp

0 commit comments

Comments
 (0)