Compare commits

...

3 Commits

Author SHA1 Message Date
1d48676d2c Add basicauth to otel 2025-11-14 19:18:56 +01:00
8488467ca7 Configure otel tables for grafana 2025-11-14 17:59:05 +01:00
1235a58128 Add http and grpc ingress for otel 2025-11-14 17:33:54 +01:00
4 changed files with 50 additions and 11 deletions

View File

@@ -12,6 +12,7 @@ spec:
datasource: datasource:
name: clickhouse name: clickhouse
access: proxy access: proxy
isDefault: true
type: grafana-clickhouse-datasource type: grafana-clickhouse-datasource
jsonData: jsonData:
host: clickhouse-otel-cluster.otel.svc.cluster.local host: clickhouse-otel-cluster.otel.svc.cluster.local
@@ -19,6 +20,16 @@ spec:
username: grafana username: grafana
defaultDatabase: otel defaultDatabase: otel
protocol: native protocol: native
logs:
defaultDatabase: otel
defaultTable: otel_logs
otelEnabled: true
otelVersion: latest
traces:
defaultDatabase: otel
defaultTable: otel_traces
otelEnabled: true
otelVersion: latest
secureJsonData: secureJsonData:
password: ${grafana} password: ${grafana}
instanceSelector: instanceSelector:

View File

@@ -0,0 +1,12 @@
apiVersion: external-secrets.io/v1
kind: ExternalSecret
metadata:
name: otel-basicauth
spec:
refreshInterval: 24h
secretStoreRef:
kind: ClusterSecretStore
name: bitwarden
dataFrom:
- extract:
key: otel-basicauth

View File

@@ -17,7 +17,7 @@ spec:
service: service:
name: otel-collector name: otel-collector
port: port:
name: otlp-grpc name: otlp-http
tls: tls:
- hosts: - hosts:
- otel.sdg.moe - otel.sdg.moe

View File

@@ -10,6 +10,19 @@ spec:
secretKeyRef: secretKeyRef:
name: clickhouse-passwords name: clickhouse-passwords
key: collector key: collector
volumes:
- name: htpasswd
secret:
secretName: otel-basicauth
items:
- key: .htpasswd
path: .htpasswd
volumeMounts:
- name: htpasswd
mountPath: .htpasswd
subPath: .htpasswd
config: config:
receivers: receivers:
# hostmetrics: # hostmetrics:
@@ -25,10 +38,10 @@ spec:
# paging: # paging:
otlp: otlp:
protocols: protocols:
grpc:
endpoint: 0.0.0.0:4317
http: http:
endpoint: 0.0.0.0:4318 endpoint: 0.0.0.0:4318
auth:
authenticator: basicauth/server
processors: processors:
memory_limiter: memory_limiter:
@@ -66,9 +79,12 @@ spec:
endpoint: 0.0.0.0:1777 endpoint: 0.0.0.0:1777
zpages: zpages:
endpoint: 0.0.0.0:55679 endpoint: 0.0.0.0:55679
basicauth/server:
htpasswd:
file: .htpasswd
service: service:
extensions: [health_check, pprof, zpages] extensions: [basicauth/server, health_check, pprof, zpages]
pipelines: pipelines:
traces: traces:
receivers: [otlp] receivers: [otlp]
@@ -77,8 +93,8 @@ spec:
metrics: metrics:
receivers: [otlp] #[otlp, hostmetrics] receivers: [otlp] #[otlp, hostmetrics]
processors: [memory_limiter, batch] processors: [memory_limiter, batch]
exporters: [debug, clickhouse] exporters: [clickhouse]
logs: logs:
receivers: [otlp] receivers: [otlp]
processors: [memory_limiter, batch] processors: [memory_limiter, batch]
exporters: [debug, clickhouse] exporters: [clickhouse]