containerd / runwasi

Facilitates running Wasm / WASI workloads managed by containerd
Apache License 2.0
1.01k stars 82 forks source link

feat(containerd-shim-wasm): add OpenTelemetry tracing library and feature #582

Open Mossaka opened 1 month ago

Mossaka commented 1 month ago

This PR introduces OpenTelemetry feature and new APIs on the core crate to add tracing capabilities to the shim.

It builds on top of #564

Mossaka commented 1 month ago

Could you please take a look on this PR 🙏🏻 @devigned @jsturtevant @jprendes @cpuguy83

Mossaka commented 3 weeks ago

Did a rebase of the PR and resolved all the comments. Could you please take another look, @cpuguy83 , @jsturtevant 🙏?

calebschoepp commented 2 weeks ago

@Mossaka have you tried this with the latest version of the containerd-shim-spin? I'm concerned that they're going to conflict b/c they're both setting the tracing subscriber.

Mossaka commented 2 weeks ago

I'm concerned that they're going to conflict b/c they're both setting the tracing subscriber.

I will make sure to test the spin shim with these changes.

Mossaka commented 2 weeks ago

An interesting error from the build CI

Dockerfile.musl:4
--------------------
   2 |     FROM $CROSS_BASE_IMAGE
   3 |     
   4 | >>> COPY --from=jorgeprendes[42](https://github.com/containerd/runwasi/actions/runs/9485474098/job/26137500555?pr=582#step:8:43)0/apk-anywhere / /
   5 |     ENV MARCH=${CROSS_CMAKE_SYSTEM_PROCESSOR}
   6 |     RUN apk-init ${MARCH} ${CROSS_SYSROOT}
--------------------
ERROR: failed to solve: jorgeprendes420/apk-anywhere: failed to resolve source metadata for docker.io/jorgeprendes420/apk-anywhere:latest: unexpected status from HEAD request to https://registry-1.docker.io/v2/jorgeprendes420/apk-anywhere/manifests/latest: 503 Service Unavailable
Error: 
   0: could not run container
   1: when building custom image
   2: when building dockerfile
   3: `docker buildx build --progress auto --label 'org.cross-rs.for-cross-target=x86_64-unknown-linux-musl' --label 'org.cross-rs.runs-with=x86_64-unknown-linux-gnu' --label 'org.cross-rs.workspace_root=/home/runner/work/runwasi/runwasi' --tag localhost/cross-rs/cross-custom-runwasi:x86_64-unknown-linux-musl-7e7ca --build-arg 'CROSS_DEB_ARCH=musl-linux-amd64' --build-arg 'CROSS_BASE_IMAGE=ghcr.io/cross-rs/x86_64-unknown-linux-musl:main' --file cross/Dockerfile.musl --output 'type=docker' /home/runner/work/runwasi/runwasi` failed with exit status: 1

Location:
   src/docker/custom.rs:177

Judging by the status code "503 Service Unavailable", I think this is a temporary issue. Running the CI again. CC @jprendes

jsturtevant commented 1 week ago

I'm concerned that they're going to conflict b/c they're both setting the tracing subscriber.

I will make sure to test the spin shim with these changes.

Have you tested this with spin shim? otherwise I think we are good to go

Mossaka commented 1 week ago

Have you tested this with spin shim?

Yeah I've started testing this with the Spin Shim. I was debugging some issues of not seeing logs in the Spin Shim today.