Commit Graph
13 Commits
Author SHA1 Message Date
Samuel Karp 531b3a37b9 tracing: remove deprecated tracing config options
Remove support for service_name and sampling_ratio in the
io.containerd.internal.v1.tracing plugin configuration, which was
previously deprecated in v1.6.29. Users should use standard OTel
environment variables instead (OTEL_SERVICE_NAME, OTEL_TRACES_SAMPLER,
etc.).

Re-add unit tests in pkg/tracing/plugin/otlp_test.go to verify
OTel environment variable configuration for service name, sampling,
exporters, and SDK disabling.

Assisted-by: Antigravity
Signed-off-by: Samuel Karp <samuelkarp@google.com>
2026-09-15 15:08:04 -07:00
Samuel Karp ca8579a334 tracing: add tests for otlp exporter and env vars
Add unit tests in pkg/tracing/plugin/otlp_test.go to verify newExporter,
checkDisabled, and newTracer with the OpenTelemetry environment
variables that replaced the deprecated OTLP plugin configuration fields.

Assisted-by: Antigravity
Signed-off-by: Samuel Karp <samuelkarp@google.com>
2026-09-15 15:07:58 -07:00
Samuel Karp ee024b7c99 tracing: remove deprecated otlp configs
Remove the deprecated endpoint, protocol, and insecure configuration
options for the io.containerd.tracing.processor.v1.otlp plugin.
These were deprecated in v1.6.29 and replaced by standard OTLP
environment variables.

Assisted-by: Antigravity
Signed-off-by: Samuel Karp <samuelkarp@google.com>
2026-09-15 15:07:51 -07:00
Maksym Pavlenko 5c25750dd5 shim: propagate trace context to runc and OCI hooks
runc and the OCI hooks it spawns are separate processes, so the trace
context can not reach them over ttrpc. Inject it into their environment
instead, riding on the request context via go-runc's WithExtraEnv, which
does not race with concurrent requests the way setting it on the shim
process would.

The otelttrpc interceptor extracts that context, so chain it first
explicitly instead of leaving it to plugin initialization order. Also
flush the spans the tracing plugin buffered before the shim exits.

Signed-off-by: Maksym Pavlenko <pavlenko.maksym@gmail.com>
2026-08-25 11:21:41 -07:00
Hasan Siddiqui 10c30fb74a tracing: add option to inject trace ID into logrus fields
Introduce functional options to NewLogrusHook to allow optional Trace ID
injection into log fields. This enables log-trace correlation via the
[debug] config without breaking existing external consumers of
pkg/tracing.

Signed-off-by: Hasan Siddiqui <hasiddiqui@google.com>
2026-03-24 21:51:27 +00:00
Sebastiaan van Stijn 828c2119e5 pkg: modernize: any
go install golang.org/x/tools/go/analysis/passes/modernize/cmd/modernize@latest
    modernize -any -fix ./...

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2026-03-15 18:24:15 +01:00
Brian Goff b2681dfbdb shim: Move ttrpc interceptors to plugins
This makes it so we don't need to import otelttrpc unless the shim is
compiled with the `shim_tracing` build tag.
This way otel is no longer compiled into the binary at all unless
`shim_tracing` is set.

Signed-off-by: Brian Goff <cpuguy83@gmail.com>
2024-10-03 00:12:47 +00:00
Brian Goff 17d4a1357e Propagate trace contexts to shims
This adds trace context propagation over the grpc/ttrpc calls to a shim.

It also adds the otlp plugin to the runc shim so that it will send
traces to the configured tracer (which is inherited from containerd's
config).
It doesn't look like this is adding any real overhead to the runc shim's
memory usage, however it does add 2MB to the binary size.
As such this is gated by a build tag `shim_tracing`

Signed-off-by: Brian Goff <cpuguy83@gmail.com>
2024-09-30 21:44:16 +00:00
Sebastiaan van Stijn 4203e2de8d pkg/tracing/plugin: rename var that collided with import
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2024-06-14 11:57:27 +02:00
Brian Goff 4fbc9842d5 Changes to configuring otel from env only
These are standard environment variables described by the otel spec in
https://opentelemetry.io/docs/specs/otel/configuration/sdk-environment-variables/.

The old config options are removed

Also since otel will by default try to connect to https://localhost:4318
if no endpoint is set, this will also just disable the otlp plugin when
there is no endpoint so we don't have otel continuously trying to
connect to the default endpoint, littering the logs with connection
failure messages and collecting traces that won't go anywhere.

Signed-off-by: Brian Goff <cpuguy83@gmail.com>
2024-02-20 21:59:45 +00:00
Brian Goff 753a525b3b Deprecate otel configs
Signed-off-by: Brian Goff <cpuguy83@gmail.com>
2024-02-20 21:59:42 +00:00
Derek McGowan fb9b59a843 Switch to new errdefs package
Signed-off-by: Derek McGowan <derek@mcg.dev>
2024-01-25 22:18:45 -08:00
Derek McGowan 8f0eb26311 Move tracing to pkg/tracing
Signed-off-by: Derek McGowan <derek@mcg.dev>
2024-01-17 09:56:25 -08:00