@sentry/effect 10.68.0 → 11.0.0-alpha.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +0 -2
- package/build/cjs/index.server.js +5 -5
- package/build/cjs/logger.js +9 -6
- package/build/cjs/logger.js.map +1 -1
- package/build/cjs/server/index.js.map +1 -1
- package/build/cjs/server/sdk.js +7 -4
- package/build/cjs/server/sdk.js.map +1 -1
- package/build/esm/index.server.js +1 -1
- package/build/esm/logger.js +10 -7
- package/build/esm/logger.js.map +1 -1
- package/build/esm/package.json +1 -1
- package/build/esm/server/index.js.map +1 -1
- package/build/esm/server/sdk.js +6 -3
- package/build/esm/server/sdk.js.map +1 -1
- package/build/types/index.server.d.ts +1 -1
- package/build/types/index.server.d.ts.map +1 -1
- package/build/types/index.types.d.ts +8 -0
- package/build/types/index.types.d.ts.map +1 -1
- package/build/types/logger.d.ts.map +1 -1
- package/build/types/server/index.d.ts +1 -1
- package/build/types/server/index.d.ts.map +1 -1
- package/build/types/server/sdk.d.ts +1 -1
- package/build/types/server/sdk.d.ts.map +1 -1
- package/package.json +8 -23
- package/build/types-ts3.8/client/index.d.ts +0 -33
- package/build/types-ts3.8/client/sdk.d.ts +0 -10
- package/build/types-ts3.8/index.client.d.ts +0 -7
- package/build/types-ts3.8/index.server.d.ts +0 -7
- package/build/types-ts3.8/index.types.d.ts +0 -18
- package/build/types-ts3.8/logger.d.ts +0 -6
- package/build/types-ts3.8/metrics.d.ts +0 -8
- package/build/types-ts3.8/server/index.d.ts +0 -34
- package/build/types-ts3.8/server/sdk.d.ts +0 -10
- package/build/types-ts3.8/tracer.d.ts +0 -6
package/README.md
CHANGED
|
@@ -27,7 +27,6 @@ const SentryLive = Layer.mergeAll(
|
|
|
27
27
|
Sentry.effectLayer({
|
|
28
28
|
dsn: '__DSN__',
|
|
29
29
|
tracesSampleRate: 1.0,
|
|
30
|
-
enableLogs: true,
|
|
31
30
|
}),
|
|
32
31
|
Layer.setTracer(Sentry.SentryEffectTracer),
|
|
33
32
|
Logger.replace(Logger.defaultLogger, Sentry.SentryEffectLogger),
|
|
@@ -59,7 +58,6 @@ const SentryLive = Layer.mergeAll(
|
|
|
59
58
|
Sentry.effectLayer({
|
|
60
59
|
dsn: '__DSN__',
|
|
61
60
|
tracesSampleRate: 1.0,
|
|
62
|
-
enableLogs: true,
|
|
63
61
|
}),
|
|
64
62
|
Layer.succeed(Tracer.Tracer, Sentry.SentryEffectTracer),
|
|
65
63
|
Logger.layer([Sentry.SentryEffectLogger]),
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
2
2
|
|
|
3
|
-
const
|
|
3
|
+
const node = require('@sentry/node');
|
|
4
4
|
const index = require('./server/index.js');
|
|
5
5
|
const tracer = require('./tracer.js');
|
|
6
6
|
const logger = require('./logger.js');
|
|
@@ -14,14 +14,14 @@ exports.SentryEffectTracer = tracer.SentryEffectTracer;
|
|
|
14
14
|
exports.SentryEffectLogger = logger.SentryEffectLogger;
|
|
15
15
|
exports.SentryEffectMetricsLayer = metrics.SentryEffectMetricsLayer;
|
|
16
16
|
exports.init = sdk.init;
|
|
17
|
-
Object.prototype.hasOwnProperty.call(
|
|
17
|
+
Object.prototype.hasOwnProperty.call(node, '__proto__') &&
|
|
18
18
|
!Object.prototype.hasOwnProperty.call(exports, '__proto__') &&
|
|
19
19
|
Object.defineProperty(exports, '__proto__', {
|
|
20
20
|
enumerable: true,
|
|
21
|
-
value:
|
|
21
|
+
value: node['__proto__']
|
|
22
22
|
});
|
|
23
23
|
|
|
24
|
-
Object.keys(
|
|
25
|
-
if (k !== 'default' && !Object.prototype.hasOwnProperty.call(exports, k)) exports[k] =
|
|
24
|
+
Object.keys(node).forEach(k => {
|
|
25
|
+
if (k !== 'default' && !Object.prototype.hasOwnProperty.call(exports, k)) exports[k] = node[k];
|
|
26
26
|
});
|
|
27
27
|
//# sourceMappingURL=index.server.js.map
|
package/build/cjs/logger.js
CHANGED
|
@@ -3,6 +3,9 @@ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
|
3
3
|
const core = require('@sentry/core');
|
|
4
4
|
const Logger = require('effect/Logger');
|
|
5
5
|
|
|
6
|
+
const LOG_ATTRIBUTES = {
|
|
7
|
+
[core.SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN]: "auto.log.effect"
|
|
8
|
+
};
|
|
6
9
|
function getLogLevelTag(logLevel) {
|
|
7
10
|
if (typeof logLevel === "string") {
|
|
8
11
|
return logLevel;
|
|
@@ -25,24 +28,24 @@ const SentryEffectLogger = Logger.make(({ logLevel, message }) => {
|
|
|
25
28
|
const tag = getLogLevelTag(logLevel);
|
|
26
29
|
switch (tag) {
|
|
27
30
|
case "Fatal":
|
|
28
|
-
core.logger.fatal(msg);
|
|
31
|
+
core.logger.fatal(msg, LOG_ATTRIBUTES);
|
|
29
32
|
break;
|
|
30
33
|
case "Error":
|
|
31
|
-
core.logger.error(msg);
|
|
34
|
+
core.logger.error(msg, LOG_ATTRIBUTES);
|
|
32
35
|
break;
|
|
33
36
|
case "Warning":
|
|
34
37
|
// Effect v3
|
|
35
38
|
case "Warn":
|
|
36
|
-
core.logger.warn(msg);
|
|
39
|
+
core.logger.warn(msg, LOG_ATTRIBUTES);
|
|
37
40
|
break;
|
|
38
41
|
case "Info":
|
|
39
|
-
core.logger.info(msg);
|
|
42
|
+
core.logger.info(msg, LOG_ATTRIBUTES);
|
|
40
43
|
break;
|
|
41
44
|
case "Debug":
|
|
42
|
-
core.logger.debug(msg);
|
|
45
|
+
core.logger.debug(msg, LOG_ATTRIBUTES);
|
|
43
46
|
break;
|
|
44
47
|
case "Trace":
|
|
45
|
-
core.logger.trace(msg);
|
|
48
|
+
core.logger.trace(msg, LOG_ATTRIBUTES);
|
|
46
49
|
break;
|
|
47
50
|
}
|
|
48
51
|
});
|
package/build/cjs/logger.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"logger.js","sources":["../../src/logger.ts"],"sourcesContent":["import { isObjectLike, logger as sentryLogger } from '@sentry/core';\nimport * as Logger from 'effect/Logger';\nimport type * as LogLevel from 'effect/LogLevel';\n\nfunction getLogLevelTag(logLevel: LogLevel.LogLevel): LogLevel.LogLevel | 'Warning' {\n // Effect v4: logLevel is a string literal directly\n if (typeof logLevel === 'string') {\n return logLevel;\n }\n\n // Effect v3: logLevel has _tag property\n if (isObjectLike(logLevel) && '_tag' in logLevel) {\n return (logLevel as { _tag: LogLevel.LogLevel })._tag;\n }\n\n return 'Info';\n}\n\n/**\n * Effect Logger that sends logs to Sentry.\n */\nexport const SentryEffectLogger = Logger.make(({ logLevel, message }) => {\n let msg: string;\n if (typeof message === 'string') {\n msg = message;\n } else if (Array.isArray(message) && message.length === 1) {\n const firstElement = message[0];\n msg = typeof firstElement === 'string' ? firstElement : JSON.stringify(firstElement);\n } else {\n msg = JSON.stringify(message);\n }\n\n const tag = getLogLevelTag(logLevel);\n\n switch (tag) {\n case 'Fatal':\n sentryLogger.fatal(msg);\n break;\n case 'Error':\n sentryLogger.error(msg);\n break;\n case 'Warning': // Effect v3\n case 'Warn': // Effect v4\n sentryLogger.warn(msg);\n break;\n case 'Info':\n sentryLogger.info(msg);\n break;\n case 'Debug':\n sentryLogger.debug(msg);\n break;\n case 'Trace':\n sentryLogger.trace(msg);\n break;\n case 'All':\n case 'None':\n break;\n default:\n tag satisfies never;\n }\n});\n"],"names":["isObjectLike","sentryLogger"],"mappings":";;;;;AAIA,SAAS,eAAe,QAAA,EAA4D;AAElF,EAAA,IAAI,OAAO,aAAa,QAAA,EAAU;AAChC,IAAA,OAAO,QAAA;AAAA,EACT;AAGA,EAAA,
|
|
1
|
+
{"version":3,"file":"logger.js","sources":["../../src/logger.ts"],"sourcesContent":["import { isObjectLike, logger as sentryLogger, SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN } from '@sentry/core';\nimport * as Logger from 'effect/Logger';\nimport type * as LogLevel from 'effect/LogLevel';\n\nconst LOG_ATTRIBUTES = {\n [SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN]: 'auto.log.effect',\n};\n\nfunction getLogLevelTag(logLevel: LogLevel.LogLevel): LogLevel.LogLevel | 'Warning' {\n // Effect v4: logLevel is a string literal directly\n if (typeof logLevel === 'string') {\n return logLevel;\n }\n\n // Effect v3: logLevel has _tag property\n if (isObjectLike(logLevel) && '_tag' in logLevel) {\n return (logLevel as { _tag: LogLevel.LogLevel })._tag;\n }\n\n return 'Info';\n}\n\n/**\n * Effect Logger that sends logs to Sentry.\n */\nexport const SentryEffectLogger = Logger.make(({ logLevel, message }) => {\n let msg: string;\n if (typeof message === 'string') {\n msg = message;\n } else if (Array.isArray(message) && message.length === 1) {\n const firstElement = message[0];\n msg = typeof firstElement === 'string' ? firstElement : JSON.stringify(firstElement);\n } else {\n msg = JSON.stringify(message);\n }\n\n const tag = getLogLevelTag(logLevel);\n\n switch (tag) {\n case 'Fatal':\n sentryLogger.fatal(msg, LOG_ATTRIBUTES);\n break;\n case 'Error':\n sentryLogger.error(msg, LOG_ATTRIBUTES);\n break;\n case 'Warning': // Effect v3\n case 'Warn': // Effect v4\n sentryLogger.warn(msg, LOG_ATTRIBUTES);\n break;\n case 'Info':\n sentryLogger.info(msg, LOG_ATTRIBUTES);\n break;\n case 'Debug':\n sentryLogger.debug(msg, LOG_ATTRIBUTES);\n break;\n case 'Trace':\n sentryLogger.trace(msg, LOG_ATTRIBUTES);\n break;\n case 'All':\n case 'None':\n break;\n default:\n tag satisfies never;\n }\n});\n"],"names":["SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN","isObjectLike","sentryLogger"],"mappings":";;;;;AAIA,MAAM,cAAA,GAAiB;AAAA,EACrB,CAACA,qCAAgC,GAAG;AACtC,CAAA;AAEA,SAAS,eAAe,QAAA,EAA4D;AAElF,EAAA,IAAI,OAAO,aAAa,QAAA,EAAU;AAChC,IAAA,OAAO,QAAA;AAAA,EACT;AA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A;AACH,MAAAA,WAAA,CAAa,KAAA,CAAM,KAAK,cAAc,CAAA;AACtC,MAAA;AAKA;AAEN,CAAC;;;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":["../../../src/server/index.ts"],"sourcesContent":["import type { NodeOptions } from '@sentry/node
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../../../src/server/index.ts"],"sourcesContent":["import type { NodeOptions } from '@sentry/node';\nimport type * as EffectLayer from 'effect/Layer';\nimport { empty as emptyLayer, suspend as suspendLayer } from 'effect/Layer';\nimport { init } from './sdk';\n\nexport { init } from './sdk';\n\n/**\n * Options for the Sentry Effect server layer.\n */\nexport type EffectServerLayerOptions = NodeOptions;\n\n/**\n * Creates an Effect Layer that initializes Sentry for Node.js servers.\n *\n * To enable Effect tracing, logs, or metrics, compose with the respective layers:\n * - `Layer.setTracer(Sentry.SentryEffectTracer)` for tracing\n * - `Logger.replace(Logger.defaultLogger, Sentry.SentryEffectLogger)` for logs\n * - `Sentry.SentryEffectMetricsLayer` for metrics\n *\n * @example\n * ```typescript\n * import * as Sentry from '@sentry/effect/server';\n * import { NodeRuntime } from '@effect/platform-node';\n * import { Layer, Logger } from 'effect';\n * import { HttpLive } from './Http.js';\n *\n * const SentryLive = Layer.mergeAll(\n * Sentry.effectLayer({ dsn: '__DSN__' }),\n * Layer.setTracer(Sentry.SentryEffectTracer),\n * Logger.replace(Logger.defaultLogger, Sentry.SentryEffectLogger),\n * );\n *\n * const MainLive = HttpLive.pipe(Layer.provide(SentryLive));\n * MainLive.pipe(Layer.launch, NodeRuntime.runMain);\n * ```\n */\nexport function effectLayer(options: EffectServerLayerOptions): EffectLayer.Layer<never, never, never> {\n return suspendLayer(() => {\n init(options);\n return emptyLayer;\n });\n}\n"],"names":["suspendLayer","init","emptyLayer"],"mappings":";;;;;AAqCO,SAAS,YAAY,OAAA,EAA2E;AACrG,EAAA,OAAOA,cAAa,MAAM;AACxB,IAAAC,QAAA,CAAK,OAAO,CAAA;AACZ,IAAA,OAAOC,WAAA;AAAA,EACT,CAAC,CAAA;AACH;;;;;"}
|
package/build/cjs/server/sdk.js
CHANGED
|
@@ -1,14 +1,17 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
2
2
|
|
|
3
3
|
const core = require('@sentry/core');
|
|
4
|
-
const
|
|
4
|
+
const node = require('@sentry/node');
|
|
5
5
|
|
|
6
6
|
function init(options) {
|
|
7
7
|
const opts = {
|
|
8
|
-
...options
|
|
8
|
+
...options,
|
|
9
|
+
// The Effect SDK provides its own tracing (`SentryEffectTracer`), logging and error capture, so
|
|
10
|
+
// node's auto-instrumentation default integrations should not additionally create spans.
|
|
11
|
+
defaultIntegrations: options.defaultIntegrations ?? false
|
|
9
12
|
};
|
|
10
|
-
core.applySdkMetadata(opts, "effect", ["effect", "node
|
|
11
|
-
return
|
|
13
|
+
core.applySdkMetadata(opts, "effect", ["effect", "node"]);
|
|
14
|
+
return node.init(opts);
|
|
12
15
|
}
|
|
13
16
|
|
|
14
17
|
exports.init = init;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sdk.js","sources":["../../../src/server/sdk.ts"],"sourcesContent":["import type { Client } from '@sentry/core';\nimport { applySdkMetadata } from '@sentry/core';\nimport type { NodeOptions } from '@sentry/node
|
|
1
|
+
{"version":3,"file":"sdk.js","sources":["../../../src/server/sdk.ts"],"sourcesContent":["import type { Client } from '@sentry/core';\nimport { applySdkMetadata } from '@sentry/core';\nimport type { NodeOptions } from '@sentry/node';\nimport { init as initNode } from '@sentry/node';\n\n/**\n * Initializes the Sentry Effect SDK for Node.js servers.\n *\n * @param options - Configuration options for the SDK\n * @returns The initialized Sentry client, or undefined if initialization failed\n */\nexport function init(options: NodeOptions): Client | undefined {\n const opts = {\n ...options,\n // The Effect SDK provides its own tracing (`SentryEffectTracer`), logging and error capture, so\n // node's auto-instrumentation default integrations should not additionally create spans.\n defaultIntegrations: options.defaultIntegrations ?? false,\n };\n\n applySdkMetadata(opts, 'effect', ['effect', 'node']);\n\n return initNode(opts);\n}\n"],"names":["applySdkMetadata","initNode"],"mappings":";;;;;AAWO,SAAS,KAAK,OAAA,EAA0C;AAC7D,EAAA,MAAM,IAAA,GAAO;AAAA,IACX,GAAG,OAAA;AAAA;AAAA;AAAA,IAGH,mBAAA,EAAqB,QAAQ,mBAAA,IAAuB;AAAA,GACtD;AAEA,EAAAA,qBAAA,CAAiB,IAAA,EAAM,QAAA,EAAU,CAAC,QAAA,EAAU,MAAM,CAAC,CAAA;AAEnD,EAAA,OAAOC,UAAS,IAAI,CAAA;AACtB;;;;"}
|
package/build/esm/logger.js
CHANGED
|
@@ -1,6 +1,9 @@
|
|
|
1
|
-
import { logger, isObjectLike } from '@sentry/core';
|
|
1
|
+
import { logger, isObjectLike, SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN } from '@sentry/core';
|
|
2
2
|
import * as Logger from 'effect/Logger';
|
|
3
3
|
|
|
4
|
+
const LOG_ATTRIBUTES = {
|
|
5
|
+
[SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN]: "auto.log.effect"
|
|
6
|
+
};
|
|
4
7
|
function getLogLevelTag(logLevel) {
|
|
5
8
|
if (typeof logLevel === "string") {
|
|
6
9
|
return logLevel;
|
|
@@ -23,24 +26,24 @@ const SentryEffectLogger = Logger.make(({ logLevel, message }) => {
|
|
|
23
26
|
const tag = getLogLevelTag(logLevel);
|
|
24
27
|
switch (tag) {
|
|
25
28
|
case "Fatal":
|
|
26
|
-
logger.fatal(msg);
|
|
29
|
+
logger.fatal(msg, LOG_ATTRIBUTES);
|
|
27
30
|
break;
|
|
28
31
|
case "Error":
|
|
29
|
-
logger.error(msg);
|
|
32
|
+
logger.error(msg, LOG_ATTRIBUTES);
|
|
30
33
|
break;
|
|
31
34
|
case "Warning":
|
|
32
35
|
// Effect v3
|
|
33
36
|
case "Warn":
|
|
34
|
-
logger.warn(msg);
|
|
37
|
+
logger.warn(msg, LOG_ATTRIBUTES);
|
|
35
38
|
break;
|
|
36
39
|
case "Info":
|
|
37
|
-
logger.info(msg);
|
|
40
|
+
logger.info(msg, LOG_ATTRIBUTES);
|
|
38
41
|
break;
|
|
39
42
|
case "Debug":
|
|
40
|
-
logger.debug(msg);
|
|
43
|
+
logger.debug(msg, LOG_ATTRIBUTES);
|
|
41
44
|
break;
|
|
42
45
|
case "Trace":
|
|
43
|
-
logger.trace(msg);
|
|
46
|
+
logger.trace(msg, LOG_ATTRIBUTES);
|
|
44
47
|
break;
|
|
45
48
|
}
|
|
46
49
|
});
|
package/build/esm/logger.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"logger.js","sources":["../../src/logger.ts"],"sourcesContent":["import { isObjectLike, logger as sentryLogger } from '@sentry/core';\nimport * as Logger from 'effect/Logger';\nimport type * as LogLevel from 'effect/LogLevel';\n\nfunction getLogLevelTag(logLevel: LogLevel.LogLevel): LogLevel.LogLevel | 'Warning' {\n // Effect v4: logLevel is a string literal directly\n if (typeof logLevel === 'string') {\n return logLevel;\n }\n\n // Effect v3: logLevel has _tag property\n if (isObjectLike(logLevel) && '_tag' in logLevel) {\n return (logLevel as { _tag: LogLevel.LogLevel })._tag;\n }\n\n return 'Info';\n}\n\n/**\n * Effect Logger that sends logs to Sentry.\n */\nexport const SentryEffectLogger = Logger.make(({ logLevel, message }) => {\n let msg: string;\n if (typeof message === 'string') {\n msg = message;\n } else if (Array.isArray(message) && message.length === 1) {\n const firstElement = message[0];\n msg = typeof firstElement === 'string' ? firstElement : JSON.stringify(firstElement);\n } else {\n msg = JSON.stringify(message);\n }\n\n const tag = getLogLevelTag(logLevel);\n\n switch (tag) {\n case 'Fatal':\n sentryLogger.fatal(msg);\n break;\n case 'Error':\n sentryLogger.error(msg);\n break;\n case 'Warning': // Effect v3\n case 'Warn': // Effect v4\n sentryLogger.warn(msg);\n break;\n case 'Info':\n sentryLogger.info(msg);\n break;\n case 'Debug':\n sentryLogger.debug(msg);\n break;\n case 'Trace':\n sentryLogger.trace(msg);\n break;\n case 'All':\n case 'None':\n break;\n default:\n tag satisfies never;\n }\n});\n"],"names":["sentryLogger"],"mappings":";;;AAIA,SAAS,eAAe,QAAA,EAA4D;AAElF,EAAA,IAAI,OAAO,aAAa,QAAA,EAAU;AAChC,IAAA,OAAO,QAAA;AAAA,EACT;AAGA,EAAA,IAAI,YAAA,CAAa,QAAQ,CAAA,IAAK,MAAA,IAAU,QAAA,EAAU;AAChD,IAAA,OAAQ,QAAA,CAAyC,IAAA;AAAA,EACnD;AAEA,EAAA,OAAO,MAAA;AACT;AAKO,MAAM,qBAAqB,MAAA,CAAO,IAAA,CAAK,CAAC,EAAE,QAAA,EAAU,SAAQ,KAAM;AACvE,EAAA,IAAI,GAAA;AACJ,EAAA,IAAI,OAAO,YAAY,QAAA,EAAU;AAC/B,IAAA,GAAA,GAAM,OAAA;AAAA,EACR,WAAW,KAAA,CAAM,OAAA,CAAQ,OAAO,CAAA,IAAK,OAAA,CAAQ,WAAW,CAAA,EAAG;AACzD,IAAA,MAAM,YAAA,GAAe,QAAQ,CAAC,CAAA;AAC9B,IAAA,GAAA,GAAM,OAAO,YAAA,KAAiB,QAAA,GAAW,YAAA,GAAe,IAAA,CAAK,UAAU,YAAY,CAAA;AAAA,EACrF,CAAA,MAAO;AACL,IAAA,GAAA,GAAM,IAAA,CAAK,UAAU,OAAO,CAAA;AAAA,EAC9B;AAEA,EAAA,MAAM,GAAA,GAAM,eAAe,QAAQ,CAAA;AAEnC,EAAA,QAAQ,GAAA;AAAK,IACX,KAAK,OAAA;AACH,MAAAA,MAAA,CAAa,
|
|
1
|
+
{"version":3,"file":"logger.js","sources":["../../src/logger.ts"],"sourcesContent":["import { isObjectLike, logger as sentryLogger, SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN } from '@sentry/core';\nimport * as Logger from 'effect/Logger';\nimport type * as LogLevel from 'effect/LogLevel';\n\nconst LOG_ATTRIBUTES = {\n [SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN]: 'auto.log.effect',\n};\n\nfunction getLogLevelTag(logLevel: LogLevel.LogLevel): LogLevel.LogLevel | 'Warning' {\n // Effect v4: logLevel is a string literal directly\n if (typeof logLevel === 'string') {\n return logLevel;\n }\n\n // Effect v3: logLevel has _tag property\n if (isObjectLike(logLevel) && '_tag' in logLevel) {\n return (logLevel as { _tag: LogLevel.LogLevel })._tag;\n }\n\n return 'Info';\n}\n\n/**\n * Effect Logger that sends logs to Sentry.\n */\nexport const SentryEffectLogger = Logger.make(({ logLevel, message }) => {\n let msg: string;\n if (typeof message === 'string') {\n msg = message;\n } else if (Array.isArray(message) && message.length === 1) {\n const firstElement = message[0];\n msg = typeof firstElement === 'string' ? firstElement : JSON.stringify(firstElement);\n } else {\n msg = JSON.stringify(message);\n }\n\n const tag = getLogLevelTag(logLevel);\n\n switch (tag) {\n case 'Fatal':\n sentryLogger.fatal(msg, LOG_ATTRIBUTES);\n break;\n case 'Error':\n sentryLogger.error(msg, LOG_ATTRIBUTES);\n break;\n case 'Warning': // Effect v3\n case 'Warn': // Effect v4\n sentryLogger.warn(msg, LOG_ATTRIBUTES);\n break;\n case 'Info':\n sentryLogger.info(msg, LOG_ATTRIBUTES);\n break;\n case 'Debug':\n sentryLogger.debug(msg, LOG_ATTRIBUTES);\n break;\n case 'Trace':\n sentryLogger.trace(msg, LOG_ATTRIBUTES);\n break;\n case 'All':\n case 'None':\n break;\n default:\n tag satisfies never;\n }\n});\n"],"names":["sentryLogger"],"mappings":";;;AAIA,MAAM,cAAA,GAAiB;AAAA,EACrB,CAAC,gCAAgC,GAAG;AACtC,CAAA;AAEA,SAAS,eAAe,QAAA,EAA4D;AAElF,EAAA,IAAI,OAAO,aAAa,QAAA,EAAU;AAChC,IAAA,OAAO,QAAA;AAAA,EACT;AAGA,EAAA,IAAI,YAAA,CAAa,QAAQ,CAAA,IAAK,MAAA,IAAU,QAAA,EAAU;AAChD,IAAA,OAAQ,QAAA,CAAyC,I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json
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"type":"module","version":"
|
|
1
|
+
{"type":"module","version":"11.0.0-alpha.0","sideEffects":false}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":["../../../src/server/index.ts"],"sourcesContent":["import type { NodeOptions } from '@sentry/node
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../../../src/server/index.ts"],"sourcesContent":["import type { NodeOptions } from '@sentry/node';\nimport type * as EffectLayer from 'effect/Layer';\nimport { empty as emptyLayer, suspend as suspendLayer } from 'effect/Layer';\nimport { init } from './sdk';\n\nexport { init } from './sdk';\n\n/**\n * Options for the Sentry Effect server layer.\n */\nexport type EffectServerLayerOptions = NodeOptions;\n\n/**\n * Creates an Effect Layer that initializes Sentry for Node.js servers.\n *\n * To enable Effect tracing, logs, or metrics, compose with the respective layers:\n * - `Layer.setTracer(Sentry.SentryEffectTracer)` for tracing\n * - `Logger.replace(Logger.defaultLogger, Sentry.SentryEffectLogger)` for logs\n * - `Sentry.SentryEffectMetricsLayer` for metrics\n *\n * @example\n * ```typescript\n * import * as Sentry from '@sentry/effect/server';\n * import { NodeRuntime } from '@effect/platform-node';\n * import { Layer, Logger } from 'effect';\n * import { HttpLive } from './Http.js';\n *\n * const SentryLive = Layer.mergeAll(\n * Sentry.effectLayer({ dsn: '__DSN__' }),\n * Layer.setTracer(Sentry.SentryEffectTracer),\n * Logger.replace(Logger.defaultLogger, Sentry.SentryEffectLogger),\n * );\n *\n * const MainLive = HttpLive.pipe(Layer.provide(SentryLive));\n * MainLive.pipe(Layer.launch, NodeRuntime.runMain);\n * ```\n */\nexport function effectLayer(options: EffectServerLayerOptions): EffectLayer.Layer<never, never, never> {\n return suspendLayer(() => {\n init(options);\n return emptyLayer;\n });\n}\n"],"names":["suspendLayer","emptyLayer"],"mappings":";;;AAqCO,SAAS,YAAY,OAAA,EAA2E;AACrG,EAAA,OAAOA,QAAa,MAAM;AACxB,IAAA,IAAA,CAAK,OAAO,CAAA;AACZ,IAAA,OAAOC,KAAA;AAAA,EACT,CAAC,CAAA;AACH;;;;"}
|
package/build/esm/server/sdk.js
CHANGED
|
@@ -1,11 +1,14 @@
|
|
|
1
1
|
import { applySdkMetadata } from '@sentry/core';
|
|
2
|
-
import { init as init$1 } from '@sentry/node
|
|
2
|
+
import { init as init$1 } from '@sentry/node';
|
|
3
3
|
|
|
4
4
|
function init(options) {
|
|
5
5
|
const opts = {
|
|
6
|
-
...options
|
|
6
|
+
...options,
|
|
7
|
+
// The Effect SDK provides its own tracing (`SentryEffectTracer`), logging and error capture, so
|
|
8
|
+
// node's auto-instrumentation default integrations should not additionally create spans.
|
|
9
|
+
defaultIntegrations: options.defaultIntegrations ?? false
|
|
7
10
|
};
|
|
8
|
-
applySdkMetadata(opts, "effect", ["effect", "node
|
|
11
|
+
applySdkMetadata(opts, "effect", ["effect", "node"]);
|
|
9
12
|
return init$1(opts);
|
|
10
13
|
}
|
|
11
14
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sdk.js","sources":["../../../src/server/sdk.ts"],"sourcesContent":["import type { Client } from '@sentry/core';\nimport { applySdkMetadata } from '@sentry/core';\nimport type { NodeOptions } from '@sentry/node
|
|
1
|
+
{"version":3,"file":"sdk.js","sources":["../../../src/server/sdk.ts"],"sourcesContent":["import type { Client } from '@sentry/core';\nimport { applySdkMetadata } from '@sentry/core';\nimport type { NodeOptions } from '@sentry/node';\nimport { init as initNode } from '@sentry/node';\n\n/**\n * Initializes the Sentry Effect SDK for Node.js servers.\n *\n * @param options - Configuration options for the SDK\n * @returns The initialized Sentry client, or undefined if initialization failed\n */\nexport function init(options: NodeOptions): Client | undefined {\n const opts = {\n ...options,\n // The Effect SDK provides its own tracing (`SentryEffectTracer`), logging and error capture, so\n // node's auto-instrumentation default integrations should not additionally create spans.\n defaultIntegrations: options.defaultIntegrations ?? false,\n };\n\n applySdkMetadata(opts, 'effect', ['effect', 'node']);\n\n return initNode(opts);\n}\n"],"names":["initNode"],"mappings":";;;AAWO,SAAS,KAAK,OAAA,EAA0C;AAC7D,EAAA,MAAM,IAAA,GAAO;AAAA,IACX,GAAG,OAAA;AAAA;AAAA;AAAA,IAGH,mBAAA,EAAqB,QAAQ,mBAAA,IAAuB;AAAA,GACtD;AAEA,EAAA,gBAAA,CAAiB,IAAA,EAAM,QAAA,EAAU,CAAC,QAAA,EAAU,MAAM,CAAC,CAAA;AAEnD,EAAA,OAAOA,OAAS,IAAI,CAAA;AACtB;;;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.server.d.ts","sourceRoot":"","sources":["../../src/index.server.ts"],"names":[],"mappings":"AAAA,cAAc,
|
|
1
|
+
{"version":3,"file":"index.server.d.ts","sourceRoot":"","sources":["../../src/index.server.ts"],"names":[],"mappings":"AAAA,cAAc,cAAc,CAAC;AAE7B,OAAO,EAAE,WAAW,EAAE,IAAI,EAAE,MAAM,gBAAgB,CAAC;AACnD,YAAY,EAAE,wBAAwB,EAAE,MAAM,gBAAgB,CAAC;AAE/D,OAAO,EAAE,kBAAkB,EAAE,MAAM,UAAU,CAAC;AAC9C,OAAO,EAAE,kBAAkB,EAAE,MAAM,UAAU,CAAC;AAC9C,OAAO,EAAE,wBAAwB,EAAE,MAAM,WAAW,CAAC"}
|
|
@@ -11,8 +11,16 @@ export declare function init(options: Options | clientSdk.BrowserOptions | serve
|
|
|
11
11
|
export declare const linkedErrorsIntegration: typeof clientSdk.linkedErrorsIntegration;
|
|
12
12
|
export declare const contextLinesIntegration: typeof clientSdk.contextLinesIntegration;
|
|
13
13
|
export declare const spanStreamingIntegration: typeof clientSdk.spanStreamingIntegration;
|
|
14
|
+
export declare const withStaticSpan: typeof clientSdk.withStaticSpan;
|
|
14
15
|
export declare const withStreamedSpan: typeof clientSdk.withStreamedSpan;
|
|
15
16
|
export declare const getDefaultIntegrations: (options: Options) => Integration[];
|
|
16
17
|
export declare const defaultStackParser: StackParser;
|
|
17
18
|
export declare const logger: typeof clientSdk.logger | typeof serverSdk.logger;
|
|
19
|
+
export declare const launchDarklyIntegration: typeof clientSdk.launchDarklyIntegration;
|
|
20
|
+
export declare const buildLaunchDarklyFlagUsedHandler: typeof clientSdk.buildLaunchDarklyFlagUsedHandler;
|
|
21
|
+
export declare const openFeatureIntegration: typeof clientSdk.openFeatureIntegration;
|
|
22
|
+
export declare const OpenFeatureIntegrationHook: typeof clientSdk.OpenFeatureIntegrationHook;
|
|
23
|
+
export declare const unleashIntegration: typeof clientSdk.unleashIntegration;
|
|
24
|
+
export declare const growthbookIntegration: typeof clientSdk.growthbookIntegration;
|
|
25
|
+
export declare const statsigIntegration: typeof clientSdk.statsigIntegration;
|
|
18
26
|
//# sourceMappingURL=index.types.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.types.d.ts","sourceRoot":"","sources":["../../src/index.types.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,MAAM,EAAE,WAAW,EAAE,OAAO,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;AAC9E,OAAO,KAAK,KAAK,WAAW,MAAM,cAAc,CAAC;AACjD,OAAO,KAAK,KAAK,SAAS,MAAM,gBAAgB,CAAC;AACjD,OAAO,KAAK,KAAK,SAAS,MAAM,gBAAgB,CAAC;AAEjD,cAAc,gBAAgB,CAAC;AAC/B,cAAc,gBAAgB,CAAC;AAE/B,YAAY,EAAE,wBAAwB,EAAE,MAAM,gBAAgB,CAAC;AAC/D,YAAY,EAAE,wBAAwB,EAAE,MAAM,gBAAgB,CAAC;AAE/D,MAAM,CAAC,OAAO,UAAU,WAAW,CACjC,OAAO,EAAE,SAAS,CAAC,wBAAwB,GAAG,SAAS,CAAC,wBAAwB,GAC/E,WAAW,CAAC,KAAK,CAAC,KAAK,EAAE,KAAK,EAAE,KAAK,CAAC,CAAC;AAE1C,MAAM,CAAC,OAAO,UAAU,IAAI,CAAC,OAAO,EAAE,OAAO,GAAG,SAAS,CAAC,cAA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,CAAC;AAC7F,MAAM,CAAC,OAAO,CAAC,MAAM,kBAAkB,EAAE,OAAO,SAAS,CAAC,kBAAkB,CAAC;AAC7E,MAAM,CAAC,OAAO,CAAC,MAAM,qBAAqB,EAAE,OAAO,SAAS,CAAC,qBAAqB,CAAC;AACnF,MAAM,CAAC,OAAO,CAAC,MAAM,kBAAkB,EAAE,OAAO,SAAS,CAAC,kBAAkB,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"logger.d.ts","sourceRoot":"","sources":["../../src/logger.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,MAAM,MAAM,eAAe,CAAC;
|
|
1
|
+
{"version":3,"file":"logger.d.ts","sourceRoot":"","sources":["../../src/logger.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,MAAM,MAAM,eAAe,CAAC;AAqBxC;;GAEG;AACH,eAAO,MAAM,kBAAkB,8BAuC7B,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/server/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/server/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;AAChD,OAAO,KAAK,KAAK,WAAW,MAAM,cAAc,CAAC;AAIjD,OAAO,EAAE,IAAI,EAAE,MAAM,OAAO,CAAC;AAE7B;;GAEG;AACH,MAAM,MAAM,wBAAwB,GAAG,WAAW,CAAC;AAEnD;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AACH,wBAAgB,WAAW,CAAC,OAAO,EAAE,wBAAwB,GAAG,WAAW,CAAC,KAAK,CAAC,KAAK,EAAE,KAAK,EAAE,KAAK,CAAC,CAKrG"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sdk.d.ts","sourceRoot":"","sources":["../../../src/server/sdk.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,cAAc,CAAC;AAE3C,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"sdk.d.ts","sourceRoot":"","sources":["../../../src/server/sdk.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,cAAc,CAAC;AAE3C,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;AAGhD;;;;;GAKG;AACH,wBAAgB,IAAI,CAAC,OAAO,EAAE,WAAW,GAAG,MAAM,GAAG,SAAS,CAW7D"}
|
package/package.json
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sentry/effect",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "11.0.0-alpha.0",
|
|
4
4
|
"description": "Official Sentry SDK for Effect",
|
|
5
5
|
"repository": "git://github.com/getsentry/sentry-javascript.git",
|
|
6
6
|
"homepage": "https://github.com/getsentry/sentry-javascript/tree/master/packages/effect",
|
|
7
7
|
"author": "Sentry",
|
|
8
8
|
"license": "MIT",
|
|
9
9
|
"engines": {
|
|
10
|
-
"node": ">=
|
|
10
|
+
"node": ">=20.19.0 <22.0.0 || >=22.12.0 <23.0.0 || >=23.2.0"
|
|
11
11
|
},
|
|
12
12
|
"files": [
|
|
13
13
|
"/build"
|
|
@@ -40,26 +40,13 @@
|
|
|
40
40
|
"require": "./build/cjs/index.client.js"
|
|
41
41
|
}
|
|
42
42
|
},
|
|
43
|
-
"typesVersions": {
|
|
44
|
-
"<5.0": {
|
|
45
|
-
"build/types/index.types.d.ts": [
|
|
46
|
-
"build/types-ts3.8/index.types.d.ts"
|
|
47
|
-
],
|
|
48
|
-
"build/types/index.server.d.ts": [
|
|
49
|
-
"build/types-ts3.8/index.server.d.ts"
|
|
50
|
-
],
|
|
51
|
-
"build/types/index.client.d.ts": [
|
|
52
|
-
"build/types-ts3.8/index.client.d.ts"
|
|
53
|
-
]
|
|
54
|
-
}
|
|
55
|
-
},
|
|
56
43
|
"publishConfig": {
|
|
57
44
|
"access": "public"
|
|
58
45
|
},
|
|
59
46
|
"dependencies": {
|
|
60
|
-
"@sentry/browser": "
|
|
61
|
-
"@sentry/core": "
|
|
62
|
-
"@sentry/node
|
|
47
|
+
"@sentry/browser": "11.0.0-alpha.0",
|
|
48
|
+
"@sentry/core": "11.0.0-alpha.0",
|
|
49
|
+
"@sentry/node": "11.0.0-alpha.0"
|
|
63
50
|
},
|
|
64
51
|
"peerDependencies": {
|
|
65
52
|
"effect": "^3.0.0 || ^4.0.0-beta.50"
|
|
@@ -77,17 +64,15 @@
|
|
|
77
64
|
"build": "run-p build:transpile build:types",
|
|
78
65
|
"build:dev": "yarn build",
|
|
79
66
|
"build:transpile": "rollup -c rollup.npm.config.mjs",
|
|
80
|
-
"build:types": "
|
|
81
|
-
"build:types:core": "tsc -p tsconfig.types.json",
|
|
82
|
-
"build:types:downlevel": "yarn downlevel-dts build/types build/types-ts3.8 --to ts3.8",
|
|
67
|
+
"build:types": "tsc -p tsconfig.types.json",
|
|
83
68
|
"build:watch": "run-p build:transpile:watch",
|
|
84
69
|
"build:dev:watch": "yarn build:watch",
|
|
85
70
|
"build:transpile:watch": "rollup -c rollup.npm.config.mjs --watch",
|
|
86
71
|
"build:tarball": "npm pack",
|
|
87
72
|
"circularDepCheck": "madge --circular src/index.client.ts && madge --circular src/index.server.ts && madge --circular src/index.types.ts",
|
|
88
73
|
"clean": "rimraf build coverage sentry-effect-*.tgz",
|
|
89
|
-
"fix": "
|
|
90
|
-
"lint": "
|
|
74
|
+
"lint:fix": "oxlint . --fix --type-aware",
|
|
75
|
+
"lint": "oxlint . --type-aware",
|
|
91
76
|
"test": "vitest run",
|
|
92
77
|
"test:watch": "vitest --watch",
|
|
93
78
|
"yalc:publish": "yalc publish --push --sig"
|
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
import { BrowserOptions } from '@sentry/browser';
|
|
2
|
-
import * as EffectLayer from 'effect/Layer';
|
|
3
|
-
export { init } from './sdk';
|
|
4
|
-
/**
|
|
5
|
-
* Options for the Sentry Effect client layer.
|
|
6
|
-
*/
|
|
7
|
-
export type EffectClientLayerOptions = BrowserOptions;
|
|
8
|
-
/**
|
|
9
|
-
* Creates an Effect Layer that initializes Sentry for browser clients.
|
|
10
|
-
*
|
|
11
|
-
* To enable Effect tracing, logs, or metrics, compose with the respective layers:
|
|
12
|
-
* - `Layer.setTracer(Sentry.SentryEffectTracer)` for tracing
|
|
13
|
-
* - `Logger.replace(Logger.defaultLogger, Sentry.SentryEffectLogger)` for logs
|
|
14
|
-
* - `Sentry.SentryEffectMetricsLayer` for metrics
|
|
15
|
-
*
|
|
16
|
-
* @example
|
|
17
|
-
* ```typescript
|
|
18
|
-
* import * as Sentry from '@sentry/effect/client';
|
|
19
|
-
* import { Layer, Logger, LogLevel } from 'effect';
|
|
20
|
-
*
|
|
21
|
-
* const SentryLive = Layer.mergeAll(
|
|
22
|
-
* Sentry.effectLayer({
|
|
23
|
-
* dsn: '__DSN__',
|
|
24
|
-
* integrations: [Sentry.browserTracingIntegration()],
|
|
25
|
-
* tracesSampleRate: 1.0,
|
|
26
|
-
* }),
|
|
27
|
-
* Layer.setTracer(Sentry.SentryEffectTracer),
|
|
28
|
-
* Logger.replace(Logger.defaultLogger, Sentry.SentryEffectLogger),
|
|
29
|
-
* );
|
|
30
|
-
* ```
|
|
31
|
-
*/
|
|
32
|
-
export declare function effectLayer(options: EffectClientLayerOptions): EffectLayer.Layer<never, never, never>;
|
|
33
|
-
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import { BrowserOptions } from '@sentry/browser';
|
|
2
|
-
import { Client } from '@sentry/core';
|
|
3
|
-
/**
|
|
4
|
-
* Initializes the Sentry Effect SDK for browser clients.
|
|
5
|
-
*
|
|
6
|
-
* @param options - Configuration options for the SDK
|
|
7
|
-
* @returns The initialized Sentry client, or undefined if initialization failed
|
|
8
|
-
*/
|
|
9
|
-
export declare function init(options: BrowserOptions): Client | undefined;
|
|
10
|
-
//# sourceMappingURL=sdk.d.ts.map
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
export * from '@sentry/browser';
|
|
2
|
-
export { effectLayer, init } from './client/index';
|
|
3
|
-
export { EffectClientLayerOptions } from './client/index';
|
|
4
|
-
export { SentryEffectTracer } from './tracer';
|
|
5
|
-
export { SentryEffectLogger } from './logger';
|
|
6
|
-
export { SentryEffectMetricsLayer } from './metrics';
|
|
7
|
-
//# sourceMappingURL=index.client.d.ts.map
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
export * from '@sentry/node-core/light';
|
|
2
|
-
export { effectLayer, init } from './server/index';
|
|
3
|
-
export { EffectServerLayerOptions } from './server/index';
|
|
4
|
-
export { SentryEffectTracer } from './tracer';
|
|
5
|
-
export { SentryEffectLogger } from './logger';
|
|
6
|
-
export { SentryEffectMetricsLayer } from './metrics';
|
|
7
|
-
//# sourceMappingURL=index.server.d.ts.map
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
import { Client, Integration, Options, StackParser } from '@sentry/core';
|
|
2
|
-
import * as EffectLayer from 'effect/Layer';
|
|
3
|
-
import * as clientSdk from './index.client';
|
|
4
|
-
import * as serverSdk from './index.server';
|
|
5
|
-
export * from './index.client';
|
|
6
|
-
export * from './index.server';
|
|
7
|
-
export { EffectClientLayerOptions } from './index.client';
|
|
8
|
-
export { EffectServerLayerOptions } from './index.server';
|
|
9
|
-
export declare function effectLayer(options: clientSdk.EffectClientLayerOptions | serverSdk.EffectServerLayerOptions): EffectLayer.Layer<never, never, never>;
|
|
10
|
-
export declare function init(options: Options | clientSdk.BrowserOptions | serverSdk.NodeOptions): Client | undefined;
|
|
11
|
-
export declare const linkedErrorsIntegration: typeof clientSdk.linkedErrorsIntegration;
|
|
12
|
-
export declare const contextLinesIntegration: typeof clientSdk.contextLinesIntegration;
|
|
13
|
-
export declare const spanStreamingIntegration: typeof clientSdk.spanStreamingIntegration;
|
|
14
|
-
export declare const withStreamedSpan: typeof clientSdk.withStreamedSpan;
|
|
15
|
-
export declare const getDefaultIntegrations: (options: Options) => Integration[];
|
|
16
|
-
export declare const defaultStackParser: StackParser;
|
|
17
|
-
export declare const logger: typeof clientSdk.logger | typeof serverSdk.logger;
|
|
18
|
-
//# sourceMappingURL=index.types.d.ts.map
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import * as Layer from 'effect/Layer';
|
|
2
|
-
/**
|
|
3
|
-
* Effect Layer that periodically flushes metrics to Sentry.
|
|
4
|
-
* The layer manages its own state for delta counter calculations,
|
|
5
|
-
* which is automatically cleaned up when the layer is finalized.
|
|
6
|
-
*/
|
|
7
|
-
export declare const SentryEffectMetricsLayer: Layer.Layer<never, never, never>;
|
|
8
|
-
//# sourceMappingURL=metrics.d.ts.map
|
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
import { NodeOptions } from '@sentry/node-core/light';
|
|
2
|
-
import * as EffectLayer from 'effect/Layer';
|
|
3
|
-
export { init } from './sdk';
|
|
4
|
-
/**
|
|
5
|
-
* Options for the Sentry Effect server layer.
|
|
6
|
-
*/
|
|
7
|
-
export type EffectServerLayerOptions = NodeOptions;
|
|
8
|
-
/**
|
|
9
|
-
* Creates an Effect Layer that initializes Sentry for Node.js servers.
|
|
10
|
-
*
|
|
11
|
-
* To enable Effect tracing, logs, or metrics, compose with the respective layers:
|
|
12
|
-
* - `Layer.setTracer(Sentry.SentryEffectTracer)` for tracing
|
|
13
|
-
* - `Logger.replace(Logger.defaultLogger, Sentry.SentryEffectLogger)` for logs
|
|
14
|
-
* - `Sentry.SentryEffectMetricsLayer` for metrics
|
|
15
|
-
*
|
|
16
|
-
* @example
|
|
17
|
-
* ```typescript
|
|
18
|
-
* import * as Sentry from '@sentry/effect/server';
|
|
19
|
-
* import { NodeRuntime } from '@effect/platform-node';
|
|
20
|
-
* import { Layer, Logger } from 'effect';
|
|
21
|
-
* import { HttpLive } from './Http.js';
|
|
22
|
-
*
|
|
23
|
-
* const SentryLive = Layer.mergeAll(
|
|
24
|
-
* Sentry.effectLayer({ dsn: '__DSN__' }),
|
|
25
|
-
* Layer.setTracer(Sentry.SentryEffectTracer),
|
|
26
|
-
* Logger.replace(Logger.defaultLogger, Sentry.SentryEffectLogger),
|
|
27
|
-
* );
|
|
28
|
-
*
|
|
29
|
-
* const MainLive = HttpLive.pipe(Layer.provide(SentryLive));
|
|
30
|
-
* MainLive.pipe(Layer.launch, NodeRuntime.runMain);
|
|
31
|
-
* ```
|
|
32
|
-
*/
|
|
33
|
-
export declare function effectLayer(options: EffectServerLayerOptions): EffectLayer.Layer<never, never, never>;
|
|
34
|
-
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import { Client } from '@sentry/core';
|
|
2
|
-
import { NodeOptions } from '@sentry/node-core/light';
|
|
3
|
-
/**
|
|
4
|
-
* Initializes the Sentry Effect SDK for Node.js servers.
|
|
5
|
-
*
|
|
6
|
-
* @param options - Configuration options for the SDK
|
|
7
|
-
* @returns The initialized Sentry client, or undefined if initialization failed
|
|
8
|
-
*/
|
|
9
|
-
export declare function init(options: NodeOptions): Client | undefined;
|
|
10
|
-
//# sourceMappingURL=sdk.d.ts.map
|