netra-sdk 1.3.0 → 1.4.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/dist/index.d.cts CHANGED
@@ -59,10 +59,11 @@ declare const DEFAULT_INSTRUMENTS: Set<NetraInstruments>;
59
59
  declare class Config {
60
60
  static readonly SDK_NAME = "netra";
61
61
  static readonly LIBRARY_NAME = "netra";
62
- static readonly LIBRARY_VERSION = "1.0.0";
62
+ static readonly LIBRARY_VERSION = "1.4.0";
63
63
  static readonly TRIAL_BLOCK_DURATION_SECONDS = 900;
64
64
  static readonly ATTRIBUTE_MAX_LEN: number;
65
65
  static readonly CONVERSATION_MAX_LEN: number;
66
+ static readonly SPAN_ATTRIBUTE_MAX_SIZE: number;
66
67
  appName: string;
67
68
  otlpEndpoint?: string;
68
69
  apiKey?: string;
@@ -94,6 +95,7 @@ declare class Config {
94
95
  * This ensures the Traceloop SDK picks up our configuration.
95
96
  */
96
97
  setTraceloopEnv(): void;
98
+ private _setResourceAttributesEnv;
97
99
  }
98
100
 
99
101
  /**
@@ -847,6 +849,23 @@ declare class Prompts {
847
849
  getPrompt(params: GetPromptParams): Promise<PromptResponse | null>;
848
850
  }
849
851
 
852
+ /**
853
+ * Attribute Size Limit Span Processor
854
+ *
855
+ * Enforces a hard max length on every span attribute value via setAttribute
856
+ * wrapping in onStart. Prevents "entity too large" errors during export.
857
+ */
858
+
859
+ declare class AttributeSizeLimitProcessor implements SpanProcessor {
860
+ private maxAttributeSize;
861
+ constructor(maxAttributeSize?: number);
862
+ onStart(span: Span, _parentContext: Context): void;
863
+ onEnd(_span: ReadableSpan): void;
864
+ shutdown(): Promise<void>;
865
+ forceFlush(): Promise<void>;
866
+ private _wrapSetAttribute;
867
+ }
868
+
850
869
  /**
851
870
  * Instrumentation Span Processor
852
871
  *
@@ -947,6 +966,8 @@ declare class ScrubbingSpanProcessor implements SpanProcessor {
947
966
  */
948
967
 
949
968
  declare class SessionSpanProcessor implements SpanProcessor {
969
+ private readonly environment;
970
+ constructor(environment?: string);
950
971
  /**
951
972
  * Called when a span starts. Adds session and entity context attributes.
952
973
  */
@@ -1585,4 +1606,4 @@ declare class Netra {
1585
1606
  static withBlockedSpansLocal: typeof withBlockedSpansLocal;
1586
1607
  }
1587
1608
 
1588
- export { type ActionModel, Aggregation, BaseTask, type CategoricalDataPoint, ChartType, Config, type ConversationResponse, type ConversationResult, ConversationType, type CreateDatasetParams, type CreateRunResult, DEFAULT_INSTRUMENTS, DEFAULT_INSTRUMENTS_FOR_ROOT, Dashboard, type DashboardData, type Dataset, type DatasetEntry, type DatasetItem, type Dimension, DimensionField, type DimensionValue, EntryStatus, Evaluation, type EvaluationScore, type EvaluatorFunction, type Filter, type FilterConfig, FilterField, FilterType, FilteringSpanExporter, type GetPromptParams, GroupBy, InstrumentationSpanProcessor, type ListSpansParams, type ListTracesParams, Measure, type Metrics, Netra, NetraAgentsTracingProcessor, NetraInstruments, NetraOpenAIAgentsInstrumentor, type NumberResponse, Operator, type ProcessedFile, type PromptResponse, Prompts, type QueryDataParams, type QueryResponse, type Run, RunEntryContext, RunStatus, Scope, ScrubbingSpanProcessor, SessionSpanProcessor, type SessionUsageData, Simulation, type SimulationItem, type SimulationOptions, type SimulationResult, SpanIOProcessor, type SpanOptions, SpanType, type SpansPage, type TaskFunction, type TaskResult, type TenantUsageData, type TestSuiteResult, type TimeRange, type TimeSeriesDataPoint, type TimeSeriesResponse, type TimeSeriesWithDimension, type TraceSpan, type TraceSummary, type TracesPage, TrialAwareOTLPExporter, Usage, type UsageModel, agent, Netra as default, metadataField, mistralAIInstrumentor, netraExpressMiddleware, openaiAgentsInstrumentor, runWithExtractedContext, span, task, workflow };
1609
+ export { type ActionModel, Aggregation, AttributeSizeLimitProcessor, BaseTask, type CategoricalDataPoint, ChartType, Config, type ConversationResponse, type ConversationResult, ConversationType, type CreateDatasetParams, type CreateRunResult, DEFAULT_INSTRUMENTS, DEFAULT_INSTRUMENTS_FOR_ROOT, Dashboard, type DashboardData, type Dataset, type DatasetEntry, type DatasetItem, type Dimension, DimensionField, type DimensionValue, EntryStatus, Evaluation, type EvaluationScore, type EvaluatorFunction, type Filter, type FilterConfig, FilterField, FilterType, FilteringSpanExporter, type GetPromptParams, GroupBy, InstrumentationSpanProcessor, type ListSpansParams, type ListTracesParams, Measure, type Metrics, Netra, NetraAgentsTracingProcessor, NetraInstruments, NetraOpenAIAgentsInstrumentor, type NumberResponse, Operator, type ProcessedFile, type PromptResponse, Prompts, type QueryDataParams, type QueryResponse, type Run, RunEntryContext, RunStatus, Scope, ScrubbingSpanProcessor, SessionSpanProcessor, type SessionUsageData, Simulation, type SimulationItem, type SimulationOptions, type SimulationResult, SpanIOProcessor, type SpanOptions, SpanType, type SpansPage, type TaskFunction, type TaskResult, type TenantUsageData, type TestSuiteResult, type TimeRange, type TimeSeriesDataPoint, type TimeSeriesResponse, type TimeSeriesWithDimension, type TraceSpan, type TraceSummary, type TracesPage, TrialAwareOTLPExporter, Usage, type UsageModel, agent, Netra as default, metadataField, mistralAIInstrumentor, netraExpressMiddleware, openaiAgentsInstrumentor, runWithExtractedContext, span, task, workflow };
package/dist/index.d.ts CHANGED
@@ -59,10 +59,11 @@ declare const DEFAULT_INSTRUMENTS: Set<NetraInstruments>;
59
59
  declare class Config {
60
60
  static readonly SDK_NAME = "netra";
61
61
  static readonly LIBRARY_NAME = "netra";
62
- static readonly LIBRARY_VERSION = "1.0.0";
62
+ static readonly LIBRARY_VERSION = "1.4.0";
63
63
  static readonly TRIAL_BLOCK_DURATION_SECONDS = 900;
64
64
  static readonly ATTRIBUTE_MAX_LEN: number;
65
65
  static readonly CONVERSATION_MAX_LEN: number;
66
+ static readonly SPAN_ATTRIBUTE_MAX_SIZE: number;
66
67
  appName: string;
67
68
  otlpEndpoint?: string;
68
69
  apiKey?: string;
@@ -94,6 +95,7 @@ declare class Config {
94
95
  * This ensures the Traceloop SDK picks up our configuration.
95
96
  */
96
97
  setTraceloopEnv(): void;
98
+ private _setResourceAttributesEnv;
97
99
  }
98
100
 
99
101
  /**
@@ -847,6 +849,23 @@ declare class Prompts {
847
849
  getPrompt(params: GetPromptParams): Promise<PromptResponse | null>;
848
850
  }
849
851
 
852
+ /**
853
+ * Attribute Size Limit Span Processor
854
+ *
855
+ * Enforces a hard max length on every span attribute value via setAttribute
856
+ * wrapping in onStart. Prevents "entity too large" errors during export.
857
+ */
858
+
859
+ declare class AttributeSizeLimitProcessor implements SpanProcessor {
860
+ private maxAttributeSize;
861
+ constructor(maxAttributeSize?: number);
862
+ onStart(span: Span, _parentContext: Context): void;
863
+ onEnd(_span: ReadableSpan): void;
864
+ shutdown(): Promise<void>;
865
+ forceFlush(): Promise<void>;
866
+ private _wrapSetAttribute;
867
+ }
868
+
850
869
  /**
851
870
  * Instrumentation Span Processor
852
871
  *
@@ -947,6 +966,8 @@ declare class ScrubbingSpanProcessor implements SpanProcessor {
947
966
  */
948
967
 
949
968
  declare class SessionSpanProcessor implements SpanProcessor {
969
+ private readonly environment;
970
+ constructor(environment?: string);
950
971
  /**
951
972
  * Called when a span starts. Adds session and entity context attributes.
952
973
  */
@@ -1585,4 +1606,4 @@ declare class Netra {
1585
1606
  static withBlockedSpansLocal: typeof withBlockedSpansLocal;
1586
1607
  }
1587
1608
 
1588
- export { type ActionModel, Aggregation, BaseTask, type CategoricalDataPoint, ChartType, Config, type ConversationResponse, type ConversationResult, ConversationType, type CreateDatasetParams, type CreateRunResult, DEFAULT_INSTRUMENTS, DEFAULT_INSTRUMENTS_FOR_ROOT, Dashboard, type DashboardData, type Dataset, type DatasetEntry, type DatasetItem, type Dimension, DimensionField, type DimensionValue, EntryStatus, Evaluation, type EvaluationScore, type EvaluatorFunction, type Filter, type FilterConfig, FilterField, FilterType, FilteringSpanExporter, type GetPromptParams, GroupBy, InstrumentationSpanProcessor, type ListSpansParams, type ListTracesParams, Measure, type Metrics, Netra, NetraAgentsTracingProcessor, NetraInstruments, NetraOpenAIAgentsInstrumentor, type NumberResponse, Operator, type ProcessedFile, type PromptResponse, Prompts, type QueryDataParams, type QueryResponse, type Run, RunEntryContext, RunStatus, Scope, ScrubbingSpanProcessor, SessionSpanProcessor, type SessionUsageData, Simulation, type SimulationItem, type SimulationOptions, type SimulationResult, SpanIOProcessor, type SpanOptions, SpanType, type SpansPage, type TaskFunction, type TaskResult, type TenantUsageData, type TestSuiteResult, type TimeRange, type TimeSeriesDataPoint, type TimeSeriesResponse, type TimeSeriesWithDimension, type TraceSpan, type TraceSummary, type TracesPage, TrialAwareOTLPExporter, Usage, type UsageModel, agent, Netra as default, metadataField, mistralAIInstrumentor, netraExpressMiddleware, openaiAgentsInstrumentor, runWithExtractedContext, span, task, workflow };
1609
+ export { type ActionModel, Aggregation, AttributeSizeLimitProcessor, BaseTask, type CategoricalDataPoint, ChartType, Config, type ConversationResponse, type ConversationResult, ConversationType, type CreateDatasetParams, type CreateRunResult, DEFAULT_INSTRUMENTS, DEFAULT_INSTRUMENTS_FOR_ROOT, Dashboard, type DashboardData, type Dataset, type DatasetEntry, type DatasetItem, type Dimension, DimensionField, type DimensionValue, EntryStatus, Evaluation, type EvaluationScore, type EvaluatorFunction, type Filter, type FilterConfig, FilterField, FilterType, FilteringSpanExporter, type GetPromptParams, GroupBy, InstrumentationSpanProcessor, type ListSpansParams, type ListTracesParams, Measure, type Metrics, Netra, NetraAgentsTracingProcessor, NetraInstruments, NetraOpenAIAgentsInstrumentor, type NumberResponse, Operator, type ProcessedFile, type PromptResponse, Prompts, type QueryDataParams, type QueryResponse, type Run, RunEntryContext, RunStatus, Scope, ScrubbingSpanProcessor, SessionSpanProcessor, type SessionUsageData, Simulation, type SimulationItem, type SimulationOptions, type SimulationResult, SpanIOProcessor, type SpanOptions, SpanType, type SpansPage, type TaskFunction, type TaskResult, type TenantUsageData, type TestSuiteResult, type TimeRange, type TimeSeriesDataPoint, type TimeSeriesResponse, type TimeSeriesWithDimension, type TraceSpan, type TraceSummary, type TracesPage, TrialAwareOTLPExporter, Usage, type UsageModel, agent, Netra as default, metadataField, mistralAIInstrumentor, netraExpressMiddleware, openaiAgentsInstrumentor, runWithExtractedContext, span, task, workflow };