Skip to content

Commit

Permalink
add recievers for redis and k8s
Browse files Browse the repository at this point in the history
  • Loading branch information
smithclay committed Jan 28, 2021
1 parent 2d2ec5b commit 973af4d
Show file tree
Hide file tree
Showing 3 changed files with 98 additions and 3 deletions.
85 changes: 85 additions & 0 deletions kubernetes-manifests/k8s-service-account.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,85 @@
apiVersion: v1
kind: ServiceAccount
metadata:
labels:
app: otelcontribcol
name: otelcontribcol
---
apiVersion: rbac.authorization.k8s.io/v1beta1
kind: ClusterRole
metadata:
name: otelcontribcol
labels:
app: otelcontribcol
rules:
- apiGroups:
- ""
resources:
- events
- namespaces
- namespaces/status
- nodes
- nodes/spec
- pods
- pods/status
- replicationcontrollers
- replicationcontrollers/status
- resourcequotas
- services
verbs:
- get
- list
- watch
- apiGroups:
- apps
resources:
- daemonsets
- deployments
- replicasets
- statefulsets
verbs:
- get
- list
- watch
- apiGroups:
- extensions
resources:
- daemonsets
- deployments
- replicasets
verbs:
- get
- list
- watch
- apiGroups:
- batch
resources:
- jobs
- cronjobs
verbs:
- get
- list
- watch
- apiGroups:
- autoscaling
resources:
- horizontalpodautoscalers
verbs:
- get
- list
- watch
---
apiVersion: rbac.authorization.k8s.io/v1beta1
kind: ClusterRoleBinding
metadata:
name: otelcontribcol
labels:
app: otelcontribcol
roleRef:
apiGroup: rbac.authorization.k8s.io
kind: ClusterRole
name: otelcontribcol
subjects:
- kind: ServiceAccount
name: otelcontribcol
namespace: default
9 changes: 8 additions & 1 deletion kubernetes-manifests/otel-collector-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,13 @@ data:
health_check:
receivers:
redis:
endpoint: "${REDIS_ADDR}"
service_name: "redis"
collection_interval: 10s
k8s_cluster:
auth_type: serviceAccount
node_conditions_to_report: [Ready, MemoryPressure]
otlp:
protocols:
grpc:
Expand All @@ -36,5 +43,5 @@ data:
exporters: [logging, otlp]
processors: [batch]
metrics:
receivers: [otlp]
receivers: [otlp, redis, k8s_cluster]
exporters: [logging, otlp]
7 changes: 5 additions & 2 deletions kubernetes-manifests/otel-collector.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,13 +20,14 @@ spec:
app: opentelemetry
component: otel-collector
spec:
serviceAccountName: otelcontribcol
containers:
- command:
- "/otelcol"
- "/otelcontribcol"
- "--config=/conf/otel-collector-config.yaml"
# Memory Ballast size should be max 1/3 to 1/2 of memory.
- "--mem-ballast-size-mib=96"
image: otel/opentelemetry-collector-dev:latest
image: otel/opentelemetry-collector-contrib-dev:63b2f3396fb2bbb27b8b721c57f56a3b3a5072f8
name: otel-collector
resources:
requests:
Expand All @@ -40,6 +41,8 @@ spec:
- containerPort: 55680 # Default endpoint for OpenTelemetry receiver.

env:
- name: REDIS_ADDR
value: "redis-cart:6379"
- name: LS_ACCESS_TOKEN
valueFrom:
secretKeyRef:
Expand Down

0 comments on commit 973af4d

Please sign in to comment.