I found SigNoz today and I've been trying it out :...
# general
h
I found SigNoz today and I've been trying it out ­čÖé One thing that I am having some trouble with is adding the spanId and traceId to the log entries. I've got an app running on Ruby on Rails and I've instrumented it with otel and everything is hunky dory. I've also got the applicat log file being sent across to SigNoz using rsyslog. However, if I send the log entries as plain text, even if it does contain the spanid and traceid, they do not appear in the json data structure for the log entries. If I try to send the log as JSON via rsyslog, I get no entries whatsoever. I have a couple of questions: 1. Should I be using rsyslog for this, or is there a better way to send log entries from the application to SigNoz? 2. If I should, should I be using a regex parser operator in the syslog entry of the otel-collector-config? 3. Is there a better/easier way?
n
Hi there Hannes! So great to see that you're trying out SigNoz. I'm new to the team and not certain of the best way to get some structure out of a plaintext log. It's 4am for the rest of the team right now so I'll see what they say in a few hours ­čÖé
h
I managed to get this done with a combination of
regex_parser
& `key_value_parser`:
Copy code
logstransform/internal:
     operators:
       - type: regex_parser
         regex: 'trace_id=(?P<trace_id>\S*)'
       - type: key_value_parser
        parse_to: attributes
       - type: regex_parser
         regex: 'span_id=(?P<span_id>\S*)'
       - type: key_value_parser
         parse_to: attributes