• 🔬 Create an InstrumentationScope.

    Creates an OpenTelemetry instrumentation scope with the given parameters. This identifies the library or module that generated the telemetry data.

    Parameters

    • name: string

      Name of the instrumentation scope (e.g., library name)

    • version: string = ""

      Version of the instrumentation scope (defaults to empty string)

    • attributes: Record<string, unknown> = {}

      Additional attributes for the scope (defaults to empty object)

    Returns InstrumentationScope

    A complete InstrumentationScope object

    // Basic scope
    const basicScope = createInstrumentationScope("turtle-mining-lib");
    // Result: { name: "turtle-mining-lib", version: "", attributes: [], droppedAttributesCount: 0 }

    // Scope with version
    const versionedScope = createInstrumentationScope("turtle-mining-lib", "2.1.0");

    // Scope with attributes
    const detailedScope = createInstrumentationScope(
    "turtle-mining-lib",
    "2.1.0",
    {
    "library.type": "automation",
    "library.language": "typescript"
    }
    );