Before this, containerd would always print an error when shutting down;
ERRO[2023-12-07T14:35:00.070333131Z] failed to close plugin error="context canceled" id=io.containerd.internal.v1.tracing
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
All components need to use a consistent `semconv` version or OTel
will emit errors about "cannot merge resource due to conflicting Schema URL".
Switch to the appropriate semconv version, which requires dropping
usage of `httpconv`. Instead, the upstream HTTP client hooks are
used directly. (The lower-level functions are no longer exported by
OTel.)
Signed-off-by: Milas Bowman <milas.bowman@docker.com>
Remove containerd specific parts of the plugin package to prepare its
move out of the main repository. Separate the plugin registration
singleton into a separate package.
Separating out the plugin package and registration makes it easier to
implement external plugins without creating a dependency loop.
Signed-off-by: Derek McGowan <derek@mcg.dev>
The plugins packages defines the plugins used by containerd.
Move all the types and properties to this package.
Signed-off-by: Derek McGowan <derek@mcg.dev>
This allows standard OTLP env vars to be used for configuring tracing
exporters.
Note: This does mean that, as written now, if no env var is set the
trace exporter will try to connect to the default OTLP address
(`localhost:4318`).
I've left this alone for now, but we could detect the OTLP vars
ourselves and if not set don't configure the exporter.
Signed-off-by: Brian Goff <cpuguy83@gmail.com>
Signed-off-by: Swagat Bora <sbora@amazon.com>
Add spans around image unpack operations
Use image.ref to denote image name and image.id for the image config digest
Add top-level spand and record errors in the CRI instrumentation service
When support for http/protobuf was added, the OTLP tracing processor
plugin was mistakenly changed to return a raw OTLP exporter instance.
Consequently, the type-assertion to a trace.SpanProcessor inside the
tracing pluigin would panic if the processor plugin was configured.
Modify the OTLP plugin to return a BatchSpanProcessor derived from the
exporter once more.
Signed-off-by: Cory Snider <csnider@mirantis.com>
- insecure.NewCredential was simply wrong. It has to use
otlptracegrpc.WithInsecure to disable TLS.
- context.WithTimeout is nice to have, in case the endpoint is not
correctly configured.
Otherwise, the plugin initialization blocks indefinitely.
- grpc.WithReturnConnectionError is nice to have.
Otherwise, otlptracegrpc.New returns "context deadline exceeded"
without underlying errors.
- TraceSamplingRatio should be 1.0 by default.
Otherwise, users need to configure both io.containerd.internal.v1.tracing
and io.containerd.tracing.processor.v1.otlp.
Signed-off-by: Kazuyoshi Kato <katokazu@amazon.com>