npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@kubiks/otel-e2b

v1.0.0

Published

OpenTelemetry instrumentation for E2B Sandboxes

Readme

@kubiks/otel-e2b

OpenTelemetry instrumentation for E2B Sandboxes. Capture spans for sandbox lifecycle, code execution, file operations, and command execution to monitor and debug your E2B sandbox operations.

E2B Trace Visualization

Installation

npm install @kubiks/otel-e2b
# or
pnpm add @kubiks/otel-e2b

Quick Start

import { Sandbox } from "@e2b/code-interpreter";
import { instrumentSandbox } from "@kubiks/otel-e2b";

const sandbox = await Sandbox.create();
instrumentSandbox(sandbox);

// All operations are now traced
await sandbox.runCode('print("Hello from E2B")');
await sandbox.files.write("/app/data.txt", "some data");
await sandbox.commands.run("ls -la");
await sandbox.kill();

instrumentSandbox wraps the sandbox you already use — no configuration changes needed. Every operation creates a client span with useful attributes.

You can also use instrumentSandboxClass(Sandbox) to automatically instrument all sandboxes created after setup.

What Gets Traced

This instrumentation automatically traces all E2B sandbox operations including Sandbox.create(), sandbox.kill(), sandbox.runCode() (code execution), sandbox.commands.run() (shell commands), and all file operations (files.read(), files.write(), files.list(), files.remove(), files.makeDir()).

Span Attributes

Each span includes relevant attributes for debugging and monitoring:

| Attribute | Description | Example | | -------------------------- | ------------------------------------- | ---------------------------- | | e2b.operation | Operation type | sandbox.create, code.run | | e2b.sandbox.id | Unique sandbox identifier | sb_abc123def456 | | e2b.sandbox.template | Template used for creation | custom-template | | e2b.code.language | Programming language | python, javascript | | e2b.code.has_error | Whether execution had errors | true, false | | e2b.code.execution_count | Execution count from result | 1, 2, 3 | | e2b.command.exit_code | Process exit code | 0, 1, 127 | | e2b.command.stdout_lines | Number of stdout lines (when enabled) | 5 | | e2b.command.stderr_lines | Number of stderr lines (when enabled) | 2 | | e2b.command.background | Whether command ran in background | true, false | | e2b.file.operation | File operation type | read, write, list | | e2b.file.path | File or directory path | /app/data.txt | | e2b.file.size_bytes | File size in bytes | 1024 | | e2b.file.format | Read format (for read ops) | text, bytes | | e2b.file.count | Number of files (list/write multiple) | 10 |

Configuration Options

The instrumentation accepts optional configuration to control what metadata to capture:

  • tracerName - Custom tracer name (default: "@kubiks/otel-e2b")
  • captureFilePaths - Capture file paths, not content (default: true)
  • captureFileSize - Capture file sizes (default: true)
  • captureCodeLanguage - Capture code execution language (default: true)
  • captureCommandOutput - Capture command output line counts, not content (default: false)

Example:

instrumentSandbox(sandbox, {
  captureFilePaths: true,
  captureCommandOutput: true,
});

The instrumentation never captures sensitive data like code content, command arguments, file contents, or environment variables — only safe metadata like paths, sizes, exit codes, and language types.

License

MIT