@appsignal/nodejs
Advanced tools
Comparing version
@@ -1,2 +0,2 @@ | ||
import { Metrics } from "@appsignal/types"; | ||
import { Metrics } from "./interfaces"; | ||
import { Instrumentation } from "./instrument"; | ||
@@ -3,0 +3,0 @@ /** |
@@ -1,6 +0,5 @@ | ||
import { NodeClient, Metrics, Plugin, Tracer } from "@appsignal/types"; | ||
import { Client, Metrics, Plugin, Tracer, AppsignalOptions } from "./interfaces"; | ||
import { Extension } from "./extension"; | ||
import { Configuration } from "./config"; | ||
import { Instrumentation } from "./instrument"; | ||
import { AppsignalOptions } from "./interfaces/options"; | ||
/** | ||
@@ -14,5 +13,5 @@ * AppSignal for Node.js's main class. | ||
*/ | ||
export declare class Client implements NodeClient { | ||
export declare class BaseClient implements Client { | ||
#private; | ||
readonly VERSION = "2.1.1"; | ||
readonly VERSION = "2.2.0"; | ||
config: Configuration; | ||
@@ -19,0 +18,0 @@ extension: Extension; |
"use strict"; | ||
var _tracer, _metrics; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.Client = void 0; | ||
exports.BaseClient = void 0; | ||
const tslib_1 = require("tslib"); | ||
@@ -23,3 +23,3 @@ const extension_1 = require("./extension"); | ||
*/ | ||
class Client { | ||
class BaseClient { | ||
/** | ||
@@ -129,3 +129,3 @@ * Creates a new instance of the `Appsignal` object | ||
} | ||
exports.Client = Client; | ||
exports.BaseClient = BaseClient; | ||
_tracer = new WeakMap(), _metrics = new WeakMap(); |
@@ -1,2 +0,2 @@ | ||
import { Tracer } from "@appsignal/types"; | ||
import { Tracer } from "./interfaces"; | ||
/** | ||
@@ -3,0 +3,0 @@ * Sends a demonstration/test sample for a exception and a performance issue. |
@@ -6,3 +6,4 @@ /// <reference path="../vendor.d.ts" /> | ||
*/ | ||
export { Client as Appsignal } from "./client"; | ||
export { BaseClient as Appsignal } from "./client"; | ||
export * from "./interfaces"; | ||
export { EXPERIMENTAL } from "./experimental"; |
@@ -5,2 +5,3 @@ "use strict"; | ||
exports.EXPERIMENTAL = exports.Appsignal = void 0; | ||
const tslib_1 = require("tslib"); | ||
/** | ||
@@ -11,4 +12,5 @@ * AppSignal for Node.js | ||
var client_1 = require("./client"); | ||
Object.defineProperty(exports, "Appsignal", { enumerable: true, get: function () { return client_1.Client; } }); | ||
Object.defineProperty(exports, "Appsignal", { enumerable: true, get: function () { return client_1.BaseClient; } }); | ||
tslib_1.__exportStar(require("./interfaces"), exports); | ||
var experimental_1 = require("./experimental"); | ||
Object.defineProperty(exports, "EXPERIMENTAL", { enumerable: true, get: function () { return experimental_1.EXPERIMENTAL; } }); |
@@ -1,2 +0,2 @@ | ||
import { Plugin, Tracer, Metrics } from "@appsignal/types"; | ||
import { Plugin, Tracer, Metrics } from "./interfaces"; | ||
import Hook from "require-in-the-middle"; | ||
@@ -3,0 +3,0 @@ declare type InstrumentedModule = { |
/// <reference types="node" /> | ||
import { Tracer, Plugin } from "@appsignal/types"; | ||
import { Tracer, Plugin } from "../../interfaces"; | ||
import http from "http"; | ||
@@ -4,0 +4,0 @@ declare type HttpModule = typeof http; |
/// <reference types="node" /> | ||
import { Tracer, Plugin } from "@appsignal/types"; | ||
import { Tracer, Plugin } from "../../interfaces"; | ||
import https from "https"; | ||
@@ -4,0 +4,0 @@ declare type HttpsModule = typeof https; |
@@ -6,3 +6,3 @@ /** | ||
*/ | ||
import { Tracer } from "@appsignal/types"; | ||
import { Tracer } from "../../../interfaces"; | ||
export declare function getPatchIncomingRequestFunction(tracer: Tracer): (original: (event: string, ...args: unknown[]) => boolean) => (this: {}, event: string, ...args: unknown[]) => boolean; |
@@ -7,3 +7,3 @@ /** | ||
/// <reference types="node" /> | ||
import { Tracer } from "@appsignal/types"; | ||
import { Tracer } from "../../../interfaces"; | ||
import url from "url"; | ||
@@ -10,0 +10,0 @@ import { IncomingMessage, ClientRequest, RequestOptions } from "http"; |
@@ -1,2 +0,2 @@ | ||
import { Tracer, Plugin } from "@appsignal/types"; | ||
import { Tracer, Plugin } from "../../interfaces"; | ||
import pg from "pg"; | ||
@@ -3,0 +3,0 @@ declare type PostgresModule = typeof pg; |
@@ -1,2 +0,2 @@ | ||
import { Tracer, NodeSpan } from "@appsignal/types"; | ||
import { Tracer, Span } from "../../../interfaces"; | ||
import { Submittable } from "pg"; | ||
@@ -7,5 +7,5 @@ interface Handlers { | ||
} | ||
export declare function patchCallback(tracer: Tracer, span: NodeSpan, callback: Function): import("@appsignal/types").Func<any>; | ||
export declare function patchSubmittable(tracer: Tracer, span: NodeSpan, submittable: Submittable & Handlers): Submittable; | ||
export declare function patchPromise<T>(tracer: Tracer, span: NodeSpan, promise: Promise<T>): Promise<T>; | ||
export declare function patchCallback(tracer: Tracer, span: Span, callback: Function): import("@appsignal/types").Func<any>; | ||
export declare function patchSubmittable(tracer: Tracer, span: Span, submittable: Submittable & Handlers): Submittable; | ||
export declare function patchPromise<T>(tracer: Tracer, span: Span, promise: Promise<T>): Promise<T>; | ||
export {}; |
@@ -1,2 +0,2 @@ | ||
import { Tracer, Plugin } from "@appsignal/types"; | ||
import { Tracer, Plugin } from "../../interfaces"; | ||
import redis from "redis"; | ||
@@ -3,0 +3,0 @@ export declare const PLUGIN_NAME = "redis"; |
@@ -1,2 +0,2 @@ | ||
import { Metrics, Probes } from "@appsignal/types"; | ||
import { Metrics, Probes } from "./interfaces"; | ||
/** | ||
@@ -3,0 +3,0 @@ * The metrics object. |
@@ -1,2 +0,2 @@ | ||
import { Metrics, Probes } from "@appsignal/types"; | ||
import { Metrics, Probes } from "../interfaces"; | ||
export declare class NoopMetrics implements Metrics { | ||
@@ -3,0 +3,0 @@ #private; |
@@ -1,3 +0,4 @@ | ||
import { HashMap, NodeSpan } from "@appsignal/types"; | ||
export declare class NoopSpan implements NodeSpan { | ||
import { HashMap } from "@appsignal/types"; | ||
import { Span } from "../interfaces"; | ||
export declare class NoopSpan implements Span { | ||
get traceId(): string; | ||
@@ -4,0 +5,0 @@ get spanId(): string; |
/// <reference types="node" /> | ||
import { NodeSpan, NodeSpanOptions, SpanContext, Tracer, Func } from "@appsignal/types"; | ||
import { Func } from "@appsignal/types"; | ||
import { Span, SpanOptions, SpanContext, Tracer } from "../interfaces"; | ||
import { EventEmitter } from "events"; | ||
export declare class NoopTracer implements Tracer { | ||
createSpan(options?: Partial<NodeSpanOptions>, spanOrContext?: NodeSpan | SpanContext): NodeSpan; | ||
currentSpan(): NodeSpan; | ||
rootSpan(): NodeSpan; | ||
setError(error: Error): NodeSpan; | ||
sendError<T>(error: Error, fn: (s: NodeSpan) => T): void; | ||
withSpan<T>(span: NodeSpan, fn: (s: NodeSpan) => T): T; | ||
createSpan(options?: Partial<SpanOptions>, spanOrContext?: Span | SpanContext): Span; | ||
currentSpan(): Span; | ||
rootSpan(): Span; | ||
setError(error: Error): Span; | ||
sendError<T>(error: Error, fn: (s: Span) => T): void; | ||
withSpan<T>(span: Span, fn: (s: Span) => T): T; | ||
wrap<T>(fn: Func<T>): Func<T>; | ||
wrapEmitter(emitter: EventEmitter): void; | ||
} |
/// <reference types="node" /> | ||
import { EventEmitter } from "events"; | ||
import { Probes } from "@appsignal/types"; | ||
import { Probes } from "../interfaces"; | ||
/** | ||
@@ -5,0 +5,0 @@ * The Minutely probes object. |
@@ -1,3 +0,3 @@ | ||
import { Metrics } from "@appsignal/types"; | ||
import { Metrics } from "../../interfaces"; | ||
export declare const PROBE_NAME = "v8_stats"; | ||
export declare function init(meter: Metrics): () => void; |
@@ -1,2 +0,3 @@ | ||
import { NodeSpan, NodeSpanOptions, SpanContext, HashMap, HashMapValue } from "@appsignal/types"; | ||
import { HashMap, HashMapValue } from "@appsignal/types"; | ||
import { Span, SpanOptions, SpanContext } from "./interfaces"; | ||
/** | ||
@@ -11,3 +12,3 @@ * The `Span` object represents a length of time in the flow of execution | ||
*/ | ||
export declare class BaseSpan implements NodeSpan { | ||
export declare class BaseSpan implements Span { | ||
protected _ref: unknown; | ||
@@ -33,3 +34,3 @@ /** | ||
*/ | ||
child(options?: Partial<NodeSpanOptions>): ChildSpan; | ||
child(options?: Partial<SpanOptions>): ChildSpan; | ||
/** | ||
@@ -92,4 +93,4 @@ * Sets arbitrary data on the current `Span`. | ||
export declare class ChildSpan extends BaseSpan { | ||
constructor(span: NodeSpan, options?: Partial<NodeSpanOptions>); | ||
constructor(context: SpanContext, options?: Partial<NodeSpanOptions>); | ||
constructor(span: Span, options?: Partial<SpanOptions>); | ||
constructor(context: SpanContext, options?: Partial<SpanOptions>); | ||
} | ||
@@ -101,4 +102,4 @@ /** | ||
export declare class RootSpan extends BaseSpan { | ||
constructor({ namespace, startTime }?: Partial<NodeSpanOptions>); | ||
constructor({ namespace, startTime }?: Partial<SpanOptions>); | ||
setError(error: Error): this; | ||
} |
/// <reference types="node" /> | ||
import { Tracer, NodeSpan, NodeSpanOptions, SpanContext, Func } from "@appsignal/types"; | ||
import { Func } from "@appsignal/types"; | ||
import { Tracer, Span, SpanOptions, SpanContext } from "./interfaces"; | ||
import { EventEmitter } from "events"; | ||
@@ -16,3 +17,3 @@ /** | ||
*/ | ||
createSpan(options?: Partial<NodeSpanOptions>, span?: NodeSpan): NodeSpan; | ||
createSpan(options?: Partial<SpanOptions>, span?: Span): Span; | ||
/** | ||
@@ -22,3 +23,3 @@ * Creates a new `Span` instance. If a `SpanContext` is passed as the optional second | ||
*/ | ||
createSpan(options?: Partial<NodeSpanOptions>, context?: SpanContext): NodeSpan; | ||
createSpan(options?: Partial<SpanOptions>, context?: SpanContext): Span; | ||
/** | ||
@@ -29,5 +30,5 @@ * Returns the current Span. | ||
*/ | ||
currentSpan(): NodeSpan; | ||
rootSpan(): NodeSpan; | ||
setError(error: Error): NodeSpan | undefined; | ||
currentSpan(): Span; | ||
rootSpan(): Span; | ||
setError(error: Error): Span | undefined; | ||
/** | ||
@@ -40,3 +41,3 @@ * Sends an error in a newly created `RootSpan` that will be closed after | ||
*/ | ||
sendError<T>(error: Error, fn?: (s: NodeSpan) => T): void; | ||
sendError<T>(error: Error, fn?: (s: Span) => T): void; | ||
/** | ||
@@ -51,3 +52,3 @@ * Executes a given function within the context of a given `Span`. When the | ||
*/ | ||
withSpan<T>(span: NodeSpan, fn: (s: NodeSpan) => T): T; | ||
withSpan<T>(span: Span, fn: (s: Span) => T): T; | ||
/** | ||
@@ -54,0 +55,0 @@ * Wraps a given function in the current `Span`s scope. |
@@ -1,2 +0,2 @@ | ||
export declare const VERSION = "2.1.1"; | ||
export declare const VERSION = "2.2.0"; | ||
export declare const AGENT_VERSION = "7376537"; |
@@ -5,3 +5,3 @@ "use strict"; | ||
// Do not touch this file, auto-generated by scripts/create-versionfile | ||
exports.VERSION = "2.1.1"; | ||
exports.VERSION = "2.2.0"; | ||
exports.AGENT_VERSION = "7376537"; |
{ | ||
"name": "@appsignal/nodejs", | ||
"version": "2.1.1", | ||
"version": "2.2.0", | ||
"main": "dist/index", | ||
@@ -5,0 +5,0 @@ "types": "dist/index", |
352945
3.56%92
17.95%3503
10.92%