Skip to content

Commit

Permalink
feat: migrate to O2
Browse files Browse the repository at this point in the history
  • Loading branch information
kirinnee committed Dec 21, 2023
1 parent 6c5c718 commit 36180f7
Show file tree
Hide file tree
Showing 21 changed files with 125 additions and 343 deletions.
41 changes: 7 additions & 34 deletions chart/README.md

Large diffs are not rendered by default.

32 changes: 11 additions & 21 deletions chart/collectors/container-logs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,8 @@ receivers:

processors:
batch:
send_batch_size: 10000
timeout: 10s
k8sattributes:
auth_type: "serviceAccount"
passthrough: false
Expand Down Expand Up @@ -137,9 +139,6 @@ processors:
- key: otel.source
action: insert
value: container-logs
- action: insert
key: loki.attribute.labels
value: otel.source
resource:
attributes:
- key: container.id
Expand All @@ -150,37 +149,28 @@ processors:
- key: k8s.cluster
action: insert
value: ${env:K8S_CLUSTER}
- action: insert
key: loki.resource.labels
value: >-
module, landscape, platform, service, cluster
k8s.cluster, k8s.landscape, k8s.namespace.name, k8s.node.name,
k8s.deployment.name, k8s.statefulset.name, k8s.daemonset.name,
k8s.cronjob.name
filter:
logs:
log_record:
- 'resource.attributes["drop_log"] == "true"'

exporters:
logging:
loki:
endpoint: ${env:LOKI_ENDPOINT}
auth:
authenticator: basicauth/loki
debug:
otlphttp/openobserve:
endpoint: ${env:O2_ENDPOINT}
headers:
Authorization: Basic ${env:O2_AUTH}

extensions:
health_check:
pprof:
zpages:
endpoint: 0.0.0.0:55679
basicauth/loki:
client_auth:
username: ${env:LOKI_USER}
password: ${env:LOKI_PASSWORD}

service:
extensions: [ health_check, pprof, zpages, basicauth/loki ]
extensions: [ health_check, pprof, zpages ]
pipelines:
logs:
receivers: [ filelog ]
processors: [ k8sattributes, resource, attributes, batch ]
exporters: [ loki ]
exporters: [ otlphttp/openobserve ]
24 changes: 11 additions & 13 deletions chart/collectors/k8s-cluster.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
receivers:
k8s_cluster:
collection_interval: 120s
collection_interval: 30s
node_conditions_to_report:
- Ready
- MemoryPressure
Expand All @@ -15,6 +15,8 @@ receivers:

processors:
batch:
send_batch_size: 10000
timeout: 10s
attributes:
actions:
- key: container.id
Expand Down Expand Up @@ -121,27 +123,23 @@ processors:
metrics:
metric:
- 'IsMatch(resource.attributes["k8s.namespace.name"],"(pichu|pikachu|raichu)")'

exporters:
prometheusremotewrite:
endpoint: ${env:MIMIR_ENDPOINT}
resource_to_telemetry_conversion:
enabled: true
auth:
authenticator: basicauth/mimir
otlphttp/openobserve:
endpoint: ${env:O2_ENDPOINT}
headers:
Authorization: Basic ${env:O2_AUTH}

extensions:
health_check:
pprof:
zpages:
endpoint: 0.0.0.0:55679
basicauth/mimir:
client_auth:
username: ${env:MIMIR_USER}
password: ${env:MIMIR_PASSWORD}

service:
extensions: [health_check, pprof, zpages, basicauth/mimir]
extensions: [health_check, pprof, zpages ]
pipelines:
metrics:
receivers: [k8s_cluster]
processors: [ k8sattributes, resource, attributes, filter/drop_vcluster, batch]
exporters: [prometheusremotewrite] # mimir
exporters: [otlphttp/openobserve] # mimir
29 changes: 10 additions & 19 deletions chart/collectors/k8s-events.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,31 +2,26 @@ receivers:
k8s_events:

exporters:
loki:
endpoint: ${env:LOKI_ENDPOINT}
auth:
authenticator: basicauth/loki
logging:
otlphttp/openobserve_k8s_events:
endpoint: ${env:O2_ENDPOINT}
headers:
Authorization: Basic ${env:O2_AUTH}
stream-name: k8s_events

extensions:
health_check:
pprof:
zpages:
endpoint: 0.0.0.0:55679
basicauth/loki:
client_auth:
username: ${env:LOKI_USER}
password: ${env:LOKI_PASSWORD}

processors:
batch:
attributes:
actions:
- key: otel.source
action: insert
value: k8s-events
- action: insert
key: loki.attribute.labels
value: otel.source, k8s.namespace.name
resource:
attributes:
- key: k8s.landscape
Expand All @@ -35,15 +30,11 @@ processors:
- key: k8s.cluster
action: insert
value: ${env:K8S_CLUSTER}
- action: insert
key: loki.resource.labels
value: >-
k8s.cluster

service:
extensions: [ health_check, pprof, zpages, basicauth/loki ]
extensions: [ health_check, pprof, zpages ]
pipelines:
logs:
receivers: [k8s_events]
processors: [batch, attributes, resource]
exporters: [loki]
receivers: [ k8s_events ]
processors: [ batch, attributes, resource ]
exporters: [ otlphttp/openobserve_k8s_events ]
24 changes: 11 additions & 13 deletions chart/collectors/kubelet-stats-node-ip.yaml
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
receivers:
kubeletstats:
collection_interval: 120s
collection_interval: 15s
auth_type: "serviceAccount"
endpoint: "https://${env:NODE_IP}:10250"
insecure_skip_verify: true
extra_metadata_labels:
- container.id
- k8s.volume.type
metric_groups:
- node
- pod
Expand All @@ -14,6 +15,8 @@ receivers:

