Skip to content

Commit

Permalink
[opentelemetry] test routing
Browse files Browse the repository at this point in the history
  • Loading branch information
timojohlo committed Dec 16, 2024
1 parent d176b93 commit 8ea1fde
Showing 1 changed file with 21 additions and 1 deletion.
22 changes: 21 additions & 1 deletion system/opentelemetry/templates/logs-collector.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -205,6 +205,17 @@ spec:
- set(attributes["network.protocol.name"], ConvertCase(attributes["network.protocol.name"], "lower")) where attributes["network.protocol.name"] != nil
- set(attributes["config.parsed"], "ingress-nginx") where attributes["client.address"] != nil

transform/ingress_test:
error_mode: ignore
log_statements:
- context: log
conditions:
- resource.attributes["app.label.name"] == "ingress-nginx"
statements:
- merge_maps(attributes, ExtractGrokPatterns(body, "%{IP:client.address} %{NOTSPACE:client.ident} %{NOTSPACE:client.auth} \\[%{HTTPDATE:timestamp}\\] \"%{WORD:request_method} %{NOTSPACE:request_path} %{WORD:network.protocol.name}/%{NOTSPACE:network.protocol.version}\" %{NUMBER:response} %{NUMBER:content_length:int} %{QUOTEDSTRING} \"%{GREEDYDATA:user_agent}\" %{NUMBER:request_length:int} %{BASE10NUM:request_time:float}( \\[%{NOTSPACE:service}\\])? ?(\\[\\])? %{IP:server.address}\\:%{NUMBER:server.port} %{NUMBER:upstream_response_length:int} %{BASE10NUM:upstream_response_time:float} %{NOTSPACE:upstream_status} %{NOTSPACE:request_id}", true),"upsert")
- set(attributes["network.protocol.name"], ConvertCase(attributes["network.protocol.name"], "lower")) where attributes["network.protocol.name"] != nil
- set(attributes["config.parsed_test"], "ingress-nginx_test") where attributes["client.address"] != nil

transform/ceph_rgw:
error_mode: ignore
log_statements:
Expand Down Expand Up @@ -436,7 +447,12 @@ spec:
description: all container log records.
conditions:
- IsMatch(attributes["log.type"], "containerd")
#routing:
routing:
default_pipelines: [logs/containerd]
error_mode: ignore
table:
- statement: route() where IsMatch(attributes["log.type"], "ingress.*")
pipelines: [logs/test]
# default_pipelines: [logs/containerd]
# error_mode: ignore
# table:
Expand All @@ -453,6 +469,10 @@ spec:
level: detailed
{{- end }}
pipelines:
logs/test:
receivers: [filelog/containerd]
processors: [routing]
exporters: [opensearch/logs]
logs/containerd:
receivers: [filelog/containerd]
processors: [k8sattributes,attributes/cluster,transform/ingress,transform/ceph_rgw,transform/ceph_osd,transform/kvm_openvswitch,transform/kvm_nova_agent]
Expand Down

0 comments on commit 8ea1fde

Please sign in to comment.