{
  "id": "@typed/fx#Fx.withSpan",
  "canonicalId": "@typed/fx/Fx#withSpan",
  "symbol": {
    "id": "@typed/fx#Fx.withSpan",
    "packageName": "@typed/fx",
    "moduleName": ".",
    "exportName": "Fx.withSpan",
    "kind": "constant",
    "signatures": [
      "export declare const withSpan: {\n    (name: string, options?: SpanOptionsNoTrace): <A, E, R>(fx: Fx<A, E, R>) => Fx<A, E, R>;\n    <A, E, R>(fx: Fx<A, E, R>, name: string, options?: SpanOptionsNoTrace): Fx<A, E, R>;\n};"
    ],
    "summary": "Traces the whole subscription and each success or failure delivery.",
    "sections": {
      "Why": "A single Effect span around subscription setup cannot show time spent in\ndownstream sink callbacks. Nested delivery spans make the push boundary\nvisible while keeping the source's values and types unchanged.",
      "Ownership and lifetime": "Every run creates an `Fx(name)` span covering the source subscription. Each\n`onSuccess` and `onFailure` callback executes in its own child span. Span\nlifetime follows the Effects exactly; interruption closes active spans.\nOptions are forwarded to all three span kinds, and no service requirement or\nfailure is added beyond the configured Effect tracer."
    },
    "examples": [
      {
        "language": "ts",
        "code": "import { withSpan } from \"@typed/fx/Fx\"\nimport { succeed } from \"@typed/fx/Fx\"\n\nconst traced = withSpan(succeed(\"ready\"), \"load-settings\", {\n  attributes: { component: \"settings\" }\n})"
      }
    ],
    "relations": [],
    "source": {
      "file": "packages/fx/src/Fx/combinators/withSpan.ts",
      "line": 40
    },
    "since": "1.0.0",
    "category": "Observing failures"
  },
  "exposure": {
    "recordKind": "declaration",
    "id": "@typed/fx#Fx.withSpan",
    "packageName": "@typed/fx",
    "packageVersion": "2.0.0-beta.13",
    "moduleName": ".",
    "consumerSpecifier": "@typed/fx",
    "exportName": "Fx",
    "qualifiedName": "Fx.withSpan",
    "declarationKey": "declaration:8255fe1425faa274c8e56fb4",
    "family": "variable",
    "signatures": [
      "export declare const withSpan: {\n    (name: string, options?: SpanOptionsNoTrace): <A, E, R>(fx: Fx<A, E, R>) => Fx<A, E, R>;\n    <A, E, R>(fx: Fx<A, E, R>, name: string, options?: SpanOptionsNoTrace): Fx<A, E, R>;\n};"
    ],
    "sourceSpans": [
      {
        "file": "packages/fx/src/Fx/combinators/withSpan.ts",
        "start": {
          "line": 40,
          "column": 14
        },
        "end": {
          "line": 58,
          "column": 2
        }
      },
      {
        "file": "packages/fx/src/Fx/combinators/withSpan.ts",
        "start": {
          "line": 41,
          "column": 3
        },
        "end": {
          "line": 41,
          "column": 91
        }
      },
      {
        "file": "packages/fx/src/Fx/combinators/withSpan.ts",
        "start": {
          "line": 42,
          "column": 3
        },
        "end": {
          "line": 42,
          "column": 87
        }
      }
    ],
    "aliases": [
      "@typed/fx/Fx#withSpan"
    ],
    "isAlias": true,
    "parentId": "@typed/fx#Fx",
    "static": false,
    "importedFrom": "declaration:8255fe1425faa274c8e56fb4"
  },
  "declaration": {
    "declarationKey": "declaration:8255fe1425faa274c8e56fb4",
    "name": "withSpan",
    "family": "variable",
    "facets": [
      {
        "family": "variable",
        "syntaxKind": "VariableDeclaration",
        "signatures": [
          "export declare const withSpan: {\n    (name: string, options?: SpanOptionsNoTrace): <A, E, R>(fx: Fx<A, E, R>) => Fx<A, E, R>;\n    <A, E, R>(fx: Fx<A, E, R>, name: string, options?: SpanOptionsNoTrace): Fx<A, E, R>;\n};"
        ],
        "typeParameters": [],
        "sourceSpans": [
          {
            "file": "packages/fx/src/Fx/combinators/withSpan.ts",
            "start": {
              "line": 40,
              "column": 14
            },
            "end": {
              "line": 58,
              "column": 2
            }
          }
        ],
        "static": false,
        "readonly": false,
        "optional": false
      },
      {
        "family": "call-signature",
        "syntaxKind": "CallSignature",
        "signatures": [
          "(name: string, options?: SpanOptionsNoTrace): <A, E, R>(fx: Fx<A, E, R>) => Fx<A, E, R>;",
          "<A, E, R>(fx: Fx<A, E, R>, name: string, options?: SpanOptionsNoTrace): Fx<A, E, R>;"
        ],
        "typeParameters": [
          "A",
          "E",
          "R"
        ],
        "sourceSpans": [
          {
            "file": "packages/fx/src/Fx/combinators/withSpan.ts",
            "start": {
              "line": 41,
              "column": 3
            },
            "end": {
              "line": 41,
              "column": 91
            }
          },
          {
            "file": "packages/fx/src/Fx/combinators/withSpan.ts",
            "start": {
              "line": 42,
              "column": 3
            },
            "end": {
              "line": 42,
              "column": 87
            }
          }
        ],
        "static": false,
        "readonly": false,
        "optional": false
      }
    ],
    "signatures": [
      "export declare const withSpan: {\n    (name: string, options?: SpanOptionsNoTrace): <A, E, R>(fx: Fx<A, E, R>) => Fx<A, E, R>;\n    <A, E, R>(fx: Fx<A, E, R>, name: string, options?: SpanOptionsNoTrace): Fx<A, E, R>;\n};"
    ],
    "typeParameters": [
      "A",
      "E",
      "R"
    ],
    "summary": "Traces the whole subscription and each success or failure delivery.",
    "sections": {
      "Why": "A single Effect span around subscription setup cannot show time spent in\ndownstream sink callbacks. Nested delivery spans make the push boundary\nvisible while keeping the source's values and types unchanged.",
      "Ownership and lifetime": "Every run creates an `Fx(name)` span covering the source subscription. Each\n`onSuccess` and `onFailure` callback executes in its own child span. Span\nlifetime follows the Effects exactly; interruption closes active spans.\nOptions are forwarded to all three span kinds, and no service requirement or\nfailure is added beyond the configured Effect tracer."
    },
    "examples": [
      {
        "language": "ts",
        "code": "import { withSpan } from \"@typed/fx/Fx\"\nimport { succeed } from \"@typed/fx/Fx\"\n\nconst traced = withSpan(succeed(\"ready\"), \"load-settings\", {\n  attributes: { component: \"settings\" }\n})"
      }
    ],
    "sourceSpans": [
      {
        "file": "packages/fx/src/Fx/combinators/withSpan.ts",
        "start": {
          "line": 40,
          "column": 14
        },
        "end": {
          "line": 58,
          "column": 2
        }
      },
      {
        "file": "packages/fx/src/Fx/combinators/withSpan.ts",
        "start": {
          "line": 41,
          "column": 3
        },
        "end": {
          "line": 41,
          "column": 91
        }
      },
      {
        "file": "packages/fx/src/Fx/combinators/withSpan.ts",
        "start": {
          "line": 42,
          "column": 3
        },
        "end": {
          "line": 42,
          "column": 87
        }
      }
    ],
    "since": "1.0.0",
    "category": "Observing failures"
  }
}
