-
Notifications
You must be signed in to change notification settings - Fork 0
chore: upstream rebase #153
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
Changes from all commits
3254ce1
bcbb471
85208c9
0f55c4a
36d7f25
6b15ef1
6d9279e
f7a2da8
a0f10d4
eb43dc0
b349fee
7937399
0099b5f
ee83bcd
d29d9ed
94fcaf7
4fe3e12
73630f0
3888932
c7d5d32
c71a416
10c481d
b3c097c
74cbc6c
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| 0::/lxc.payload.first/system.slice/systemd-logind.service |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -298,12 +298,12 @@ func (c *Container) Collect(ch chan<- prometheus.Metric) { | |
| if disks, err := node.GetDisks(); err == nil { | ||
| ioStat := c.cgroup.IOStat() | ||
| for majorMinor, mounts := range c.getMounts() { | ||
| dev := disks.GetParentBlockDevice(majorMinor) | ||
| if dev == nil { | ||
| continue | ||
| var device string | ||
| if dev := disks.GetParentBlockDevice(majorMinor); dev != nil { | ||
| device = dev.Name | ||
| } | ||
| for mountPoint, fsStat := range mounts { | ||
| dls := []string{mountPoint, dev.Name, c.metadata.volumes[mountPoint]} | ||
| dls := []string{mountPoint, device, c.metadata.volumes[mountPoint]} | ||
| ch <- gauge(metrics.DiskSize, float64(fsStat.CapacityBytes), dls...) | ||
| ch <- gauge(metrics.DiskUsed, float64(fsStat.UsedBytes), dls...) | ||
| ch <- gauge(metrics.DiskReserved, float64(fsStat.ReservedBytes), dls...) | ||
|
|
@@ -790,10 +790,20 @@ func (c *Container) onL7Request(pid uint32, fd uint64, timestamp uint64, r *l7.R | |
| } | ||
| } | ||
|
|
||
| trace := c.tracer.NewTrace(conn.DestinationKey.ActualDestinationIfKnown(), conn.srcWorkload, conn.DestinationKey.GetDestinationWorkload(), conn.DestinationKey.GetActualDestinationWorkload()) | ||
| ebpfTracesDisabled := false | ||
| for _, p := range c.processes { | ||
| if p.Flags.EbpfTracesDisabled { | ||
| ebpfTracesDisabled = true | ||
| break | ||
| } | ||
|
Comment on lines
+794
to
+798
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This loop iterates over all processes in the container for every L7 request, which can be inefficient if a container has many processes. A more performant approach would be to cache the |
||
| } | ||
| var trace *tracing.Trace | ||
| traceId := "" | ||
| if headers != nil { | ||
| traceId = trace.ExtractTraceId(headers) | ||
| if !ebpfTracesDisabled { | ||
| trace := c.tracer.NewTrace(conn.DestinationKey.ActualDestinationIfKnown(), conn.srcWorkload, conn.DestinationKey.GetDestinationWorkload(), conn.DestinationKey.GetActualDestinationWorkload()) | ||
| if headers != nil { | ||
| traceId = trace.ExtractTraceId(headers) | ||
| } | ||
| } | ||
| stats := c.l7Stats.get(r.Protocol, conn.DestinationKey, r, conn.srcWorkload, traceId) | ||
| switch r.Protocol { | ||
|
|
@@ -883,6 +893,8 @@ func (c *Container) onL7Request(pid uint32, fd uint64, timestamp uint64, r *l7.R | |
| stats.observe(r.Status.Zookeeper(), "", r.Duration) | ||
| op, arg := l7.ParseZookeeper(r.Payload) | ||
| trace.ZookeeperRequest(op, arg, r.Status, r.Duration) | ||
| case l7.ProtocolFoundationDB: | ||
| stats.observe(r.Status.String(), "", r.Duration) | ||
| } | ||
| return nil | ||
| } | ||
|
|
@@ -1086,6 +1098,13 @@ func (c *Container) runLogParser(logPath string) { | |
| return | ||
| } | ||
|
|
||
| for _, p := range c.processes { | ||
| if p.Flags.LogMonitoringDisabled { | ||
| klog.InfoS("skipping log monitoring due to COROOT_LOG_MONITORING=disabled", "cg", c.cgroup.Id) | ||
| return | ||
| } | ||
| } | ||
|
Comment on lines
+1101
to
+1106
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This loop iterates over all processes in the container every time this function is called, which can be inefficient. A more performant approach would be to cache the |
||
|
|
||
| containerId := string(c.id) | ||
|
|
||
| if logPath != "" { | ||
|
|
||
Large diffs are not rendered by default.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The condition
len(parts) > 2is always true within this loop, aspartsis the result ofstrings.SplitN(line, ":", 3). This could lead to a panic ifcgPathis malformed (e.g., an empty string or just "/"), causing an out-of-bounds access onpp[1]. A more robust check would be on the length ofpp, such aslen(pp) > 1, to ensure there is at least one path component to access.