@latitude-data/telemetry 1.1.0 → 1.1.1

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/dist/index.d.ts CHANGED
@@ -2,6 +2,7 @@ import * as otel from '@opentelemetry/api';
2
2
  import { TextMapPropagator } from '@opentelemetry/api';
3
3
  import { SpanProcessor, ReadableSpan, SpanExporter, NodeTracerProvider } from '@opentelemetry/sdk-trace-node';
4
4
  import * as latitude from '@latitude-data/sdk';
5
+ import { Latitude } from '@latitude-data/sdk';
5
6
  import { z } from 'zod';
6
7
  import { OTLPTraceExporter } from '@opentelemetry/exporter-trace-otlp-http';
7
8
 
@@ -28,7 +29,7 @@ interface BaseInstrumentation {
28
29
  }
29
30
 
30
31
  type LatitudeInstrumentationOptions = {
31
- module: typeof latitude.Latitude;
32
+ module: typeof Latitude;
32
33
  completions?: boolean;
33
34
  };
34
35
 
@@ -45,7 +46,8 @@ declare enum LogSources {
45
46
  SharedPrompt = "shared_prompt",
46
47
  ShadowTest = "shadow_test",
47
48
  ABTestChallenger = "ab_test_challenger",
48
- User = "user"
49
+ User = "user",
50
+ Optimization = "optimization"
49
51
  }
50
52
 
51
53
  declare const traceContextSchema: z.ZodObject<{
@@ -128,6 +130,8 @@ type ChatSpanOptions = StartSpanOptions & {
128
130
  documentLogUuid: string;
129
131
  previousTraceId: string;
130
132
  source?: LogSources;
133
+ versionUuid?: string;
134
+ promptUuid?: string;
131
135
  };
132
136
  type ExternalSpanOptions = StartSpanOptions & {
133
137
  promptUuid: string;
@@ -175,16 +179,6 @@ declare class ManualInstrumentation implements BaseInstrumentation {
175
179
  end: (_options?: EndSpanOptions) => void;
176
180
  fail: (_error: Error, _options?: ErrorOptions) => void;
177
181
  };
178
- retrieval(ctx: otel.Context, options?: StartSpanOptions): {
179
- context: otel.Context;
180
- end: (_options?: EndSpanOptions) => void;
181
- fail: (_error: Error, _options?: ErrorOptions) => void;
182
- };
183
- reranking(ctx: otel.Context, options?: StartSpanOptions): {
184
- context: otel.Context;
185
- end: (_options?: EndSpanOptions) => void;
186
- fail: (_error: Error, _options?: ErrorOptions) => void;
187
- };
188
182
  private attribifyHeaders;
189
183
  http(ctx: otel.Context, options: StartHttpSpanOptions): {
190
184
  context: otel.Context;
@@ -196,12 +190,7 @@ declare class ManualInstrumentation implements BaseInstrumentation {
196
190
  end: (_options?: EndSpanOptions) => void;
197
191
  fail: (_error: Error, _options?: ErrorOptions) => void;
198
192
  };
199
- step(ctx: otel.Context, options?: StartSpanOptions): {
200
- context: otel.Context;
201
- end: (_options?: EndSpanOptions) => void;
202
- fail: (_error: Error, _options?: ErrorOptions) => void;
203
- };
204
- chat(ctx: otel.Context, { documentLogUuid, previousTraceId, source, name, ...rest }: ChatSpanOptions): {
193
+ chat(ctx: otel.Context, { documentLogUuid, previousTraceId, source, name, versionUuid, promptUuid, ...rest }: ChatSpanOptions): {
205
194
  context: otel.Context;
206
195
  end: (_options?: EndSpanOptions) => void;
207
196
  fail: (_error: Error, _options?: ErrorOptions) => void;
@@ -238,16 +227,6 @@ declare class SpanFactory {
238
227
  end: (_options?: EndSpanOptions) => void;
239
228
  fail: (_error: Error, _options?: ErrorOptions) => void;
240
229
  };
241
- retrieval(options?: StartSpanOptions, ctx?: TelemetryContext): {
242
- context: otel.Context;
243
- end: (_options?: EndSpanOptions) => void;
244
- fail: (_error: Error, _options?: ErrorOptions) => void;
245
- };
246
- reranking(options?: StartSpanOptions, ctx?: TelemetryContext): {
247
- context: otel.Context;
248
- end: (_options?: EndSpanOptions) => void;
249
- fail: (_error: Error, _options?: ErrorOptions) => void;
250
- };
251
230
  http(options: StartHttpSpanOptions, ctx?: TelemetryContext): {
252
231
  context: otel.Context;
253
232
  end: (options: EndHttpSpanOptions) => void;
@@ -258,11 +237,6 @@ declare class SpanFactory {
258
237
  end: (_options?: EndSpanOptions) => void;
259
238
  fail: (_error: Error, _options?: ErrorOptions) => void;
260
239
  };
261
- step(options?: StartSpanOptions, ctx?: TelemetryContext): {
262
- context: otel.Context;
263
- end: (_options?: EndSpanOptions) => void;
264
- fail: (_error: Error, _options?: ErrorOptions) => void;
265
- };
266
240
  chat(options: ChatSpanOptions, ctx?: TelemetryContext): {
267
241
  context: otel.Context;
268
242
  end: (_options?: EndSpanOptions) => void;