Skip to content

Commit

Permalink
Add OpenTelemetry and Tempo for AI Telemetry in obs (OCP-on-NERC#627)
Browse files Browse the repository at this point in the history
* feat: add OTel and Tempo to obs cluster

Signed-off-by: Dheeraj<[email protected]>

* Adding additional OpenTelemetry resources for obs cluster

---------

Signed-off-by: Dheeraj<[email protected]>
Co-authored-by: Dheeraj <[email protected]>
  • Loading branch information
computate and dheerajodha authored Dec 16, 2024
1 parent a602534 commit 56c7b15
Show file tree
Hide file tree
Showing 12 changed files with 210 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization
resources:
- namespace.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
apiVersion: v1
kind: Namespace
metadata:
name: opentelemetry
spec: {}
6 changes: 6 additions & 0 deletions cluster-scope/bundles/opentelemetry/kustomization.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization
commonLabels:
nerc.mghpcc.org/bundle: opentelemetry
resources:
- ../../base/core/namespaces/opentelemetry
1 change: 1 addition & 0 deletions cluster-scope/overlays/nerc-ocp-obs/kustomization.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ resources:
- ../../bundles/zookeeper
- ../../bundles/solr
- ../../bundles/minio
- ../../bundles/opentelemetry
- ../../base/core/namespaces/openshift-gitops
- ../../base/core/namespaces/dex
- ../../base/rbac.authorization.k8s.io/clusterroles/allow-edit-rbac
Expand Down
15 changes: 15 additions & 0 deletions opentelemetry/base/externalsecret-opentelemetry.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
apiVersion: external-secrets.io/v1beta1
kind: ExternalSecret
metadata:
name: opentelemetry
namespace: opentelemetry
spec:
refreshInterval: "1h"
secretStoreRef:
name: nerc-secret-store
kind: SecretStore
target:
name: opentelemetry
dataFrom:
- extract:
key: $ENV/$CLUSTER/ai-telemetry/opentelemetry
12 changes: 12 additions & 0 deletions opentelemetry/base/kustomization.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization
namespace: opentelemetry
commonLabels:
app: opentelemetry

resources:
- externalsecret-opentelemetry.yaml
- opentelemetry-rbac.yaml
- opentelemetry-tempostack.yaml
- opentelemetry-collector.yaml
- opentelemetry-instrumentation.yaml
64 changes: 64 additions & 0 deletions opentelemetry/base/opentelemetry-collector.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
apiVersion: opentelemetry.io/v1alpha1
kind: OpenTelemetryCollector
metadata:
name: opentelemetry
namespace: opentelemetry
spec:
mode: deployment
observability:
metrics:
enableMetrics: true
config: |
connectors:
spanmetrics:
metrics_flush_interval: 15s
receivers:
otlp:
protocols:
grpc:
endpoint: 0.0.0.0:4317
http:
endpoint: 0.0.0.0:4318
jaeger:
protocols:
grpc:
endpoint: 0.0.0.0:14250
thrift_http:
endpoint: 0.0.0.0:14268
thrift_compact:
endpoint: 0.0.0.0:6831
thrift_binary:
endpoint: 0.0.0.0:6832
processors:
batch:
timeout: 5s
send_batch_max_size: 10000
memory_limiter:
check_interval: 1s
limit_percentage: 50
spike_limit_percentage: 30
exporters:
prometheus:
endpoint: 0.0.0.0:8889
add_metric_suffixes: false
resource_to_telemetry_conversion:
enabled: true
otlp:
endpoint: tempo-opentelemetry-distributor.opentelemetry.svc:4317
tls:
ca_file: /var/run/secrets/kubernetes.io/serviceaccount/service-ca.crt
headers:
X-Scope-OrgID: "dev"
service:
telemetry:
metrics:
address: ":8888"
pipelines:
traces:
receivers: [otlp, jaeger]
processors: [memory_limiter, batch]
exporters: [otlp, spanmetrics]
metrics:
receivers: [otlp, spanmetrics]
processors: [memory_limiter, batch]
exporters: [otlp, prometheus]
19 changes: 19 additions & 0 deletions opentelemetry/base/opentelemetry-instrumentation.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
apiVersion: opentelemetry.io/v1alpha1
kind: Instrumentation
metadata:
name: java-instrumentation
spec:
env:
- name: OTEL_EXPORTER_OTLP_TIMEOUT
value: "20"
exporter:
endpoint: http://opentelemetry-collector.opentelemetry.svc.cluster.local:4317
propagators:
- ottrace
sampler:
type: parentbased_traceidratio
argument: "0.25"
java:
env:
- name: OTEL_JAVAAGENT_DEBUG
value: "true"
31 changes: 31 additions & 0 deletions opentelemetry/base/opentelemetry-rbac.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRole
metadata:
name: generate-processors-rbac
rules:
- apiGroups:
- rbac.authorization.k8s.io
resources:
- clusterrolebindings
- clusterroles
verbs:
- create
- delete
- get
- list
- patch
- update
- watch
---
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRoleBinding
metadata:
name: generate-processors-rbac
roleRef:
apiGroup: rbac.authorization.k8s.io
kind: ClusterRole
name: generate-processors-rbac
subjects:
- kind: ServiceAccount
name: opentelemetry-operator-controller-manager
namespace: openshift-opentelemetry-operator
34 changes: 34 additions & 0 deletions opentelemetry/base/opentelemetry-tempostack.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
apiVersion: tempo.grafana.com/v1alpha1
kind: TempoStack
metadata:
name: opentelemetry
namespace: opentelemetry
spec:
storageSize: 100Gi
storage:
secret:
name: opentelemetry
type: s3
tls:
enabled: true
template:
gateway:
enabled: false
distributor:
tls:
enabled: true
queryFrontend:
jaegerQuery:
enabled: true
monitorTab:
enabled: true
prometheusEndpoint: https://thanos-querier.openshift-monitoring.svc.cluster.local:9091
ingress:
route:
termination: edge
type: route
resources:
total:
limits:
memory: 4Gi
cpu: 4
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
apiVersion: external-secrets.io/v1beta1
kind: ExternalSecret
metadata:
name: opentelemetry
namespace: opentelemetry
spec:
secretStoreRef:
name: nerc-cluster-secrets
kind: ClusterSecretStore
dataFrom:
- extract:
key: nerc/nerc-ocp-obs/ai-telemetry/opentelemetry
7 changes: 7 additions & 0 deletions opentelemetry/overlays/nerc-ocp-obs/kustomization.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization
resources:
- ../../base

patches:
- path: externalsecrets/patch-opentelemetry.yaml

0 comments on commit 56c7b15

Please sign in to comment.