Skip to content
This repository was archived by the owner on May 12, 2021. It is now read-only.

Add virtcontainers trace support#617

Merged
egernst merged 6 commits intokata-containers:masterfrom
jodh-intel:add-vc-trace-support
Aug 23, 2018
Merged

Add virtcontainers trace support#617
egernst merged 6 commits intokata-containers:masterfrom
jodh-intel:add-vc-trace-support

Conversation

@jodh-intel
Copy link

@jodh-intel jodh-intel commented Aug 21, 2018

This PR expands the opentracing support in the runtime, providing increased granularity by adding trace spans to the virtcontainers packages.

Like the initial PR (#565), the strategy here is to add context.Context parameters to all virtcontainers API calls. The specified context replaces the default context created in certain parts of the code and allows trace spans to be created.

I've added a trace() function in cli/tracing.go but most subsystems and subsystem implementations also create their own trace() method.

Tags have been added to spans, mostly via the trace() functions:

Examples:

  • For component=network, type could be cnm.
  • For component=hypervisor, type could be qemu.

Fixes #566.

Signed-off-by: James O. D. Hunt [email protected]

@egernst egernst added the review label Aug 21, 2018
@katacontainersbot
Copy link
Contributor

PSS Measurement:
Qemu: 167416 KB
Proxy: 4254 KB
Shim: 8867 KB

Memory inside container:
Total Memory: 2043464 KB
Free Memory: 2003596 KB

@codecov
Copy link

codecov bot commented Aug 21, 2018

Codecov Report

Merging #617 into master will increase coverage by 0.46%.
The diff coverage is 77.74%.

@@            Coverage Diff             @@
##           master     #617      +/-   ##
==========================================
+ Coverage   64.69%   65.16%   +0.46%     
==========================================
  Files          84       84              
  Lines        9558     9835     +277     
==========================================
+ Hits         6184     6409     +225     
- Misses       2726     2769      +43     
- Partials      648      657       +9

@opendev-zuul
Copy link

opendev-zuul bot commented Aug 21, 2018

Build failed (third-party-check pipeline) integration testing with
OpenStack. For information on how to proceed, see
http://docs.openstack.org/infra/manual/developers.html#automated-testing

@jodh-intel
Copy link
Author

Given the amount of code this touches, it would be great to get this reviewed sooner rather than later to avoid "rebase hell" if code changes underneath this PR... :)

}

