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

Feature request: Include tags when sending JSON logs #7356

Closed
Tracked by #8010 ...
alubbock opened this issue Jun 11, 2023 · 9 comments · Fixed by #8524
Closed
Tracked by #8010 ...

Feature request: Include tags when sending JSON logs #7356

alubbock opened this issue Jun 11, 2023 · 9 comments · Fixed by #8524
Assignees

Comments

@alubbock
Copy link
Contributor

Feature Request

Description

Add a talos-node or hostname field to the service and kernel logs when sending them over TCP or UDP using json_lines.

The Talos docs describe how to send logs e.g. to Loki using Fluent-bit. When logs from many nodes are sent to a centralised endpoint, there's no way to tell which node kernel and service logs came from. Adding a field with the node's name would solve this.

@smira
Copy link
Member

smira commented Jun 12, 2023

This was discussed I believe couple of times, the issue here is that Talos doesn't know it's hostname until it gets actually assigned, and the hostname might change during the boot process. Any centralized logging solution has an idea of the source IP of the log sender, so it could use that to attach proper labels to the logs.

So if implemented, this would look more like "attach the hostname to the logs when known" or something like that.

@sergelogvinov
Copy link
Contributor

Probably, we need to add custom key/value to json.

destinations:
    - endpoint: tcp://1.2.3.4:12345 # Where to send logs. Supported protocols are "tcp" and "udp".
      format: json_lines
      tags:
         custom_name: custom_value

@zystem
Copy link

zystem commented Jan 18, 2024

Any centralized logging solution has an idea of the source IP of the log sender, so it could use that to attach proper labels to the logs.

You absolutely do not right.

  1. There are many ways to lose the source IP address (NAT, cilium)
  2. Many popular logging solutions cannot extend data with source IP at all (filebeat, fluent-bit for example)
  3. Best practices in logging say that logs should be extended with source IP by the sender (syslog standard for example)
  4. As for me there is no problem with adding IP instead of hostname. But there should be some field allowing to separation of logs from different nodes.

@smira smira changed the title Feature request: Include node name when sending JSON logs Feature request: Include tags when sending JSON logs Mar 18, 2024
@smira
Copy link
Member

smira commented Mar 21, 2024

So what we need to implement is #7356 (comment)

@zystem
Copy link

zystem commented Mar 21, 2024

So what we need to implement is #7356 (comment)

In this case, tags should support dynamic variables. For example IP can be received from DHCP and support of environment variable can be not enough. IP tag should reflect current IP status.

@smira
Copy link
Member

smira commented Mar 21, 2024

IP is not defined for Talos in a stable way - it might change, while log identifier should be static.

@alubbock
Copy link
Contributor Author

IP is not defined for Talos in a stable way - it might change, while log identifier should be static.

Would system UUID make a good identifier for this purpose (node disambiguation)? Users can check with:
talosctl read /sys/class/dmi/id/product_uuid

@frezbo
Copy link
Member

frezbo commented Mar 22, 2024

IP is not defined for Talos in a stable way - it might change, while log identifier should be static.

Would system UUID make a good identifier for this purpose (node disambiguation)? Users can check with: talosctl read /sys/class/dmi/id/product_uuid

not really, we have seen many systems that just have this as all zeroes

@smira
Copy link
Member

smira commented Mar 22, 2024

plus Talos supports overriding UUID, it might not be available, etc.

Log sending should be robust, so we should keep it absolutely simple.

@smira smira self-assigned this Apr 1, 2024
smira added a commit to smira/talos that referenced this issue Apr 1, 2024
Fixes siderolabs#7356

Signed-off-by: Andrey Smirnov <andrey.smirnov@siderolabs.com>
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jun 5, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants