Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support TCP application logs in lagoon-logging #661

Open
tobybellwood opened this issue May 21, 2024 · 1 comment
Open

Support TCP application logs in lagoon-logging #661

tobybellwood opened this issue May 21, 2024 · 1 comment

Comments

@tobybellwood
Copy link
Member

lagoon-logging currently supports UDP for application logs.

In order to support more logging transports more easily (such as Winston, Pino etc), we should also accept TCP logs on a separate port

@smlx
Copy link
Member

smlx commented May 21, 2024

I took a look at the docs. fluentd JSON parser expects one object per line (newline delimited). This is configurable but the default is simplest.

So adding a port on the statefulset:

        - containerPort: 5140
          protocol: TCP
          name: application_tcp

The service:

  - name: application_tcp
    port: 5140
    protocol: TCP
    targetPort: application_tcp

And a snippet like this to the fluent config should do the trick (totally untested):

    <source>
      @type  tcp
      @id    in_application_tcp
      tag    "lagoon.#{ENV['CLUSTER_NAME']}.application"
      port   5140
      <parse>
        @type json
      </parse>
    </source>

And then we need to document how to get logs there in the right format. And note that if you don't escape newlines (so a line has half a JSON object), the log message will be dropped.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants