Skip to content

Commit

Permalink
fix(opentelemetry) fixing parsing errors, updating images (#383)
Browse files Browse the repository at this point in the history
* fix(opentelemetry) fixing parsing errors, updating images

* Update clusterrole.yaml

---------

Co-authored-by: Olaf Heydorn <[email protected]>
  • Loading branch information
timojohlo and Kuckkuck authored Sep 10, 2024
1 parent 73391d1 commit 4072695
Show file tree
Hide file tree
Showing 6 changed files with 24 additions and 24 deletions.
2 changes: 1 addition & 1 deletion Dockerfile.otel-collector
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ RUN apt update \
&& apt upgrade -y \
&& apt autoremove -y \
&& apt install -y systemd libssl-dev
FROM --platform=${BUILDPLATFORM:-linux/amd64} ghcr.io/open-telemetry/opentelemetry-collector-releases/opentelemetry-collector-contrib:0.107.0
FROM --platform=${BUILDPLATFORM:-linux/amd64} ghcr.io/open-telemetry/opentelemetry-collector-releases/opentelemetry-collector-contrib:0.108.0
LABEL source_repository="https://github.com/greenhouse-extensions"
COPY --from=journal /lib/x86_64-linux-gnu/libc.so.6 /lib/x86_64-linux-gnu/libc.so.6
COPY --from=journal /lib64/ld-linux-x86-64.so.2 /lib64/ld-linux-x86-64.so.2
Expand Down
2 changes: 1 addition & 1 deletion opentelemetry/chart/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
apiVersion: v2
appVersion: v0.104.0
name: opentelemetry-operator
version: 0.3.2
version: 0.3.3
description: OpenTelemetry Operator Helm chart for Kubernetes
icon: https://raw.githubusercontent.com/cncf/artwork/a718fa97fffec1b9fd14147682e9e3ac0c8817cb/projects/opentelemetry/icon/color/opentelemetry-icon-color.png
type: application
Expand Down
2 changes: 1 addition & 1 deletion opentelemetry/chart/templates/clusterrole.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ metadata:
app: logs-collector
rules:
- apiGroups: [""]
resources: ["pods", "namespaces", "nodes"]
resources: ["pods", "namespaces", "nodes", "events"]
verbs: ["get", "watch", "list"]
- apiGroups: ["apps"]
resources: ["replicasets"]
Expand Down
36 changes: 18 additions & 18 deletions opentelemetry/chart/templates/logs-collector.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -168,21 +168,21 @@ spec:
- set(attributes["monotonic_timestamp"], cache["__MONOTONIC_TIMESTAMP"])
- delete_key(attributes, "cache")

#transform/containerd:
# log_statements:
# context: log
# statements:
# - merge_maps(cache,ExtractPatterns(body,"^(?P<time>[^Z]+Z) (?P<stream>stdout|stderr) (?P<logtag>[^\\s]*) ?(?P<log>.*)$"), "upsert") where body != nil
# - merge_maps(cache,ExtractPatterns(body,"^(?P<time>\\d+/\\d+/\\d+\\s+\\d+:\\d+\\d+) (?P<log>.*)$"), "upsert") where attributes["log_name"]!= "MeshAccessLog" and cache["log"]!= nil and not IsMap(cache["log"])
# - set(body,cache["log"]) where cache["log"] != nil
# - merge_maps(cache,ParseJSON(body), "upsert") where IsMap(body)
# - set(body,cache["message"]) where cache["message"] != nil
# - set(body,cache["msg"]) where cache["msg"] != nil
# - set(severity_text,cache["level"]) where cache["level"] != nil
# - set(severity_text,cache["severity"]) where cache["severity"] != nil
# - set(severity_number,SEVERITY_NUMBER_INFO) where cache["level"] == "INFO"
# - set(severity_number,SEVERITY_NUMBER_INFO) where cache["severity"] == "info"
# - set(attributes["loggerName"],cache["loggerName"]) where cache["loggerName"] != nil
transform/containerd:
log_statements:
- context: log
statements:
- merge_maps(cache,ExtractPatterns(body,"^(?P<time>[^Z]+Z) (?P<stream>stdout|stderr) (?P<logtag>[^\\s]*) ?(?P<log>.*)$"), "upsert") where body != nil
- merge_maps(cache,ExtractPatterns(body,"^(?P<time>\\d+/\\d+/\\d+\\s+\\d+:\\d+\\d+) (?P<log>.*)$"), "upsert") where attributes["log_name"]!= "MeshAccessLog" and cache["log"]!= nil and not IsMap(cache["log"])
- set(body,cache["log"]) where cache["log"] != nil
- merge_maps(cache,ParseJSON(body), "upsert") where IsMap(body)
- set(body,cache["message"]) where cache["message"] != nil
- set(body,cache["msg"]) where cache["msg"] != nil
- set(severity_text,cache["level"]) where cache["level"] != nil
- set(severity_text,cache["severity"]) where cache["severity"] != nil
- set(severity_number,SEVERITY_NUMBER_INFO) where cache["level"] == "INFO"
- set(severity_number,SEVERITY_NUMBER_INFO) where cache["severity"] == "info"
- set(attributes["loggerName"],cache["loggerName"]) where cache["loggerName"] != nil

transform/ingress:
error_mode: ignore
Expand All @@ -191,16 +191,16 @@ spec:
conditions:
- resource.attributes["app.label.name"] == "ingress-nginx"
statements:
- merge_maps(attributes, ExtractGrokPatterns(body, "%{IP:remoteaddr} %{NOTSPACE:ident} %{NOTSPACE:auth} \\[%{HTTPDATE:timestamp}\\] \"%{WORD:request_method} %{NOTSPACE:request_path} %{NOTSPACE:httpversion}\" %{NUMBER:response} %{NUMBER:content_length:int} %{QUOTEDSTRING} \"%{GREEDYDATA:user_agent}\" %{NUMBER:request_length:int} %{BASE10NUM:request_time:float}( \\[%{NOTSPACE:service}\\])? ?(\\[\\])? %{IP:upstream_addr}\\:%{NUMBER:upstream_port} %{NUMBER:upstream_response_length:int} %{BASE10NUM:upstream_response_time:float} %{NOTSPACE:upstream_status} %{NOTSPACE:request_id}", true),"upsert"
- merge_maps(attributes, ExtractGrokPatterns(body, "%{IP:remoteaddr} %{NOTSPACE:ident} %{NOTSPACE:auth} \\[%{HTTPDATE:timestamp}\\] \"%{WORD:request_method} %{NOTSPACE:request_path} %{NOTSPACE:httpversion}\" %{NUMBER:response} %{NUMBER:content_length:int} %{QUOTEDSTRING} \"%{GREEDYDATA:user_agent}\" %{NUMBER:request_length:int} %{BASE10NUM:request_time:float}( \\[%{NOTSPACE:service}\\])? ?(\\[\\])? %{IP:upstream_addr}\\:%{NUMBER:upstream_port} %{NUMBER:upstream_response_length:int} %{BASE10NUM:upstream_response_time:float} %{NOTSPACE:upstream_status} %{NOTSPACE:request_id}", true),"upsert")

transform/cheph:
transform/ceph:
error_mode: ignore
log_statements:
- context: log
conditions:
- resource.attributes["app.label.part-of"] == "ceph-cluster"
statements:
- merge_maps(attributes, ExtractGrokPatterns(body, "%{WORD:debug_level} %{TIMESTAMP_ISO8601:log_timestamp} %{NOTSPACE}%{SPACE}%{NUMBER} %{NOTSPACE}\\: %{NOTSPACE}\\: %{IP:remoteaddr} %{NOTSPACE} %{NOTSPACE:project_id}\\$%{NOTSPACE} \\[%{HTTPDATE:request_timestamp}\\] \"%{WORD:request_method} \\/(?<bucket>[a-zA-Z0-9._+-]+)\\/%{NOTSPACE:request_path} %{NOTSPACE:httpversion}\" %{NUMBER:response} %{NUMBER:content_length:integer} %{NOTSPACE} \"%{GREEDYDATA:user_agent}\" %{NOTSPACE} latency=%{NUMBER:latency:float}", true),"upsert"
- merge_maps(attributes, ExtractGrokPatterns(body, "%{WORD:debug_level} %{TIMESTAMP_ISO8601:log_timestamp} %{NOTSPACE} %{SPACE} %{NUMBER} %{NOTSPACE}\\:%{SPACE}%{NOTSPACE}\\:%{SPACE}%{IP:remoteaddr} %{NOTSPACE} %{NOTSPACE:project_id}\\$%{NOTSPACE} \\[%{HTTPDATE:request_timestamp}\\] \"%{WORD:request_method} \\/(?<bucket>[a-zA-Z0-9._+-]+)\\/%{NOTSPACE:request_path} %{NOTSPACE:httpversion}\" %{NUMBER:response} %{NUMBER:content_length:integer} %{NOTSPACE} \"%{GREEDYDATA:user_agent}\" %{NOTSPACE} latency=%{NUMBER:latency:float}", true),"upsert")

k8sattributes:
auth_type: "serviceAccount"
Expand Down
2 changes: 1 addition & 1 deletion opentelemetry/chart/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ opentelemetry-operator:
#tag: 0.104.0
image:
repository: ghcr.io/open-telemetry/opentelemetry-operator/opentelemetry-operator
tag: v0.104.0
tag: v0.108.0
deploymentAnnotations:
vpa-butler.cloud.sap/update-mode: Auto
prometheusRule:
Expand Down
4 changes: 2 additions & 2 deletions opentelemetry/plugindefinition.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,14 @@ kind: PluginDefinition
metadata:
name: opentelemetry
spec:
version: 0.3.2
version: 0.3.3
displayName: OpenTelemetry
description: Observability framework for instrumenting, generating, collecting, and exporting telemetry data such as traces, metrics, and logs.
icon: https://raw.githubusercontent.com/cloudoperators/greenhouse-extensions/main/opentelemetry/logo.png
helmChart:
name: opentelemetry-operator
repository: oci://ghcr.io/cloudoperators/greenhouse-extensions/charts
version: 0.3.2
version: 0.3.3
options:
- default: true
description: Activates the standard configuration for logs
Expand Down

0 comments on commit 4072695

Please sign in to comment.