@traccia2/sdk 0.0.1 → 0.0.2
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 +235 -1
- package/dist/integrations/auto-langchain.d.ts +108 -0
- package/dist/integrations/auto-langchain.d.ts.map +1 -0
- package/dist/integrations/auto-langchain.js +276 -0
- package/dist/integrations/auto-langchain.js.map +1 -0
- package/dist/integrations/auto-langgraph.d.ts +104 -0
- package/dist/integrations/auto-langgraph.d.ts.map +1 -0
- package/dist/integrations/auto-langgraph.js +240 -0
- package/dist/integrations/auto-langgraph.js.map +1 -0
- package/dist/integrations/index.d.ts +3 -0
- package/dist/integrations/index.d.ts.map +1 -1
- package/dist/integrations/index.js +26 -1
- package/dist/integrations/index.js.map +1 -1
- package/dist/integrations/ollama-integration.d.ts +122 -0
- package/dist/integrations/ollama-integration.d.ts.map +1 -0
- package/dist/integrations/ollama-integration.js +330 -0
- package/dist/integrations/ollama-integration.js.map +1 -0
- package/dist/tracer/span.d.ts +3 -1
- package/dist/tracer/span.d.ts.map +1 -1
- package/dist/tracer/span.js +6 -1
- package/dist/tracer/span.js.map +1 -1
- package/dist/tracer/tracer.js +1 -1
- package/dist/tracer/tracer.js.map +1 -1
- package/package.json +1 -1
- package/src/integrations/auto-langchain.ts +283 -0
- package/src/integrations/auto-langgraph.ts +248 -0
- package/src/integrations/index.ts +30 -0
- package/src/integrations/ollama-integration.ts +358 -0
- package/src/tracer/span.ts +10 -1
- package/src/tracer/tracer.ts +1 -1
|
@@ -0,0 +1,330 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* Ollama integration for LangChain and LangGraph with automatic tracing.
|
|
4
|
+
*
|
|
5
|
+
* Run Ollama models locally and trace them automatically with Traccia.
|
|
6
|
+
*
|
|
7
|
+
* @example
|
|
8
|
+
* // First, start Ollama:
|
|
9
|
+
* // ollama pull llama2
|
|
10
|
+
* // ollama serve
|
|
11
|
+
*
|
|
12
|
+
* // Then use in your code:
|
|
13
|
+
* const model = await createOllamaWithTracing({
|
|
14
|
+
* model: 'llama2',
|
|
15
|
+
* baseUrl: 'http://localhost:11434',
|
|
16
|
+
* });
|
|
17
|
+
*
|
|
18
|
+
* const response = await model.invoke({ input: 'Hello!' });
|
|
19
|
+
* // Automatically traced!
|
|
20
|
+
*/
|
|
21
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
22
|
+
if (k2 === undefined) k2 = k;
|
|
23
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
24
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
25
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
26
|
+
}
|
|
27
|
+
Object.defineProperty(o, k2, desc);
|
|
28
|
+
}) : (function(o, m, k, k2) {
|
|
29
|
+
if (k2 === undefined) k2 = k;
|
|
30
|
+
o[k2] = m[k];
|
|
31
|
+
}));
|
|
32
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
33
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
34
|
+
}) : function(o, v) {
|
|
35
|
+
o["default"] = v;
|
|
36
|
+
});
|
|
37
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
38
|
+
var ownKeys = function(o) {
|
|
39
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
40
|
+
var ar = [];
|
|
41
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
42
|
+
return ar;
|
|
43
|
+
};
|
|
44
|
+
return ownKeys(o);
|
|
45
|
+
};
|
|
46
|
+
return function (mod) {
|
|
47
|
+
if (mod && mod.__esModule) return mod;
|
|
48
|
+
var result = {};
|
|
49
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
50
|
+
__setModuleDefault(result, mod);
|
|
51
|
+
return result;
|
|
52
|
+
};
|
|
53
|
+
})();
|
|
54
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
55
|
+
exports.POPULAR_OLLAMA_MODELS = void 0;
|
|
56
|
+
exports.createOllamaWithTracing = createOllamaWithTracing;
|
|
57
|
+
exports.setupOllamaWithTracing = setupOllamaWithTracing;
|
|
58
|
+
exports.createOllamaChatbot = createOllamaChatbot;
|
|
59
|
+
exports.getOllamaSetupInstructions = getOllamaSetupInstructions;
|
|
60
|
+
exports.createOllamaStreamingChatbot = createOllamaStreamingChatbot;
|
|
61
|
+
const auto_langchain_1 = require("./auto-langchain");
|
|
62
|
+
/**
|
|
63
|
+
* Create a traced Ollama model for LangChain.
|
|
64
|
+
*
|
|
65
|
+
* @example
|
|
66
|
+
* const model = await createOllamaWithTracing({
|
|
67
|
+
* model: 'mistral',
|
|
68
|
+
* baseUrl: 'http://localhost:11434',
|
|
69
|
+
* temperature: 0.7,
|
|
70
|
+
* });
|
|
71
|
+
*
|
|
72
|
+
* const response = await model.invoke({ input: 'Write a poem' });
|
|
73
|
+
* // Automatically traced!
|
|
74
|
+
*/
|
|
75
|
+
async function createOllamaWithTracing(config) {
|
|
76
|
+
try {
|
|
77
|
+
// eslint-disable-next-line @typescript-eslint/no-var-requires
|
|
78
|
+
const langchainOllama = require('@langchain/ollama');
|
|
79
|
+
const { model, baseUrl = 'http://localhost:11434', ...otherConfig } = config;
|
|
80
|
+
const ollamaModel = new langchainOllama.Ollama({
|
|
81
|
+
model,
|
|
82
|
+
baseUrl,
|
|
83
|
+
...otherConfig,
|
|
84
|
+
callbacks: [(0, auto_langchain_1.getTraciaHandler)()],
|
|
85
|
+
});
|
|
86
|
+
return (0, auto_langchain_1.withTracing)(ollamaModel);
|
|
87
|
+
}
|
|
88
|
+
catch (error) {
|
|
89
|
+
throw new Error('Failed to create Ollama model. Make sure @langchain/ollama is installed and Ollama is running.\n' +
|
|
90
|
+
'Install with: npm install @langchain/ollama\n' +
|
|
91
|
+
'Run Ollama with: ollama serve');
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
/**
|
|
95
|
+
* Set up LangChain with Ollama and automatic tracing.
|
|
96
|
+
*
|
|
97
|
+
* @example
|
|
98
|
+
* const { model, executor } = await setupOllamaWithTracing({
|
|
99
|
+
* model: 'mistral',
|
|
100
|
+
* tools: [weatherTool, calculatorTool],
|
|
101
|
+
* systemPrompt: 'You are a helpful assistant.',
|
|
102
|
+
* });
|
|
103
|
+
*
|
|
104
|
+
* const result = await executor.invoke({ input: 'What is the weather?' });
|
|
105
|
+
* // Automatically traced!
|
|
106
|
+
*/
|
|
107
|
+
async function setupOllamaWithTracing(options) {
|
|
108
|
+
try {
|
|
109
|
+
const { model, modelConfig = {}, baseUrl = 'http://localhost:11434', tools = [], systemPrompt, } = options;
|
|
110
|
+
// Create traced Ollama model
|
|
111
|
+
const ollamaModel = await createOllamaWithTracing({
|
|
112
|
+
model,
|
|
113
|
+
baseUrl,
|
|
114
|
+
...modelConfig,
|
|
115
|
+
});
|
|
116
|
+
// Set up with LangChain
|
|
117
|
+
return await (0, auto_langchain_1.setupLangChainWithTracing)({
|
|
118
|
+
modelConfig: {},
|
|
119
|
+
tools,
|
|
120
|
+
systemPrompt,
|
|
121
|
+
// We're using the ollama model directly, not creating a new one
|
|
122
|
+
}).then((result) => ({
|
|
123
|
+
model: ollamaModel,
|
|
124
|
+
executor: result.executor,
|
|
125
|
+
handler: (0, auto_langchain_1.getTraciaHandler)(),
|
|
126
|
+
}));
|
|
127
|
+
}
|
|
128
|
+
catch (error) {
|
|
129
|
+
const err = error;
|
|
130
|
+
throw new Error(`Failed to setup Ollama with tracing: ${err.message}`);
|
|
131
|
+
}
|
|
132
|
+
}
|
|
133
|
+
/**
|
|
134
|
+
* Create a simple chatbot using Ollama with automatic tracing.
|
|
135
|
+
*
|
|
136
|
+
* @example
|
|
137
|
+
* const chatbot = await createOllamaChatbot({
|
|
138
|
+
* model: 'neural-chat',
|
|
139
|
+
* systemPrompt: 'You are a helpful assistant.',
|
|
140
|
+
* });
|
|
141
|
+
*
|
|
142
|
+
* const response = await chatbot('What is machine learning?');
|
|
143
|
+
* // Automatically traced!
|
|
144
|
+
*/
|
|
145
|
+
async function createOllamaChatbot(options) {
|
|
146
|
+
try {
|
|
147
|
+
const { model, baseUrl = 'http://localhost:11434', systemPrompt = 'You are a helpful assistant.', temperature = 0.7, } = options;
|
|
148
|
+
const ollamaModel = await createOllamaWithTracing({
|
|
149
|
+
model,
|
|
150
|
+
baseUrl,
|
|
151
|
+
temperature,
|
|
152
|
+
});
|
|
153
|
+
// Return a simple chatbot function
|
|
154
|
+
return async (input) => {
|
|
155
|
+
const { getTracer } = await Promise.resolve().then(() => __importStar(require('../auto')));
|
|
156
|
+
const tracer = getTracer('ollama-chatbot');
|
|
157
|
+
return tracer.startActiveSpan('chatbot-query', async (span) => {
|
|
158
|
+
try {
|
|
159
|
+
span.setAttribute('model', model);
|
|
160
|
+
span.setAttribute('input_length', input.length);
|
|
161
|
+
const response = await ollamaModel.invoke({
|
|
162
|
+
input: `${systemPrompt}\n\nUser: ${input}`,
|
|
163
|
+
});
|
|
164
|
+
span.setAttribute('output_length', response.length || 0);
|
|
165
|
+
span.setAttribute('success', true);
|
|
166
|
+
return response;
|
|
167
|
+
}
|
|
168
|
+
catch (error) {
|
|
169
|
+
if (error instanceof Error) {
|
|
170
|
+
span.recordException(error);
|
|
171
|
+
}
|
|
172
|
+
throw error;
|
|
173
|
+
}
|
|
174
|
+
});
|
|
175
|
+
};
|
|
176
|
+
}
|
|
177
|
+
catch (error) {
|
|
178
|
+
const err = error;
|
|
179
|
+
throw new Error(`Failed to create Ollama chatbot: ${err.message}`);
|
|
180
|
+
}
|
|
181
|
+
}
|
|
182
|
+
/**
|
|
183
|
+
* Available Ollama models you can pull and use.
|
|
184
|
+
*
|
|
185
|
+
* @example
|
|
186
|
+
* const models = POPULAR_OLLAMA_MODELS;
|
|
187
|
+
* // Use any of: mistral, neural-chat, llama2, orca-mini, etc.
|
|
188
|
+
*/
|
|
189
|
+
exports.POPULAR_OLLAMA_MODELS = [
|
|
190
|
+
{
|
|
191
|
+
name: 'mistral',
|
|
192
|
+
description: 'Fast and powerful 7B model',
|
|
193
|
+
size: '5.4GB',
|
|
194
|
+
command: 'ollama pull mistral',
|
|
195
|
+
},
|
|
196
|
+
{
|
|
197
|
+
name: 'neural-chat',
|
|
198
|
+
description: 'Intel Neural Chat, good for conversations',
|
|
199
|
+
size: '3.8GB',
|
|
200
|
+
command: 'ollama pull neural-chat',
|
|
201
|
+
},
|
|
202
|
+
{
|
|
203
|
+
name: 'llama2',
|
|
204
|
+
description: 'Meta Llama 2, versatile 7B model',
|
|
205
|
+
size: '3.8GB',
|
|
206
|
+
command: 'ollama pull llama2',
|
|
207
|
+
},
|
|
208
|
+
{
|
|
209
|
+
name: 'orca-mini',
|
|
210
|
+
description: 'Small 3B model, fast',
|
|
211
|
+
size: '1.5GB',
|
|
212
|
+
command: 'ollama pull orca-mini',
|
|
213
|
+
},
|
|
214
|
+
{
|
|
215
|
+
name: 'dolphin-mixtral',
|
|
216
|
+
description: 'Mixtral MoE, high quality but larger',
|
|
217
|
+
size: '26GB',
|
|
218
|
+
command: 'ollama pull dolphin-mixtral',
|
|
219
|
+
},
|
|
220
|
+
{
|
|
221
|
+
name: 'opencodeup',
|
|
222
|
+
description: 'Specialized for code generation',
|
|
223
|
+
size: '3.5GB',
|
|
224
|
+
command: 'ollama pull opencodeup',
|
|
225
|
+
},
|
|
226
|
+
];
|
|
227
|
+
/**
|
|
228
|
+
* Helper to get setup instructions for Ollama.
|
|
229
|
+
*
|
|
230
|
+
* @example
|
|
231
|
+
* console.log(getOllamaSetupInstructions());
|
|
232
|
+
*/
|
|
233
|
+
function getOllamaSetupInstructions() {
|
|
234
|
+
return `
|
|
235
|
+
📦 Ollama Setup Instructions
|
|
236
|
+
|
|
237
|
+
1. Install Ollama:
|
|
238
|
+
- macOS: https://ollama.ai/download/Ollama-darwin.zip
|
|
239
|
+
- Windows: https://ollama.ai/download/OllamaSetup.exe
|
|
240
|
+
- Linux: curl https://ollama.ai/install.sh | sh
|
|
241
|
+
|
|
242
|
+
2. Start Ollama in the background:
|
|
243
|
+
ollama serve
|
|
244
|
+
|
|
245
|
+
3. Pull a model (in another terminal):
|
|
246
|
+
ollama pull mistral # Fast 7B model (recommended)
|
|
247
|
+
# or
|
|
248
|
+
ollama pull neural-chat # Optimized for chat
|
|
249
|
+
# or
|
|
250
|
+
ollama pull llama2 # Meta's Llama 2
|
|
251
|
+
|
|
252
|
+
4. Use in Traccia:
|
|
253
|
+
import { createOllamaWithTracing } from '@traccia/sdk/integrations';
|
|
254
|
+
|
|
255
|
+
const model = await createOllamaWithTracing({
|
|
256
|
+
model: 'mistral',
|
|
257
|
+
baseUrl: 'http://localhost:11434',
|
|
258
|
+
});
|
|
259
|
+
|
|
260
|
+
const response = await model.invoke({ input: 'Hello!' });
|
|
261
|
+
|
|
262
|
+
📚 Available Models:
|
|
263
|
+
${exports.POPULAR_OLLAMA_MODELS.map((m) => ` - ${m.name}: ${m.description}`).join('\n')}
|
|
264
|
+
|
|
265
|
+
🔗 More info: https://ollama.ai/
|
|
266
|
+
`;
|
|
267
|
+
}
|
|
268
|
+
/**
|
|
269
|
+
* Create a streaming chatbot with Ollama.
|
|
270
|
+
*
|
|
271
|
+
* @example
|
|
272
|
+
* const chatbot = await createOllamaStreamingChatbot({
|
|
273
|
+
* model: 'mistral',
|
|
274
|
+
* onChunk: (chunk) => process.stdout.write(chunk),
|
|
275
|
+
* });
|
|
276
|
+
*
|
|
277
|
+
* await chatbot('Tell me a story');
|
|
278
|
+
* // Streams response as it's generated!
|
|
279
|
+
*/
|
|
280
|
+
async function createOllamaStreamingChatbot(options) {
|
|
281
|
+
try {
|
|
282
|
+
const { model, baseUrl = 'http://localhost:11434', systemPrompt = 'You are a helpful assistant.', temperature = 0.7, onChunk = (chunk) => process.stdout.write(chunk), } = options;
|
|
283
|
+
const ollamaModel = await createOllamaWithTracing({
|
|
284
|
+
model,
|
|
285
|
+
baseUrl,
|
|
286
|
+
temperature,
|
|
287
|
+
});
|
|
288
|
+
return async (input) => {
|
|
289
|
+
const { getTracer } = await Promise.resolve().then(() => __importStar(require('../auto')));
|
|
290
|
+
const tracer = getTracer('ollama-streaming-chatbot');
|
|
291
|
+
return tracer.startActiveSpan('streaming-query', async (span) => {
|
|
292
|
+
try {
|
|
293
|
+
span.setAttribute('model', model);
|
|
294
|
+
span.setAttribute('input_length', input.length);
|
|
295
|
+
const prompt = `${systemPrompt}\n\nUser: ${input}`;
|
|
296
|
+
let totalChunks = 0;
|
|
297
|
+
// Use streaming if available
|
|
298
|
+
if (ollamaModel.stream) {
|
|
299
|
+
for await (const chunk of await ollamaModel.stream({
|
|
300
|
+
input: prompt,
|
|
301
|
+
})) {
|
|
302
|
+
const text = typeof chunk === 'string' ? chunk : chunk.text || '';
|
|
303
|
+
onChunk(text);
|
|
304
|
+
totalChunks += text.length;
|
|
305
|
+
}
|
|
306
|
+
}
|
|
307
|
+
else {
|
|
308
|
+
// Fallback to regular invoke
|
|
309
|
+
const response = await ollamaModel.invoke({ input: prompt });
|
|
310
|
+
onChunk(response);
|
|
311
|
+
totalChunks = response.length;
|
|
312
|
+
}
|
|
313
|
+
span.setAttribute('output_length', totalChunks);
|
|
314
|
+
span.setAttribute('success', true);
|
|
315
|
+
}
|
|
316
|
+
catch (error) {
|
|
317
|
+
if (error instanceof Error) {
|
|
318
|
+
span.recordException(error);
|
|
319
|
+
}
|
|
320
|
+
throw error;
|
|
321
|
+
}
|
|
322
|
+
});
|
|
323
|
+
};
|
|
324
|
+
}
|
|
325
|
+
catch (error) {
|
|
326
|
+
const err = error;
|
|
327
|
+
throw new Error(`Failed to create streaming Ollama chatbot: ${err.message}`);
|
|
328
|
+
}
|
|
329
|
+
}
|
|
330
|
+
//# sourceMappingURL=ollama-integration.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"oll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
* Span implementation with lifecycle management.
|
|
3
3
|
*/
|
|
4
4
|
import { ISpan, ITracer, SpanStatus, SpanEvent, ISpanContext } from '../types';
|
|
5
|
+
import type { TracerProvider } from './provider';
|
|
5
6
|
/**
|
|
6
7
|
* Span implementation representing a unit of work.
|
|
7
8
|
*/
|
|
@@ -16,7 +17,8 @@ export declare class Span implements ISpan {
|
|
|
16
17
|
startTimeNs: number;
|
|
17
18
|
endTimeNs?: number;
|
|
18
19
|
private ended;
|
|
19
|
-
|
|
20
|
+
private provider;
|
|
21
|
+
constructor(name: string, _tracer: ITracer, context: ISpanContext, parentSpanId?: string, attributes?: Record<string, unknown>, provider?: TracerProvider);
|
|
20
22
|
/**
|
|
21
23
|
* Get the duration in nanoseconds.
|
|
22
24
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"span.d.ts","sourceRoot":"","sources":["../../src/tracer/span.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAE,KAAK,EAAE,OAAO,EAAE,UAAU,EAAE,SAAS,EAAE,YAAY,EAAE,MAAM,UAAU,CAAC;
|
|
1
|
+
{"version":3,"file":"span.d.ts","sourceRoot":"","sources":["../../src/tracer/span.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAE,KAAK,EAAE,OAAO,EAAE,UAAU,EAAE,SAAS,EAAE,YAAY,EAAE,MAAM,UAAU,CAAC;AAG/E,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,YAAY,CAAC;AAEjD;;GAEG;AACH,qBAAa,IAAK,YAAW,KAAK;IACzB,OAAO,EAAE,YAAY,CAAC;IACtB,IAAI,EAAE,MAAM,CAAC;IACb,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,UAAU,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IACpC,MAAM,EAAE,SAAS,EAAE,CAAM;IACzB,MAAM,EAAE,UAAU,CAAoB;IACtC,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAC3B,WAAW,EAAE,MAAM,CAAC;IACpB,SAAS,CAAC,EAAE,MAAM,CAAC;IAE1B,OAAO,CAAC,KAAK,CAAS;IACtB,OAAO,CAAC,QAAQ,CAAiB;gBAG/B,IAAI,EAAE,MAAM,EACZ,OAAO,EAAE,OAAO,EAChB,OAAO,EAAE,YAAY,EACrB,YAAY,CAAC,EAAE,MAAM,EACrB,UAAU,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EACpC,QAAQ,CAAC,EAAE,cAAc;IAa3B;;OAEG;IACH,IAAI,UAAU,IAAI,MAAM,GAAG,SAAS,CAKnC;IAED;;OAEG;IACH,YAAY,CAAC,GAAG,EAAE,MAAM,EAAE,KAAK,EAAE,OAAO,GAAG,IAAI;IAO/C;;OAEG;IACH,QAAQ,CAAC,IAAI,EAAE,MAAM,EAAE,UAAU,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,IAAI;IAWlE;;OAEG;IACH,eAAe,CAAC,KAAK,EAAE,KAAK,EAAE,UAAU,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,IAAI;IAczE;;OAEG;IACH,GAAG,IAAI,IAAI;IAaX;;OAEG;IACH,WAAW,IAAI,OAAO;IAItB;;OAEG;IACH,OAAO,CAAC,gBAAgB;CA+BzB"}
|
package/dist/tracer/span.js
CHANGED
|
@@ -11,7 +11,7 @@ const runtime_config_1 = require("../config/runtime-config");
|
|
|
11
11
|
* Span implementation representing a unit of work.
|
|
12
12
|
*/
|
|
13
13
|
class Span {
|
|
14
|
-
constructor(name, _tracer, context, parentSpanId, attributes) {
|
|
14
|
+
constructor(name, _tracer, context, parentSpanId, attributes, provider) {
|
|
15
15
|
this.events = [];
|
|
16
16
|
this.status = types_1.SpanStatus.UNSET;
|
|
17
17
|
this.ended = false;
|
|
@@ -20,6 +20,7 @@ class Span {
|
|
|
20
20
|
this.parentSpanId = parentSpanId;
|
|
21
21
|
this.attributes = attributes ? { ...attributes } : {};
|
|
22
22
|
this.startTimeNs = performance.now() * 1000000;
|
|
23
|
+
this.provider = provider;
|
|
23
24
|
// Apply runtime metadata to tracestate
|
|
24
25
|
this.enrichTraceState();
|
|
25
26
|
}
|
|
@@ -79,6 +80,10 @@ class Span {
|
|
|
79
80
|
}
|
|
80
81
|
this.ended = true;
|
|
81
82
|
this.endTimeNs = performance.now() * 1000000;
|
|
83
|
+
// Notify provider of span end
|
|
84
|
+
if (this.provider) {
|
|
85
|
+
this.provider.notifySpanEnd(this);
|
|
86
|
+
}
|
|
82
87
|
}
|
|
83
88
|
/**
|
|
84
89
|
* Check if the span is still recording.
|
package/dist/tracer/span.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"span.js","sourceRoot":"","sources":["../../src/tracer/span.ts"],"names":[],"mappings":";AAAA;;GAEG;;;AAEH,oCAA+E;AAC/E,iDAA6C;AAC7C,6DAAqD;
|
|
1
|
+
{"version":3,"file":"span.js","sourceRoot":"","sources":["../../src/tracer/span.ts"],"names":[],"mappings":";AAAA;;GAEG;;;AAEH,oCAA+E;AAC/E,iDAA6C;AAC7C,6DAAqD;AAGrD;;GAEG;AACH,MAAa,IAAI;IAcf,YACE,IAAY,EACZ,OAAgB,EAChB,OAAqB,EACrB,YAAqB,EACrB,UAAoC,EACpC,QAAyB;QAfpB,WAAM,GAAgB,EAAE,CAAC;QACzB,WAAM,GAAe,kBAAU,CAAC,KAAK,CAAC;QAKrC,UAAK,GAAG,KAAK,CAAC;QAWpB,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC;QACjB,IAAI,CAAC,OAAO,GAAG,OAAO,CAAC;QACvB,IAAI,CAAC,YAAY,GAAG,YAAY,CAAC;QACjC,IAAI,CAAC,UAAU,GAAG,UAAU,CAAC,CAAC,CAAC,EAAE,GAAG,UAAU,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;QACtD,IAAI,CAAC,WAAW,GAAG,WAAW,CAAC,G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GAAG,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;gBACpE,UAAU,GAAG,KAAK,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;gBAE7B,IAAI,CAAC,OAAO,GAAG,IAAI,0BAAW,CAC5B,IAAI,CAAC,OAAO,CAAC,OAAO,EACpB,IAAI,CAAC,OAAO,CAAC,MAAM,EACnB,IAAI,CAAC,OAAO,CAAC,UAAU,EACvB,UAAU,CACX,CAAC;YACJ,CAAC;QACH,CAAC;QAAC,MAAM,CAAC;YACP,0CAA0C;QAC5C,CAAC;IACH,CAAC;CACF;AA7ID,oBA6IC"}
|
package/dist/tracer/tracer.js
CHANGED
|
@@ -47,7 +47,7 @@ class Tracer {
|
|
|
47
47
|
}
|
|
48
48
|
}
|
|
49
49
|
const spanContext = new span_context_1.SpanContext(traceId, this.provider.generateSpanId(), traceFlags, effectiveContext?.traceState);
|
|
50
|
-
return new span_1.Span(name, this, spanContext, parentSpanId, options?.attributes);
|
|
50
|
+
return new span_1.Span(name, this, spanContext, parentSpanId, options?.attributes, this.provider);
|
|
51
51
|
}
|
|
52
52
|
/**
|
|
53
53
|
* Start an active span and run a function within it.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tracer.js","sourceRoot":"","sources":["../../src/tracer/tracer.ts"],"names":[],"mappings":";AAAA;;GAEG;;;AAGH,iCAA8B;AAC9B,iDAA6C;AAC7C,gDAAsE;AAEtE,6DAAqD;AAErD;;GAEG;AACH,MAAa,MAAM;IAGjB,YAAY,QAAwB,EAAE,qBAA6B;QACjE,IAAI,CAAC,QAAQ,GAAG,QAAQ,CAAC;IAC3B,CAAC;IAED;;OAEG;IACH,SAAS,CACP,IAAY,EACZ,OAIC;QAED,MAAM,UAAU,GAAG,OAAO,EAAE,MAAM,IAAI,IAAA,wBAAc,GAAE,CAAC;QACvD,MAAM,gBAAgB,GAAG,OAAO,EAAE,aAAa,IAAK,UAAU,EAAE,OAAwB,CAAC;QAEzF,IAAI,OAAe,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