processors:
batch:
send_batch_size: 10000
timeout: 10s
attributes:
actions:
- key: otel.source
Expand Down Expand Up @@ -124,27 +127,22 @@ processors:
metrics:
metric:
- 'IsMatch(resource.attributes["k8s.namespace.name"],"(pichu|pikachu|raichu)")'

exporters:
prometheusremotewrite:
endpoint: ${env:MIMIR_ENDPOINT}
resource_to_telemetry_conversion:
enabled: true
auth:
authenticator: basicauth/mimir
otlphttp/openobserve:
endpoint: ${env:O2_ENDPOINT}
headers:
Authorization: Basic ${env:O2_AUTH}

extensions:
health_check:
pprof:
zpages:
endpoint: 0.0.0.0:55679
basicauth/mimir:
client_auth:
username: ${env:MIMIR_USER}
password: ${env:MIMIR_PASSWORD}
service:
extensions: [ health_check, pprof, zpages, basicauth/mimir ]
extensions: [ health_check, pprof, zpages ]
pipelines:
metrics:
receivers: [kubeletstats]
processors: [k8sattributes, attributes, resource, filter/drop_vcluster, filter/drop_volume_kubeapi, batch]
exporters: [prometheusremotewrite] # mimir
exporters: [otlphttp/openobserve] # mimir
23 changes: 10 additions & 13 deletions chart/collectors/kubelet-stats-node-name.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
receivers:
kubeletstats:
collection_interval: 120s
collection_interval: 15s
auth_type: "serviceAccount"
endpoint: "https://${env:KUBE_NODE_NAME}.nodes.vcluster.com/api/v1/nodes/${env:KUBE_NODE_NAME}/proxy"
insecure_skip_verify: true
Expand All @@ -12,6 +12,8 @@ receivers:

processors:
batch:
send_batch_size: 10000
timeout: 10s
attributes:
actions:
- key: otel.source
Expand Down Expand Up @@ -119,26 +121,21 @@ processors:
metric:
- 'IsMatch(resource.attributes["k8s.volume.name"],"kube-api-access-.*")'
exporters:
prometheusremotewrite:
endpoint: ${env:MIMIR_ENDPOINT}
resource_to_telemetry_conversion:
enabled: true
auth:
authenticator: basicauth/mimir
otlphttp/openobserve:
endpoint: ${env:O2_ENDPOINT}
headers:
Authorization: Basic ${env:O2_AUTH}

extensions:
health_check:
pprof:
zpages:
endpoint: 0.0.0.0:55679
basicauth/mimir:
client_auth:
username: ${env:MIMIR_USER}
password: ${env:MIMIR_PASSWORD}

service:
extensions: [ health_check, pprof, zpages, basicauth/mimir ]
extensions: [ health_check, pprof, zpages ]
pipelines:
metrics:
receivers: [kubeletstats]
processors: [k8sattributes, attributes, resource, filter/drop_volume_kubeapi, batch]
exporters: [prometheusremotewrite] # mimir
exporters: [otlphttp/openobserve]
42 changes: 11 additions & 31 deletions chart/collectors/otlp.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ receivers:
http:
processors:
batch:
send_batch_size: 10000
timeout: 10s
k8sattributes:
auth_type: "serviceAccount"
passthrough: false
Expand Down Expand Up @@ -91,51 +93,29 @@ processors:
k8s.deployment.name, k8s.statefulset.name, k8s.daemonset.name,
k8s.cronjob.name
exporters:
prometheusremotewrite:
endpoint: ${env:MIMIR_ENDPOINT}
resource_to_telemetry_conversion:
enabled: true
auth:
authenticator: basicauth/mimir
otlphttp:
endpoint: ${env:TEMPO_ENDPOINT}
auth:
authenticator: basicauth/tempo
loki:
endpoint: ${env:LOKI_ENDPOINT}
auth:
authenticator: basicauth/loki
logging:
otlphttp/openobserve:
endpoint: ${env:O2_ENDPOINT}
headers:
Authorization: Basic ${env:O2_AUTH}

extensions:
health_check:
pprof:
zpages:
endpoint: 0.0.0.0:55679
basicauth/mimir:
client_auth:
username: ${env:MIMIR_USER}
password: ${env:MIMIR_PASSWORD}
basicauth/tempo:
client_auth:
username: ${env:TEMPO_USER}
password: ${env:TEMPO_PASSWORD}
basicauth/loki:
client_auth:
username: ${env:LOKI_USER}
password: ${env:LOKI_PASSWORD}

service:
extensions: [ health_check, pprof, zpages, basicauth/mimir, basicauth/tempo, basicauth/loki ]
extensions: [ health_check, pprof, zpages ]
pipelines:
logs:
receivers: [ otlp ]
processors: [ k8sattributes, resource, attributes, batch ]
exporters: [ loki ]
exporters: [ otlphttp/openobserve ]
traces:
receivers: [ otlp ]
processors: [ k8sattributes, resource, attributes, batch ]
exporters: [ otlphttp ]
exporters: [ otlphttp/openobserve ]
metrics:
receivers: [ otlp ]
processors: [ k8sattributes, resource, attributes, batch ]
exporters: [ prometheusremotewrite ] # mimir
exporters: [ otlphttp/openobserve ]
Loading

0 comments on commit 36180f7

Please sign in to comment.