Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions confgenerator/filter/internal/ast/ast.go
Original file line number Diff line number Diff line change
Expand Up @@ -57,9 +57,9 @@ var logEntryRootValueMapToOTel = map[string][]string{
}

var logEntryRootStructMapToOTel = map[string][]string{
"jsonPayload": {"body"},
"labels": {"attributes"},
// "operation": {}, // TODO: Missing in OTel exporter
"jsonPayload": {"body"},
"labels": {"attributes"},
"operation": {"attributes", "gcp.operation"},
"sourceLocation": {"attributes", "gcp.source_location"},
"httpRequest": {"attributes", "gcp.http_request"},
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
[27:18] "fields[operation]": 1:10: error: field "operation" not found
[27:17] "fields[insertId]": 1:9: error: field "insertId" not found
24 | simple:
25 | type: modify_fields
26 | fields:
> 27 | operation:
^
28 | move_from: jsonPayload.operation
> 27 | insertId:
^
28 | move_from: jsonPayload.insert_id
29 | service:
30 | experimental_otel_logging: true
31 |
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
[27:18] "fields[operation]": 1:10: error: field "operation" not found
[27:17] "fields[insertId]": 1:9: error: field "insertId" not found
24 | simple:
25 | type: modify_fields
26 | fields:
> 27 | operation:
^
28 | move_from: jsonPayload.operation
> 27 | insertId:
^
28 | move_from: jsonPayload.insert_id
29 | service:
30 | experimental_otel_logging: true
31 |
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
[27:18] "fields[operation]": 1:10: error: field "operation" not found
[27:17] "fields[insertId]": 1:9: error: field "insertId" not found
24 | simple:
25 | type: modify_fields
26 | fields:
> 27 | operation:
^
28 | move_from: jsonPayload.operation
> 27 | insertId:
^
28 | move_from: jsonPayload.insert_id
29 | service:
30 | experimental_otel_logging: true
31 |
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
[27:18] "fields[operation]": 1:10: error: field "operation" not found
[27:17] "fields[insertId]": 1:9: error: field "insertId" not found
24 | simple:
25 | type: modify_fields
26 | fields:
> 27 | operation:
^
28 | move_from: jsonPayload.operation
> 27 | insertId:
^
28 | move_from: jsonPayload.insert_id
29 | service:
30 | experimental_otel_logging: true
31 |
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,8 @@ logging:
simple:
type: modify_fields
fields:
operation:
move_from: jsonPayload.operation
insertId:
move_from: jsonPayload.insert_id
service:
experimental_otel_logging: true
pipelines:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -815,12 +815,15 @@ processors:
- delete_key(cache, "__field_10") where (cache != nil and cache["__field_10"] != nil)
- set(cache["__field_10"], body) where (body != nil)
- delete_key(cache, "__field_11") where (cache != nil and cache["__field_11"] != nil)
- set(cache["__field_11"], body["level"]) where (body != nil and body["level"] != nil)
- delete_key(cache, "__field_13") where (cache != nil and cache["__field_13"] != nil)
- set(cache["__field_13"], body["trace"]) where (body != nil and body["trace"] != nil)
- set(cache["__field_11"], body["op_id"]) where (body != nil and body["op_id"] != nil)
- delete_key(cache, "__field_12") where (cache != nil and cache["__field_12"] != nil)
- set(cache["__field_12"], body["level"]) where (body != nil and body["level"] != nil)
- delete_key(cache, "__field_14") where (cache != nil and cache["__field_14"] != nil)
- set(cache["__field_14"], body["trace"]) where (body != nil and body["trace"] != nil)
- set(cache["__omit_0"], false)
- set(cache["__omit_0"], true) where ((body != nil and body["omitted"] != nil) and IsMatch(body["omitted"], "(?i)^-$"))
- delete_key(body, "move_source") where (body != nil and body["move_source"] != nil)
- delete_key(body, "op_id") where (body != nil and body["op_id"] != nil)
- delete_key(body, "trace") where (body != nil and body["trace"] != nil)
- delete_key(cache, "value") where (cache != nil and cache["value"] != nil)
- set(cache["value"], cache["__field_0"])
Expand Down Expand Up @@ -862,6 +865,9 @@ processors:
- set(attributes["text"], cache["value"]) where (cache != nil and cache["value"] != nil)
- delete_key(cache, "value") where (cache != nil and cache["value"] != nil)
- set(cache["value"], cache["__field_11"])
- set(attributes["gcp.operation"]["id"], cache["value"]) where (cache != nil and cache["value"] != nil)
- delete_key(cache, "value") where (cache != nil and cache["value"] != nil)
- set(cache["value"], cache["__field_12"])
- delete_key(cache, "mapped_value") where (cache != nil and cache["mapped_value"] != nil)
- set(cache["mapped_value"], cache["value"]) where (cache != nil and cache["value"] != nil)
- set(cache["mapped_value"], "WARNING") where cache["value"] == "CAUTION"
Expand All @@ -873,7 +879,7 @@ processors:
- set(cache["value"], "spanValue")
- set(span_id.string, cache["value"]) where (cache != nil and cache["value"] != nil)
- delete_key(cache, "value") where (cache != nil and cache["value"] != nil)
- set(cache["value"], cache["__field_13"])
- set(cache["value"], cache["__field_14"])
- delete_key(cache, "__setif_value") where (cache != nil and cache["__setif_value"] != nil)
- set(cache["__setif_value"], cache["value"])
- replace_pattern(cache["__setif_value"], "^projects/([^/]*)/traces/", "")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -771,12 +771,15 @@ processors:
- delete_key(cache, "__field_10") where (cache != nil and cache["__field_10"] != nil)
- set(cache["__field_10"], body) where (body != nil)
- delete_key(cache, "__field_11") where (cache != nil and cache["__field_11"] != nil)
- set(cache["__field_11"], body["level"]) where (body != nil and body["level"] != nil)
- delete_key(cache, "__field_13") where (cache != nil and cache["__field_13"] != nil)
- set(cache["__field_13"], body["trace"]) where (body != nil and body["trace"] != nil)
- set(cache["__field_11"], body["op_id"]) where (body != nil and body["op_id"] != nil)
- delete_key(cache, "__field_12") where (cache != nil and cache["__field_12"] != nil)
- set(cache["__field_12"], body["level"]) where (body != nil and body["level"] != nil)
- delete_key(cache, "__field_14") where (cache != nil and cache["__field_14"] != nil)
- set(cache["__field_14"], body["trace"]) where (body != nil and body["trace"] != nil)
- set(cache["__omit_0"], false)
- set(cache["__omit_0"], true) where ((body != nil and body["omitted"] != nil) and IsMatch(body["omitted"], "(?i)^-$"))
- delete_key(body, "move_source") where (body != nil and body["move_source"] != nil)
- delete_key(body, "op_id") where (body != nil and body["op_id"] != nil)
- delete_key(body, "trace") where (body != nil and body["trace"] != nil)
- delete_key(cache, "value") where (cache != nil and cache["value"] != nil)
- set(cache["value"], cache["__field_0"])
Expand Down Expand Up @@ -818,6 +821,9 @@ processors:
- set(attributes["text"], cache["value"]) where (cache != nil and cache["value"] != nil)
- delete_key(cache, "value") where (cache != nil and cache["value"] != nil)
- set(cache["value"], cache["__field_11"])
- set(attributes["gcp.operation"]["id"], cache["value"]) where (cache != nil and cache["value"] != nil)
- delete_key(cache, "value") where (cache != nil and cache["value"] != nil)
- set(cache["value"], cache["__field_12"])
- delete_key(cache, "mapped_value") where (cache != nil and cache["mapped_value"] != nil)
- set(cache["mapped_value"], cache["value"]) where (cache != nil and cache["value"] != nil)
- set(cache["mapped_value"], "WARNING") where cache["value"] == "CAUTION"
Expand All @@ -829,7 +835,7 @@ processors:
- set(cache["value"], "spanValue")
- set(span_id.string, cache["value"]) where (cache != nil and cache["value"] != nil)
- delete_key(cache, "value") where (cache != nil and cache["value"] != nil)
- set(cache["value"], cache["__field_13"])
- set(cache["value"], cache["__field_14"])
- delete_key(cache, "__setif_value") where (cache != nil and cache["__setif_value"] != nil)
- set(cache["__setif_value"], cache["value"])
- replace_pattern(cache["__setif_value"], "^projects/([^/]*)/traces/", "")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -861,12 +861,15 @@ processors:
- delete_key(cache, "__field_10") where (cache != nil and cache["__field_10"] != nil)
- set(cache["__field_10"], body) where (body != nil)
- delete_key(cache, "__field_11") where (cache != nil and cache["__field_11"] != nil)
- set(cache["__field_11"], body["level"]) where (body != nil and body["level"] != nil)
- delete_key(cache, "__field_13") where (cache != nil and cache["__field_13"] != nil)
- set(cache["__field_13"], body["trace"]) where (body != nil and body["trace"] != nil)
- set(cache["__field_11"], body["op_id"]) where (body != nil and body["op_id"] != nil)
- delete_key(cache, "__field_12") where (cache != nil and cache["__field_12"] != nil)
- set(cache["__field_12"], body["level"]) where (body != nil and body["level"] != nil)
- delete_key(cache, "__field_14") where (cache != nil and cache["__field_14"] != nil)
- set(cache["__field_14"], body["trace"]) where (body != nil and body["trace"] != nil)
- set(cache["__omit_0"], false)
- set(cache["__omit_0"], true) where ((body != nil and body["omitted"] != nil) and IsMatch(body["omitted"], "(?i)^-$"))
- delete_key(body, "move_source") where (body != nil and body["move_source"] != nil)
- delete_key(body, "op_id") where (body != nil and body["op_id"] != nil)
- delete_key(body, "trace") where (body != nil and body["trace"] != nil)
- delete_key(cache, "value") where (cache != nil and cache["value"] != nil)
- set(cache["value"], cache["__field_0"])
Expand Down Expand Up @@ -908,6 +911,9 @@ processors:
- set(attributes["text"], cache["value"]) where (cache != nil and cache["value"] != nil)
- delete_key(cache, "value") where (cache != nil and cache["value"] != nil)
- set(cache["value"], cache["__field_11"])
- set(attributes["gcp.operation"]["id"], cache["value"]) where (cache != nil and cache["value"] != nil)
- delete_key(cache, "value") where (cache != nil and cache["value"] != nil)
- set(cache["value"], cache["__field_12"])
- delete_key(cache, "mapped_value") where (cache != nil and cache["mapped_value"] != nil)
- set(cache["mapped_value"], cache["value"]) where (cache != nil and cache["value"] != nil)
- set(cache["mapped_value"], "WARNING") where cache["value"] == "CAUTION"
Expand All @@ -919,7 +925,7 @@ processors:
- set(cache["value"], "spanValue")
- set(span_id.string, cache["value"]) where (cache != nil and cache["value"] != nil)
- delete_key(cache, "value") where (cache != nil and cache["value"] != nil)
- set(cache["value"], cache["__field_13"])
- set(cache["value"], cache["__field_14"])
- delete_key(cache, "__setif_value") where (cache != nil and cache["__setif_value"] != nil)
- set(cache["__setif_value"], cache["value"])
- replace_pattern(cache["__setif_value"], "^projects/([^/]*)/traces/", "")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -861,12 +861,15 @@ processors:
- delete_key(cache, "__field_10") where (cache != nil and cache["__field_10"] != nil)
- set(cache["__field_10"], body) where (body != nil)
- delete_key(cache, "__field_11") where (cache != nil and cache["__field_11"] != nil)
- set(cache["__field_11"], body["level"]) where (body != nil and body["level"] != nil)
- delete_key(cache, "__field_13") where (cache != nil and cache["__field_13"] != nil)
- set(cache["__field_13"], body["trace"]) where (body != nil and body["trace"] != nil)
- set(cache["__field_11"], body["op_id"]) where (body != nil and body["op_id"] != nil)
- delete_key(cache, "__field_12") where (cache != nil and cache["__field_12"] != nil)
- set(cache["__field_12"], body["level"]) where (body != nil and body["level"] != nil)
- delete_key(cache, "__field_14") where (cache != nil and cache["__field_14"] != nil)
- set(cache["__field_14"], body["trace"]) where (body != nil and body["trace"] != nil)
- set(cache["__omit_0"], false)
- set(cache["__omit_0"], true) where ((body != nil and body["omitted"] != nil) and IsMatch(body["omitted"], "(?i)^-$"))
- delete_key(body, "move_source") where (body != nil and body["move_source"] != nil)
- delete_key(body, "op_id") where (body != nil and body["op_id"] != nil)
- delete_key(body, "trace") where (body != nil and body["trace"] != nil)
- delete_key(cache, "value") where (cache != nil and cache["value"] != nil)
- set(cache["value"], cache["__field_0"])
Expand Down Expand Up @@ -908,6 +911,9 @@ processors:
- set(attributes["text"], cache["value"]) where (cache != nil and cache["value"] != nil)
- delete_key(cache, "value") where (cache != nil and cache["value"] != nil)
- set(cache["value"], cache["__field_11"])
- set(attributes["gcp.operation"]["id"], cache["value"]) where (cache != nil and cache["value"] != nil)
- delete_key(cache, "value") where (cache != nil and cache["value"] != nil)
- set(cache["value"], cache["__field_12"])
- delete_key(cache, "mapped_value") where (cache != nil and cache["mapped_value"] != nil)
- set(cache["mapped_value"], cache["value"]) where (cache != nil and cache["value"] != nil)
- set(cache["mapped_value"], "WARNING") where cache["value"] == "CAUTION"
Expand All @@ -919,7 +925,7 @@ processors:
- set(cache["value"], "spanValue")
- set(span_id.string, cache["value"]) where (cache != nil and cache["value"] != nil)
- delete_key(cache, "value") where (cache != nil and cache["value"] != nil)
- set(cache["value"], cache["__field_13"])
- set(cache["value"], cache["__field_14"])
- delete_key(cache, "__setif_value") where (cache != nil and cache["__setif_value"] != nil)
- set(cache["__setif_value"], cache["value"])
- replace_pattern(cache["__setif_value"], "^projects/([^/]*)/traces/", "")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,8 @@ logging:
static_value: spanValue
trace:
move_from: jsonPayload.trace
operation.id:
move_from: jsonPayload.op_id
service:
experimental_otel_logging: true
pipelines:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -850,6 +850,12 @@ processors:
- set(cache["value"], cache["__field_0"])
- set(attributes["gcp.log_name"], cache["value"]) where (cache != nil and cache["value"] != nil)
- delete_key(cache, "__field_0") where (cache != nil and cache["__field_0"] != nil)
- set(cache["__field_0"], body["logging.googleapis.com/operation"]) where (body != nil and body["logging.googleapis.com/operation"] != nil)
- delete_key(body, "logging.googleapis.com/operation") where (body != nil and body["logging.googleapis.com/operation"] != nil)
- delete_key(cache, "value") where (cache != nil and cache["value"] != nil)
- set(cache["value"], cache["__field_0"])
- set(attributes["gcp.operation"], cache["value"]) where (cache != nil and cache["value"] != nil)
- delete_key(cache, "__field_0") where (cache != nil and cache["__field_0"] != nil)
- set(cache["__field_0"], body["logging.googleapis.com/severity"]) where (body != nil and body["logging.googleapis.com/severity"] != nil)
- delete_key(body, "logging.googleapis.com/severity") where (body != nil and body["logging.googleapis.com/severity"] != nil)
- delete_key(cache, "value") where (cache != nil and cache["value"] != nil)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -806,6 +806,12 @@ processors:
- set(cache["value"], cache["__field_0"])
- set(attributes["gcp.log_name"], cache["value"]) where (cache != nil and cache["value"] != nil)
- delete_key(cache, "__field_0") where (cache != nil and cache["__field_0"] != nil)
- set(cache["__field_0"], body["logging.googleapis.com/operation"]) where (body != nil and body["logging.googleapis.com/operation"] != nil)
- delete_key(body, "logging.googleapis.com/operation") where (body != nil and body["logging.googleapis.com/operation"] != nil)
- delete_key(cache, "value") where (cache != nil and cache["value"] != nil)
- set(cache["value"], cache["__field_0"])
- set(attributes["gcp.operation"], cache["value"]) where (cache != nil and cache["value"] != nil)
- delete_key(cache, "__field_0") where (cache != nil and cache["__field_0"] != nil)
- set(cache["__field_0"], body["logging.googleapis.com/severity"]) where (body != nil and body["logging.googleapis.com/severity"] != nil)
- delete_key(body, "logging.googleapis.com/severity") where (body != nil and body["logging.googleapis.com/severity"] != nil)
- delete_key(cache, "value") where (cache != nil and cache["value"] != nil)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -896,6 +896,12 @@ processors:
- set(cache["value"], cache["__field_0"])
- set(attributes["gcp.log_name"], cache["value"]) where (cache != nil and cache["value"] != nil)
- delete_key(cache, "__field_0") where (cache != nil and cache["__field_0"] != nil)
- set(cache["__field_0"], body["logging.googleapis.com/operation"]) where (body != nil and body["logging.googleapis.com/operation"] != nil)
- delete_key(body, "logging.googleapis.com/operation") where (body != nil and body["logging.googleapis.com/operation"] != nil)
- delete_key(cache, "value") where (cache != nil and cache["value"] != nil)
- set(cache["value"], cache["__field_0"])
- set(attributes["gcp.operation"], cache["value"]) where (cache != nil and cache["value"] != nil)
- delete_key(cache, "__field_0") where (cache != nil and cache["__field_0"] != nil)
- set(cache["__field_0"], body["logging.googleapis.com/severity"]) where (body != nil and body["logging.googleapis.com/severity"] != nil)
- delete_key(body, "logging.googleapis.com/severity") where (body != nil and body["logging.googleapis.com/severity"] != nil)
- delete_key(cache, "value") where (cache != nil and cache["value"] != nil)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -896,6 +896,12 @@ processors:
- set(cache["value"], cache["__field_0"])
- set(attributes["gcp.log_name"], cache["value"]) where (cache != nil and cache["value"] != nil)
- delete_key(cache, "__field_0") where (cache != nil and cache["__field_0"] != nil)
- set(cache["__field_0"], body["logging.googleapis.com/operation"]) where (body != nil and body["logging.googleapis.com/operation"] != nil)
- delete_key(body, "logging.googleapis.com/operation") where (body != nil and body["logging.googleapis.com/operation"] != nil)
- delete_key(cache, "value") where (cache != nil and cache["value"] != nil)
- set(cache["value"], cache["__field_0"])
- set(attributes["gcp.operation"], cache["value"]) where (cache != nil and cache["value"] != nil)
- delete_key(cache, "__field_0") where (cache != nil and cache["__field_0"] != nil)
- set(cache["__field_0"], body["logging.googleapis.com/severity"]) where (body != nil and body["logging.googleapis.com/severity"] != nil)
- delete_key(body, "logging.googleapis.com/severity") where (body != nil and body["logging.googleapis.com/severity"] != nil)
- delete_key(cache, "value") where (cache != nil and cache["value"] != nil)
Expand Down
Loading
Loading