Similar to video compression which uses key-frames and differences
between them: every N publishes we send a full report, but inbetween
we only send what has changed.
Fairly simple approach in the probe - hold on to the last full report,
and for the deltas remove anything that would be merged in from the
full report.
On the receiving side in the app it already merges a set of reports
together to produce the final output for rendering, so provided N is
smaller than that set we don't need to do anything different.
Deltas don't need to represent nodes that have disappeared - an
earlier full node will have that node so it would be merged into the
final output anyway.
This dependency makes it harder to see the structure of the program,
and sometimes complicates compilation.
Mostly just changing the source of strings that are already exported
from the report package. A few new strings have to be moved there,
plus the function `IsPauseImageName()`.
So we save space writing out empty topologies.
Need to fix up `app_client_internal_test.go` to use Scope's
`test/reflect` package that understands empty==nil, so now it doesn't
need a previous workaround.
Remove a similar workaround in `probe_internal_test.go` that isn't
necessary since it's already using that package.
We observe a slow increase in connections reported, and are unable to
find the root cause, so clear down the data every six hours and start
from a clean sheet.
Delay kernel events by up to 0.2ms, to reduce the chance the ebpf
reporter sends them out-of-order, and allow out-of-order events to
happen up to once a minute without giving up on the ebpf reporter.
We are already timing all report, tag and tick operations.
If Prometheus is in use, expose those metrics that way.
Adjust metrics naming to fit with Prometheus norms.
The previous way these metrics were exposed was via SIGUSR1, and we
can only have one "sink", so make it either-or.
Signed-off-by: Bryan Boreham <bryan@weave.works>
The call to register this metric was removed in #633 over three years ago.
If it isn't registered then nobody can see the values.
The measurement is duplicated by metrics added in #658.
Previously it would only delete if Docker said the container didn't
exist, which is a race between Docker sending the event and Docker
removing the info from its own records.
Extract a couple of functions to make the action clearer.
This covers:
- Implementation of the job resource in probe
- Reporter changes for the job
- Add Describe Control to the job
- Pass job object to the kube controller renderer
ToDo:
- Need to decide the shape for the Job.
Signed-off-by: Satyam Zode <satyamzode@gmail.com>
This commit will add a new control i.e. Describe
which will describe a k8s resource similar to kubectl describe.
Signed-off-by: Akash Srivastava <akashsrivastava4927@gmail.com>
This will
Upgrade:
- k8s.io/client-go v10.0.0
- k8s.io/api version to kubernetes-1.13.0
- k8s.io/apimachinery version to kubernetes-1.13.0
- github.com/imdario/mergo to v0.3.5
Add:
- k8s.io/klog v0.1.0
- sigs.k8s.io/yaml v1.1.0
Changes:
- modified: probe/kubernetes/client.go
- modified: probe/kubernetes/controls.go
To ScaleUp and ScaleDown a Deployment, Scale method was used,
which is removed in client-go-10.0.0
Instead of Scale use UpdateScale method of Deployment to
ScaleUp and ScaleDown the Deployment.
Signed-off-by: Akash Srivastava <akashsrivastava4927@gmail.com>
Read all the PVC source from a pod spec
and add adjacency between the pod and its PVCs.
Signed-off-by: Akash Srivastava <akashsrivastava4927@gmail.com>
This avoids side-effects from reporting Kubernetes from a
cluster-level probe, and removes a lie from the probe data.
Rather than do the work every time the probe sends a report, we do it
every time the app renders endpoints, which should be once per merged
report set.
When the probe first starts we should only be interested in active
connections, and if the loop re-starts it's probably because too many
connections are opening and closing to keep up with, so it's good to
drop any that are already closed then too.
Refactor the code so `handleFlow` is only called on events, and handle
the initial list of connections directly.
- don't need another wrapper round `conntrack.Connections()`
- logPipe() was only for the command-line conntrack
- nobody closes the `event` chan now, so no need to pre-check for quit