feature/logtail: pull logtail + netlog out to modular features

Removes 434 KB from the minimal Linux binary, or ~3%.

Primarily this comes from not linking in the zstd encoding code.

Fixes #17323

Change-Id: I0a90de307dfa1ad7422db7aa8b1b46c782bfaaf7
Signed-off-by: Brad Fitzpatrick <bradfitz@tailscale.com>
This commit is contained in:
Brad Fitzpatrick
2025-09-28 10:57:22 -07:00
committed by Brad Fitzpatrick
parent e466488a2a
commit 11b770fbc9
19 changed files with 240 additions and 77 deletions

View File

@@ -0,0 +1,13 @@
// Copyright (c) Tailscale Inc & AUTHORS
// SPDX-License-Identifier: BSD-3-Clause
// Code generated by gen.go; DO NOT EDIT.
//go:build ts_omit_logtail
package buildfeatures
// HasLogTail is whether the binary was built with support for modular feature "upload logs to log.tailscale.com (debug logs for bug reports and also by network flow logs if enabled)".
// Specifically, it's whether the binary was NOT built with the "ts_omit_logtail" build tag.
// It's a const so it can be used for dead code elimination.
const HasLogTail = false

View File

@@ -0,0 +1,13 @@
// Copyright (c) Tailscale Inc & AUTHORS
// SPDX-License-Identifier: BSD-3-Clause
// Code generated by gen.go; DO NOT EDIT.
//go:build !ts_omit_logtail
package buildfeatures
// HasLogTail is whether the binary was built with support for modular feature "upload logs to log.tailscale.com (debug logs for bug reports and also by network flow logs if enabled)".
// Specifically, it's whether the binary was NOT built with the "ts_omit_logtail" build tag.
// It's a const so it can be used for dead code elimination.
const HasLogTail = true

View File

@@ -0,0 +1,13 @@
// Copyright (c) Tailscale Inc & AUTHORS
// SPDX-License-Identifier: BSD-3-Clause
// Code generated by gen.go; DO NOT EDIT.
//go:build ts_omit_netlog
package buildfeatures
// HasNetLog is whether the binary was built with support for modular feature "Network flow logging support".
// Specifically, it's whether the binary was NOT built with the "ts_omit_netlog" build tag.
// It's a const so it can be used for dead code elimination.
const HasNetLog = false

View File

@@ -0,0 +1,13 @@
// Copyright (c) Tailscale Inc & AUTHORS
// SPDX-License-Identifier: BSD-3-Clause
// Code generated by gen.go; DO NOT EDIT.
//go:build !ts_omit_netlog
package buildfeatures
// HasNetLog is whether the binary was built with support for modular feature "Network flow logging support".
// Specifically, it's whether the binary was NOT built with the "ts_omit_netlog" build tag.
// It's a const so it can be used for dead code elimination.
const HasNetLog = true

View File

@@ -115,7 +115,11 @@ var Features = map[FeatureTag]FeatureMeta{
"iptables": {"IPTables", "Linux iptables support", nil},
"kube": {"Kube", "Kubernetes integration", nil},
"linuxdnsfight": {"LinuxDNSFight", "Linux support for detecting DNS fights (inotify watching of /etc/resolv.conf)", nil},
"oauthkey": {"OAuthKey", "OAuth secret-to-authkey resolution support", nil},
"logtail": {
Sym: "LogTail",
Desc: "upload logs to log.tailscale.com (debug logs for bug reports and also by network flow logs if enabled)",
},
"oauthkey": {"OAuthKey", "OAuth secret-to-authkey resolution support", nil},
"outboundproxy": {
Sym: "OutboundProxy",
Desc: "Outbound localhost HTTP/SOCK5 proxy support",
@@ -123,7 +127,12 @@ var Features = map[FeatureTag]FeatureMeta{
},
"portlist": {"PortList", "Optionally advertise listening service ports", nil},
"portmapper": {"PortMapper", "NAT-PMP/PCP/UPnP port mapping support", nil},
"netstack": {"Netstack", "gVisor netstack (userspace networking) support", nil},
"netlog": {
Sym: "NetLog",
Desc: "Network flow logging support",
Deps: []FeatureTag{"logtail"},
},
"netstack": {"Netstack", "gVisor netstack (userspace networking) support", nil},
"networkmanager": {
Sym: "NetworkManager",
Desc: "Linux NetworkManager integration",