Slackbot
06/22/2023, 5:19 AMHarald Fielker
06/22/2023, 5:20 AMHarald Fielker
06/22/2023, 5:20 AMHarald Fielker
06/22/2023, 5:20 AMconfig:
processors:
logstransform/internal:
operators:
- type: trace_parser ## doesn't work
if: '"level" in body'
method:
parse_from: body.level
- type: json_parser ## doesn't work
if: '"level" in body'
method:
parse_from: body.level
Harald Fielker
06/22/2023, 5:20 AMHarald Fielker
06/22/2023, 5:21 AMk8s-infra:
presets:
logsCollection:
operators:
- type: json_parser ## doesn't work
if: '"level" in body'
method:
parse_from: body.level
Harald Fielker
06/22/2023, 5:21 AMHarald Fielker
06/22/2023, 5:21 AMError: failed to get config: cannot unmarshal the configuration: 1 error(s) decoding:
* error decoding 'processors': error reading configuration for "logstransform/internal": 1 error(s) decoding:
* error decoding 'operators[0]': unmarshal to trace_parser: 1 error(s) decoding:
* '' has invalid keys: method
2023/06/22 05:18:33 application run finished with error: failed to get config: cannot unmarshal the configuration: 1 error(s) decoding:
* error decoding 'processors': error reading configuration for "logstransform/internal": 1 error(s) decoding:
* error decoding 'operators[0]': unmarshal to trace_parser: 1 error(s) decoding:
* '' has invalid keys: method
Pranay
Harald Fielker
06/22/2023, 5:22 AMHarald Fielker
06/22/2023, 5:23 AMnitya-signoz
06/22/2023, 7:00 AMlogstransform/parse_json:
operators:
- default: noop
id: router_signoz
routes:
- expr: 'body matches "^{.*}$"'
output: parse_json
type: router
- id: parse_json
type: json_parser
parse_from: body
parse_to: attributes.temp
output: trace_parse
- type: trace_parser
id: trace_parse
trace_id:
parse_from: attributes.temp.traceId
span_id:
parse_from: attributes.temp.spanId
output: move_message
- type: move
id: move_message
from: attributes.temp.message
to: attributes.message
if: "'message' in attributes.temp"
output: move_enduserid
- type: move
id: move_enduserid
from: attributes.temp.extra.endUserId
if: "'extra' in attributes.temp and 'endUserId' in attributes.temp.extra"
to: attributes.endUserId
output: remove
- id: remove
type: remove
field: attributes.temp
output: noop
- id: noop
type: noop
Harald Fielker
06/22/2023, 7:01 AMnitya-signoz
06/22/2023, 7:02 AMHarald Fielker
06/22/2023, 7:02 AMnitya-signoz
06/22/2023, 7:03 AMnitya-signoz
06/22/2023, 7:03 AMHarald Fielker
06/22/2023, 7:03 AMnitya-signoz
06/22/2023, 7:04 AMtrace_parse
and move_enduserid
will change and the other parts will remain sameHarald Fielker
06/22/2023, 8:05 AM{
"account_id": "xxx",
"level": "info",
"message": "my message",
...
}
Harald Fielker
06/22/2023, 8:07 AMHarald Fielker
06/22/2023, 8:07 AM# parse body as json to tmp
- id: parse_json
type: json_parser
parse_from: body
parse_to: attributes.temp
output: trace_parse
# parse trace id
- type: trace_parser
id: trace_parse
trace_id:
parse_from: attributes.temp.traceId
span_id:
parse_from: attributes.temp.spanId
output: move_message
# check if account_id attribute exist and move it to the attributes
- type: move
id: move_message
from: attributes.temp.account_id
to: attributes.account_id
if: "'account_id' in attributes.temp"
output: move_account_id
# remove tmp
- type: move
id: move_account_id
from: attributes.temp.account_id
if: "'account_id' in attributes.temp"
to: attributes.account_id
output: remove
Harald Fielker
06/22/2023, 8:07 AMHarald Fielker
06/22/2023, 8:08 AMnitya-signoz
06/22/2023, 8:30 AMtrace_parse
operator and move_message
operatorHarald Fielker
06/22/2023, 8:30 AMaccountId
instead of account_id
Harald Fielker
06/22/2023, 8:31 AMHarald Fielker
06/22/2023, 8:31 AMHarald Fielker
06/22/2023, 8:31 AMHarald Fielker
06/22/2023, 8:31 AMHarald Fielker
06/22/2023, 8:31 AM- type: trace_parser
id: trace_parse
trace_id:
parse_from: attributes.temp.traceId
Harald Fielker
06/22/2023, 8:31 AMHarald Fielker
06/22/2023, 8:32 AMHarald Fielker
06/22/2023, 8:32 AM- type: move
id: move_enduserid
from: attributes.temp.extra.endUserId
if: "'extra' in attributes.temp and 'endUserId' in attributes.temp.extra"
to: attributes.endUserId
output: remove
Harald Fielker
06/22/2023, 8:32 AMHarald Fielker
06/22/2023, 8:32 AMHarald Fielker
06/22/2023, 8:33 AMnitya-signoz
06/22/2023, 8:34 AMendUserId
is an attribute specific to my log structureHarald Fielker
06/22/2023, 8:35 AMHarald Fielker
06/22/2023, 8:35 AMnitya-signoz
06/22/2023, 8:36 AMHarald Fielker
06/22/2023, 8:36 AMnitya-signoz
06/22/2023, 8:37 AMHarald Fielker
06/22/2023, 8:38 AMHarald Fielker
06/22/2023, 8:41 AMHarald Fielker
06/22/2023, 8:41 AMnitya-signoz
06/22/2023, 8:42 AMHarald Fielker
06/22/2023, 8:44 AM{
...
"level": "debug",
...
}
Harald Fielker
06/22/2023, 8:44 AMoperators:
# match for a body in json type
- default: noop
id: router_signoz
routes:
- expr: 'body matches "^{.*}$"'
output: parse_json
type: router
# parse body as json to tmp
- id: parse_json
type: json_parser
parse_from: body
parse_to: attributes.temp
output: trace_parse
# parse trace id
- type: trace_parser
id: trace_parse
trace_id:
parse_from: attributes.temp.traceId
span_id:
parse_from: attributes.temp.spanId
output: move_level
# check if level attribute exist and move it to the attributes
- type: move
id: move_level
from: attributes.temp.level
to: attributes.level
if: "'level' in attributes.temp"
output: remove
# remove temp
- id: remove
type: remove
field: attributes.temp
output: noop
- id: noop
type: noop
Harald Fielker
06/22/2023, 8:46 AMnitya-signoz
06/22/2023, 8:46 AMHarald Fielker
06/22/2023, 8:47 AMHarald Fielker
06/22/2023, 8:47 AMHarald Fielker
06/22/2023, 8:49 AMTASK [k8s_install_signoz : waiting for frontend pod to become ready (max 30m - can be a bit unstable)]
But I don't want to open this can of worms, too 🎉🎉nitya-signoz
06/22/2023, 8:50 AMHarald Fielker
06/22/2023, 8:51 AMHarald Fielker
06/22/2023, 8:52 AMhelm install ... -f myvalues.yaml
Harald Fielker
06/22/2023, 8:52 AMHarald Fielker
06/22/2023, 8:53 AMnitya-signoz
06/22/2023, 8:53 AMHarald Fielker
06/22/2023, 8:55 AMHarald Fielker
06/22/2023, 8:55 AMfrontend:
ingress:
enabled: true
className: traefik
hosts:
- host: "signoz.{{ domain }}"
paths:
- path: /
pathType: ImplementationSpecific
port: 3301
annotations:
<http://traefik.ingress.kubernetes.io/router.entrypoints|traefik.ingress.kubernetes.io/router.entrypoints>: websecure
tls:
- secretName: "{{ cluster_name }}-{{ domain_name | replace('.','-') }}-wildcard-tls"
nitya-signoz
06/22/2023, 8:57 AMnitya-signoz
06/22/2023, 8:57 AMHarald Fielker
06/22/2023, 8:57 AM[k8s_install_signoz : waiting for frontend pod to become ready (max 30m - can be a bit unstable)]
Harald Fielker
06/22/2023, 8:58 AMHarald Fielker
06/22/2023, 9:07 AM{
"level": "info",
"message": "xxx"
}
Harald Fielker
06/22/2023, 9:08 AMHarald Fielker
06/22/2023, 9:09 AMHarald Fielker
06/22/2023, 9:10 AMhelm show values signoz/signoz | grep 'logstransform/parse_json'
has no entriesHarald Fielker
06/22/2023, 9:11 AM$ helm show values signoz/signoz | grep 'logstransform/internal'
logstransform/internal:
processors: [logstransform/internal, batch]
Harald Fielker
06/22/2023, 9:11 AMHarald Fielker
06/22/2023, 9:12 AMHarald Fielker
06/22/2023, 9:12 AMHarald Fielker
06/22/2023, 9:17 AMHarald Fielker
06/22/2023, 9:17 AMnitya-signoz
06/22/2023, 9:17 AMHarald Fielker
06/22/2023, 9:18 AMnitya-signoz
06/22/2023, 9:18 AMHarald Fielker
06/22/2023, 9:18 AMHarald Fielker
06/22/2023, 9:19 AMHarald Fielker
06/22/2023, 9:22 AMHarald Fielker
06/22/2023, 9:28 AMPranay
I will write a short article how to set this up.@Harald Fielker that would be very helpful. Please share it with the community also after you have written the guide
Harald Fielker
06/22/2023, 12:36 PMHarald Fielker
06/22/2023, 12:46 PM[k8s_install_signoz : waiting for frontend pod to become ready (max 30m - can be a bit unstable)]
Harald Fielker
06/22/2023, 12:46 PMHarald Fielker
06/22/2023, 12:46 PMHarald Fielker
06/22/2023, 12:46 PMHarald Fielker
06/22/2023, 1:05 PM* '' has invalid keys: pipeline
Harald Fielker
06/22/2023, 1:05 PMHarald Fielker
06/22/2023, 1:05 PMnitya-signoz
06/22/2023, 1:09 PMHarald Fielker
06/22/2023, 1:10 PMPrashant Shahi
06/22/2023, 2:36 PM@Harald Fielker In which component are you getting this error? also, could you share your complete override-values.yaml?* '' has invalid keys: pipeline
Harald Fielker
06/22/2023, 2:37 PMHarald Fielker
06/22/2023, 2:37 PMHarald Fielker
06/22/2023, 2:39 PMHarald Fielker
06/22/2023, 2:39 PMHarald Fielker
06/22/2023, 2:39 PMHarald Fielker
06/22/2023, 2:39 PMPrashant Shahi
06/22/2023, 2:40 PMPrashant Shahi
06/22/2023, 2:40 PMHarald Fielker
06/22/2023, 2:43 PMHarald Fielker
06/22/2023, 2:43 PMHarald Fielker
06/22/2023, 2:44 PMotelCollector:
config:
processors:
logstransform/internal:
operators:
....
Harald Fielker
06/22/2023, 2:44 PMPrashant Shahi
06/22/2023, 2:45 PMHarald Fielker
06/22/2023, 2:45 PMHarald Fielker
06/22/2023, 2:46 PMPrashant Shahi
06/22/2023, 2:47 PMotelCollector
?Prashant Shahi
06/22/2023, 2:48 PMPrashant Shahi
06/22/2023, 2:48 PMpresets
sectionHarald Fielker
06/22/2023, 2:48 PMPrashant Shahi
06/22/2023, 2:48 PMHarald Fielker
06/22/2023, 2:49 PMotelCollector
?
^^^ i am asking for a solution here for 3 month 🙂 I love opensource this turns out very time burning. And I know it's a tiny thing.Harald Fielker
06/22/2023, 2:49 PMHarald Fielker
06/22/2023, 2:50 PMHarald Fielker
06/22/2023, 2:50 PMHarald Fielker
06/22/2023, 2:51 PMHarald Fielker
06/22/2023, 2:51 PMHarald Fielker
06/22/2023, 2:52 PMPrashant Shahi
06/22/2023, 2:58 PMPrashant Shahi
06/22/2023, 2:59 PMHarald Fielker
06/22/2023, 2:59 PMHarald Fielker
06/22/2023, 3:00 PMHarald Fielker
06/22/2023, 3:00 PMHarald Fielker
06/22/2023, 3:00 PMPrashant Shahi
06/22/2023, 3:00 PMHarald Fielker
06/22/2023, 3:00 PMHarald Fielker
06/22/2023, 3:01 PMHarald Fielker
06/22/2023, 3:01 PMPrashant Shahi
06/22/2023, 3:01 PMPrashant Shahi
06/22/2023, 3:01 PMHarald Fielker
06/22/2023, 3:02 PMHarald Fielker
06/22/2023, 3:02 PMHarald Fielker
06/22/2023, 3:02 PMHarald Fielker
06/22/2023, 3:02 PMHarald Fielker
06/22/2023, 3:03 PMHarald Fielker
06/22/2023, 3:03 PMnitya-signoz
06/22/2023, 3:04 PMHarald Fielker
06/22/2023, 3:04 PMPrashant Shahi
06/22/2023, 3:05 PMotelCollector.config
is not the right place for it, is it?Prashant Shahi
06/22/2023, 3:06 PMk8s-infra.otelAgent.config
Harald Fielker
06/22/2023, 3:06 PM- extract:
- from: body
- json_fields
- a
- a
- c
- to: attributes
Harald Fielker
06/22/2023, 3:06 PMHarald Fielker
06/22/2023, 3:07 PMnitya-signoz
06/22/2023, 3:08 PMPrashant Shahi
06/22/2023, 3:09 PMPrashant Shahi
06/22/2023, 3:13 PMconfig.service.pipelines.log
Prashant Shahi
06/22/2023, 3:14 PMHarald Fielker
06/22/2023, 3:14 PMPrashant Shahi
06/22/2023, 3:15 PMkind
.
We use it extensively.Harald Fielker
06/22/2023, 3:15 PMHarald Fielker
06/22/2023, 3:15 PMHarald Fielker
06/22/2023, 3:15 PMHarald Fielker
06/23/2023, 9:40 AMHarald Fielker
06/23/2023, 9:40 AMHarald Fielker
06/23/2023, 9:40 AMHarald Fielker
06/23/2023, 9:40 AMHarald Fielker
06/23/2023, 9:41 AMHarald Fielker
06/23/2023, 9:41 AMHarald Fielker
06/23/2023, 9:42 AMHarald Fielker
06/26/2023, 10:25 AMHarald Fielker
06/26/2023, 10:25 AMPranay
Harald Fielker
06/26/2023, 4:36 PMHarald Fielker
06/26/2023, 4:36 PMHarald Fielker
06/26/2023, 4:37 PMHarald Fielker
06/26/2023, 4:37 PMHarald Fielker
06/26/2023, 4:38 PMPranay
Harald Fielker
06/27/2023, 12:55 PMHarald Fielker
06/27/2023, 12:56 PMHarald Fielker
06/27/2023, 12:56 PMHarald Fielker
06/28/2023, 6:42 AMHarald Fielker
06/28/2023, 6:42 AMPrashant Shahi
06/28/2023, 2:40 PMPrashant Shahi
06/28/2023, 4:28 PMlogtransform
processor over OtelAgent, but it seems like that processor is not part of the OpenTelemetry Contrib distribution but SigNoz OtelCollector.
https://github.com/open-telemetry/opentelemetry-collector-contrib/tree/main/processor/logstransformprocessor#logs-transform-processorPrashant Shahi
06/28/2023, 4:29 PMWant 1
, you can do it using the override-values.yaml
below:
k8s-infra:
presets:
logsCollection:
blacklist:
namespaces:
- default
- kube-node-lease
- kube-public
- kube-system
- local-path-storage
- platform
# we only want this
#- the-app
otelCollector:
config:
processors:
logstransform/custom:
operators:
# match for a body in json type
- default: noop
id: router_signoz
routes:
- expr: 'body matches "^{.*}$"'
output: parse_json
type: router
# parse body as json to tmp
- id: parse_json
type: json_parser
parse_from: body
parse_to: attributes.temp
output: trace_parse
# parse trace id
- type: trace_parser
id: trace_parse
trace_id:
parse_from: attributes.temp.traceId
span_id:
parse_from: attributes.temp.spanId
output: move_level
# check if level attribute exist and move it to the attributes
- type: move
id: move_level
from: attributes.temp.level
to: attributes.level
if: "'level' in attributes.temp"
output: add_database
# add database resource from body
- type: add
id: add_database
field: resource.database
value: EXPR(attributes.temp.database)
output: remove
# remove temp
- id: remove
type: remove
field: attributes.temp
output: noop
# done
- id: noop
type: noop
service:
pipelines:
logs:
receivers: [otlp]
processors: [logstransform/internal, logstransform/custom, batch]
exporters: [clickhouselogsexporter]
Prashant Shahi
06/28/2023, 4:30 PM``` - type: add
id: add_database
field: resource.database
value: EXPR(attributes.temp.database)
output: remove```That is for
database
, you could do the same for other data.Prashant Shahi
06/28/2023, 4:31 PMWant 2
, it helps to have K8s cluster with enough resources.Prashant Shahi
06/29/2023, 6:44 AMHarald Fielker
06/29/2023, 6:44 AMHarald Fielker
06/29/2023, 6:45 AMwant 2
I hope that's a jokeHarald Fielker
06/29/2023, 6:45 AMHarald Fielker
06/29/2023, 6:45 AMHarald Fielker
06/29/2023, 6:46 AMPrashant Shahi
06/29/2023, 6:47 AMHarald Fielker
06/29/2023, 6:47 AMwhile ! nc -z localhost 8080; do
sleep 0.1 # wait for 1/10 of the second before check again
done
Harald Fielker
06/29/2023, 6:48 AMHarald Fielker
06/29/2023, 6:48 AMHarald Fielker
06/29/2023, 6:48 AMHarald Fielker
06/29/2023, 6:51 AMPrashant Shahi
06/29/2023, 6:51 AMPrashant Shahi
06/29/2023, 6:53 AM```helm install my-release signoz/signoz -n platform \
--wait \
--timeout 10m0s \
...```^ this has been working out fine for us
Harald Fielker
06/29/2023, 6:56 AMPrashant Shahi
06/29/2023, 6:57 AMthere is a race condition in your softwareappreciate your report, will look into it
Harald Fielker
06/29/2023, 6:57 AMinstall-signoz: helm-prepare
kubectl create ns platform
helm --namespace platform install my-release signoz/signoz -f ./values.yaml
sleep 30
@echo waiting until frontend pod is ready... this is sometimes super unstable and needs to be fixed!
kubectl -n platform wait --for=condition=ready \
pod -l "<http://app.kubernetes.io/component=frontend|app.kubernetes.io/component=frontend>" --timeout=30m
Harald Fielker
06/29/2023, 6:57 AMHarald Fielker
06/29/2023, 6:57 AMHarald Fielker
06/29/2023, 6:58 AMHarald Fielker
06/29/2023, 6:58 AMHarald Fielker
06/29/2023, 6:58 AMHarald Fielker
06/29/2023, 7:00 AMHarald Fielker
08/24/2023, 11:06 AMHarald Fielker
08/24/2023, 11:06 AMHarald Fielker
08/24/2023, 11:07 AM{% for item in attributes %}
- type: move
id: move_{{ item }}
from: attributes.temp.{{ item }}
to: attributes.{{ item }}
if: "'{{ item }}' in attributes.temp"
{% endfor %}