testingImpl.CreateSandboxFunc = func(sandboxConfig vc.SandboxConfig) (vc.VCSandbox, error) {
testingImpl.CreateSandboxFunc = func(ctx context.Context, sandboxConfig vc.SandboxConfig) (vc.VCSandbox, error) {
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I wonder if wouldn't be better to define a global context variable instead of modify all the functions

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

might be something like traceContext ..

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I did think about that (and in fact did use that technique in virtcontainers/hack/virtc/main.go), but I'd rather we use the recommended approach and minimise globals where possible.

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

make sense, thanks for the info

Copy link

@devimc devimc left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

@devimc
Copy link

devimc commented Aug 21, 2018

recheck

@opendev-zuul
Copy link

opendev-zuul bot commented Aug 21, 2018

Build failed (third-party-check pipeline) integration testing with
OpenStack. For information on how to proceed, see
http://docs.openstack.org/infra/manual/developers.html#automated-testing

@jodh-intel
Copy link
Author

Ping @amshinde, @sboeuf, @bergwolf.

@jodh-intel
Copy link
Author

Ping @egernst.

James O. D. Hunt added 6 commits August 22, 2018 08:24
Set a tag on the root span to denote the subsystem refers to the
runtime.

Signed-off-by: James O. D. Hunt <[email protected]>
Simplify code slightly be creating a `trace()` function.

Signed-off-by: James O. D. Hunt <[email protected]>
Add a `context.Context` parameter to all the virtcontainers API's to
support tracing.

Signed-off-by: James O. D. Hunt <[email protected]>
Create spans for all `virtcontainers` API functions.

Signed-off-by: James O. D. Hunt <[email protected]>
Use the `networkLogger()`, not the network-specific `cnmLogger()`.

Signed-off-by: James O. D. Hunt <[email protected]>
Add additional `context.Context` parameters and `struct` fields to allow
trace spans to be created by the `virtcontainers` internal functions,
objects and sub-packages.

Note that not every function is traced; we can add more traces as
desired.

Fixes kata-containers#566.

Signed-off-by: James O. D. Hunt <[email protected]>
@jodh-intel jodh-intel force-pushed the add-vc-trace-support branch from 18755b9 to bc83fb1 Compare August 22, 2018 07:25
@katacontainersbot
Copy link
Contributor

PSS Measurement:
Qemu: 165467 KB
Proxy: 4140 KB
Shim: 8913 KB

Memory inside container:
Total Memory: 2043464 KB
Free Memory: 2003564 KB

@opendev-zuul
Copy link

opendev-zuul bot commented Aug 22, 2018

Build failed (third-party-check pipeline) integration testing with
OpenStack. For information on how to proceed, see
http://docs.openstack.org/infra/manual/developers.html#automated-testing

@egernst
Copy link
Member

egernst commented Aug 22, 2018

awesome. @jodh-intel to ease stable handling, do you think we should consider separating out the agent change from the VC changes? It makes it a bit easier to track a whole PR for applicability. WDYT?

@bergwolf
Copy link
Member

@egernst Is this going to be a stable candidate?

@jodh-intel jodh-intel force-pushed the add-vc-trace-support branch from bc83fb1 to d0679a6 Compare August 23, 2018 08:34
@jodh-intel
Copy link
Author

@egernst - I agree. I've removed that commit and will raise a follow-on PR when this PR gets merged...

@egernst, @bergwolf - Agreed - I don't think the tracing code should be in stable yet as it's brand new (and hence "unproven" at this point).

@jodh-intel
Copy link
Author

Ping @kata-containers/runtime - please can you review??

@opendev-zuul
Copy link

opendev-zuul bot commented Aug 23, 2018

Build failed (third-party-check pipeline) integration testing with
OpenStack. For information on how to proceed, see
http://docs.openstack.org/infra/manual/developers.html#automated-testing

@katacontainersbot
Copy link
Contributor

PSS Measurement:
Qemu: 169712 KB
Proxy: 4089 KB
Shim: 8790 KB

Memory inside container:
Total Memory: 2043464 KB
Free Memory: 2003564 KB

@jodh-intel
Copy link
Author

Errm, checking the F27 CI log:

Repository  was already defined in a 'Depends-on:' tag.
Only one repository per tag is allowed.

WTF? I didn't add any depends-on...? That message looks like "repository" is actually "" (note the double space before "was").

/me puts another coin in the slot and pulls the handle...

@jodh-intel
Copy link
Author

@amshinde, @bergwolf, @sboeuf, @egernst, @WeiZhang555 - ptal....

@jodh-intel jodh-intel requested review from WeiZhang555, amshinde, bergwolf and sboeuf and removed request for sboeuf August 23, 2018 16:41
@devimc
Copy link

devimc commented Aug 23, 2018

recheck

@devimc
Copy link

devimc commented Aug 23, 2018

restarting jenkins-ci-fedora-27-vsocks

@egernst egernst merged commit 3f45818 into kata-containers:master Aug 23, 2018
@egernst egernst removed the review label Aug 23, 2018
@sboeuf sboeuf added the feature New functionality label Sep 12, 2018
@raravena80
Copy link
Member

Talked about in 12/17/18 meeting (kata-herding)

egernst pushed a commit to egernst/runtime that referenced this pull request Feb 9, 2021
`dep check` is being run by our CI to make sure that the dependency
files and vendor repositories are in sync. This PR brings them into sync
to pass checks.

Fixes: kata-containers#617
Signed-off-by: Ganesh Maharaj Mahalingam <[email protected]>
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

feature New functionality

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants