import { AttributeValue } from '@opentelemetry/api'; import { AnyValue } from '@opentelemetry/api-logs'; import * as semconvAttributes from '@opentelemetry/semantic-conventions'; import * as semconvIncubatingAttributes from '@opentelemetry/semantic-conventions/incubating'; /** * LangWatch input data attribute key * Used to store the input data for a span or event */ declare const ATTR_LANGWATCH_INPUT = "langwatch.input"; /** * LangWatch output data attribute key * Used to store the output data for a span or event */ declare const ATTR_LANGWATCH_OUTPUT = "langwatch.output"; /** * LangWatch span type attribute key * Used to identify the type of span being traced */ declare const ATTR_LANGWATCH_SPAN_TYPE = "langwatch.span.type"; /** * LangWatch RAG contexts attribute key * Used to store retrieval-augmented generation contexts */ declare const ATTR_LANGWATCH_RAG_CONTEXTS = "langwatch.rag.contexts"; /** * LangWatch metrics attribute key * Used to store custom metrics data */ declare const ATTR_LANGWATCH_METRICS = "langwatch.metrics"; /** * LangWatch SDK version attribute key * Used to track the version of the LangWatch SDK being used */ declare const ATTR_LANGWATCH_SDK_VERSION = "langwatch.sdk.version"; /** * LangWatch SDK name attribute key * Used to identify the LangWatch SDK implementation */ declare const ATTR_LANGWATCH_SDK_NAME = "langwatch.sdk.name"; /** * LangWatch SDK language attribute key * Used to identify the programming language of the SDK */ declare const ATTR_LANGWATCH_SDK_LANGUAGE = "langwatch.sdk.language"; /** * LangWatch timestamps attribute key * Used to store timing information for events */ declare const ATTR_LANGWATCH_TIMESTAMPS = "langwatch.timestamps"; /** * LangWatch custom evaluation attribute key * Used to store custom evaluation data */ declare const ATTR_LANGWATCH_EVALUATION_CUSTOM = "langwatch.evaluation.custom"; /** * LangWatch parameters attribute key * Used to store parameter data for operations */ declare const ATTR_LANGWATCH_PARAMS = "langwatch.params"; /** * LangWatch customer ID attribute key * Used to identify the customer associated with the trace */ declare const ATTR_LANGWATCH_CUSTOMER_ID = "langwatch.customer.id"; /** * LangWatch thread ID attribute key * Used to group related operations within a conversation thread */ declare const ATTR_LANGWATCH_THREAD_ID = "langwatch.thread.id"; /** * LangWatch user ID attribute key * Used to store the user ID for a span or event */ declare const ATTR_LANGWATCH_USER_ID = "langwatch.user.id"; /** * LangWatch labels attribute key * Used to store labels for a span or event */ declare const ATTR_LANGWATCH_LABELS = "langwatch.labels"; /** * LangWatch tags attribute key * Used to store tags for a span or event * * @deprecated: Please use `ATTR_LANGWATCH_LABELS`. */ declare const ATTR_LANGWATCH_TAGS = "langwatch.labels"; /** * LangWatch streaming attribute key * Used to indicate if the operation involves streaming */ declare const ATTR_LANGWATCH_STREAMING = "langwatch.gen_ai.streaming"; /** * LangWatch prompt ID attribute key * Used to identify the specific prompt being used */ declare const ATTR_LANGWATCH_PROMPT_ID = "langwatch.prompt.id"; /** * LangWatch prompt ID attribute key * Used to identify the specific prompt being used */ declare const ATTR_LANGWATCH_PROMPT_HANDLE = "langwatch.prompt.handle"; /** * LangWatch prompt version ID attribute key * Used to identify the specific version of a prompt */ declare const ATTR_LANGWATCH_PROMPT_VERSION_ID = "langwatch.prompt.version.id"; /** * LangWatch prompt variables attribute key * Used to store variables used in prompt templates */ declare const ATTR_LANGWATCH_PROMPT_VARIABLES = "langwatch.prompt.variables"; /** * LangWatch prompt selected ID attribute key * Used to identify which prompt was selected from a set */ declare const ATTR_LANGWATCH_PROMPT_SELECTED_ID = "langwatch.prompt.selected.id"; /** * LangWatch prompt version number attribute key * Used to track the version number of a prompt */ declare const ATTR_LANGWATCH_PROMPT_VERSION_NUMBER = "langwatch.prompt.version.number"; /** * LangWatch LangChain tags attribute key * Used to store tags associated with LangChain operations */ declare const ATTR_LANGWATCH_LANGCHAIN_TAGS = "langwatch.langchain.tags"; /** * LangWatch LangChain event name attribute key * Used to identify the specific LangChain event type */ declare const ATTR_LANGWATCH_LANGCHAIN_EVENT_NAME = "langwatch.langchain.event_name"; /** * LangWatch LangChain run ID attribute key * Used to identify a specific LangChain run */ declare const ATTR_LANGWATCH_LANGCHAIN_RUN_ID = "langwatch.langchain.run.id"; /** * LangWatch LangChain run tags attribute key * Used to store tags associated with a LangChain run */ declare const ATTR_LANGWATCH_LANGCHAIN_RUN_TAGS = "langwatch.langchain.run.tags"; /** * LangWatch LangChain run type attribute key * Used to identify the type of LangChain run */ declare const ATTR_LANGWATCH_LANGCHAIN_RUN_TYPE = "langwatch.langchain.run.type"; /** * LangWatch LangChain run metadata attribute key * Used to store metadata associated with a LangChain run */ declare const ATTR_LANGWATCH_LANGCHAIN_RUN_METADATA = "langwatch.langchain.run.metadata"; /** * LangWatch LangChain run extra parameters attribute key * Used to store additional parameters for a LangChain run */ declare const ATTR_LANGWATCH_LANGCHAIN_RUN_EXTRA_PARAMS = "langwatch.langchain.run.extra_params"; /** * LangWatch LangChain run parent ID attribute key * Used to identify the parent run in a hierarchical structure */ declare const ATTR_LANGWATCH_LANGCHAIN_RUN_PARENT_ID = "langwatch.langchain.run.parent.id"; declare const langwatchAttributes_ATTR_LANGWATCH_CUSTOMER_ID: typeof ATTR_LANGWATCH_CUSTOMER_ID; declare const langwatchAttributes_ATTR_LANGWATCH_EVALUATION_CUSTOM: typeof ATTR_LANGWATCH_EVALUATION_CUSTOM; declare const langwatchAttributes_ATTR_LANGWATCH_INPUT: typeof ATTR_LANGWATCH_INPUT; declare const langwatchAttributes_ATTR_LANGWATCH_LABELS: typeof ATTR_LANGWATCH_LABELS; declare const langwatchAttributes_ATTR_LANGWATCH_LANGCHAIN_EVENT_NAME: typeof ATTR_LANGWATCH_LANGCHAIN_EVENT_NAME; declare const langwatchAttributes_ATTR_LANGWATCH_LANGCHAIN_RUN_EXTRA_PARAMS: typeof ATTR_LANGWATCH_LANGCHAIN_RUN_EXTRA_PARAMS; declare const langwatchAttributes_ATTR_LANGWATCH_LANGCHAIN_RUN_ID: typeof ATTR_LANGWATCH_LANGCHAIN_RUN_ID; declare const langwatchAttributes_ATTR_LANGWATCH_LANGCHAIN_RUN_METADATA: typeof ATTR_LANGWATCH_LANGCHAIN_RUN_METADATA; declare const langwatchAttributes_ATTR_LANGWATCH_LANGCHAIN_RUN_PARENT_ID: typeof ATTR_LANGWATCH_LANGCHAIN_RUN_PARENT_ID; declare const langwatchAttributes_ATTR_LANGWATCH_LANGCHAIN_RUN_TAGS: typeof ATTR_LANGWATCH_LANGCHAIN_RUN_TAGS; declare const langwatchAttributes_ATTR_LANGWATCH_LANGCHAIN_RUN_TYPE: typeof ATTR_LANGWATCH_LANGCHAIN_RUN_TYPE; declare const langwatchAttributes_ATTR_LANGWATCH_LANGCHAIN_TAGS: typeof ATTR_LANGWATCH_LANGCHAIN_TAGS; declare const langwatchAttributes_ATTR_LANGWATCH_METRICS: typeof ATTR_LANGWATCH_METRICS; declare const langwatchAttributes_ATTR_LANGWATCH_OUTPUT: typeof ATTR_LANGWATCH_OUTPUT; declare const langwatchAttributes_ATTR_LANGWATCH_PARAMS: typeof ATTR_LANGWATCH_PARAMS; declare const langwatchAttributes_ATTR_LANGWATCH_PROMPT_HANDLE: typeof ATTR_LANGWATCH_PROMPT_HANDLE; declare const langwatchAttributes_ATTR_LANGWATCH_PROMPT_ID: typeof ATTR_LANGWATCH_PROMPT_ID; declare const langwatchAttributes_ATTR_LANGWATCH_PROMPT_SELECTED_ID: typeof ATTR_LANGWATCH_PROMPT_SELECTED_ID; declare const langwatchAttributes_ATTR_LANGWATCH_PROMPT_VARIABLES: typeof ATTR_LANGWATCH_PROMPT_VARIABLES; declare const langwatchAttributes_ATTR_LANGWATCH_PROMPT_VERSION_ID: typeof ATTR_LANGWATCH_PROMPT_VERSION_ID; declare const langwatchAttributes_ATTR_LANGWATCH_PROMPT_VERSION_NUMBER: typeof ATTR_LANGWATCH_PROMPT_VERSION_NUMBER; declare const langwatchAttributes_ATTR_LANGWATCH_RAG_CONTEXTS: typeof ATTR_LANGWATCH_RAG_CONTEXTS; declare const langwatchAttributes_ATTR_LANGWATCH_SDK_LANGUAGE: typeof ATTR_LANGWATCH_SDK_LANGUAGE; declare const langwatchAttributes_ATTR_LANGWATCH_SDK_NAME: typeof ATTR_LANGWATCH_SDK_NAME; declare const langwatchAttributes_ATTR_LANGWATCH_SDK_VERSION: typeof ATTR_LANGWATCH_SDK_VERSION; declare const langwatchAttributes_ATTR_LANGWATCH_SPAN_TYPE: typeof ATTR_LANGWATCH_SPAN_TYPE; declare const langwatchAttributes_ATTR_LANGWATCH_STREAMING: typeof ATTR_LANGWATCH_STREAMING; declare const langwatchAttributes_ATTR_LANGWATCH_TAGS: typeof ATTR_LANGWATCH_TAGS; declare const langwatchAttributes_ATTR_LANGWATCH_THREAD_ID: typeof ATTR_LANGWATCH_THREAD_ID; declare const langwatchAttributes_ATTR_LANGWATCH_TIMESTAMPS: typeof ATTR_LANGWATCH_TIMESTAMPS; declare const langwatchAttributes_ATTR_LANGWATCH_USER_ID: typeof ATTR_LANGWATCH_USER_ID; declare namespace langwatchAttributes { export { langwatchAttributes_ATTR_LANGWATCH_CUSTOMER_ID as ATTR_LANGWATCH_CUSTOMER_ID, langwatchAttributes_ATTR_LANGWATCH_EVALUATION_CUSTOM as ATTR_LANGWATCH_EVALUATION_CUSTOM, langwatchAttributes_ATTR_LANGWATCH_INPUT as ATTR_LANGWATCH_INPUT, langwatchAttributes_ATTR_LANGWATCH_LABELS as ATTR_LANGWATCH_LABELS, langwatchAttributes_ATTR_LANGWATCH_LANGCHAIN_EVENT_NAME as ATTR_LANGWATCH_LANGCHAIN_EVENT_NAME, langwatchAttributes_ATTR_LANGWATCH_LANGCHAIN_RUN_EXTRA_PARAMS as ATTR_LANGWATCH_LANGCHAIN_RUN_EXTRA_PARAMS, langwatchAttributes_ATTR_LANGWATCH_LANGCHAIN_RUN_ID as ATTR_LANGWATCH_LANGCHAIN_RUN_ID, langwatchAttributes_ATTR_LANGWATCH_LANGCHAIN_RUN_METADATA as ATTR_LANGWATCH_LANGCHAIN_RUN_METADATA, langwatchAttributes_ATTR_LANGWATCH_LANGCHAIN_RUN_PARENT_ID as ATTR_LANGWATCH_LANGCHAIN_RUN_PARENT_ID, langwatchAttributes_ATTR_LANGWATCH_LANGCHAIN_RUN_TAGS as ATTR_LANGWATCH_LANGCHAIN_RUN_TAGS, langwatchAttributes_ATTR_LANGWATCH_LANGCHAIN_RUN_TYPE as ATTR_LANGWATCH_LANGCHAIN_RUN_TYPE, langwatchAttributes_ATTR_LANGWATCH_LANGCHAIN_TAGS as ATTR_LANGWATCH_LANGCHAIN_TAGS, langwatchAttributes_ATTR_LANGWATCH_METRICS as ATTR_LANGWATCH_METRICS, langwatchAttributes_ATTR_LANGWATCH_OUTPUT as ATTR_LANGWATCH_OUTPUT, langwatchAttributes_ATTR_LANGWATCH_PARAMS as ATTR_LANGWATCH_PARAMS, langwatchAttributes_ATTR_LANGWATCH_PROMPT_HANDLE as ATTR_LANGWATCH_PROMPT_HANDLE, langwatchAttributes_ATTR_LANGWATCH_PROMPT_ID as ATTR_LANGWATCH_PROMPT_ID, langwatchAttributes_ATTR_LANGWATCH_PROMPT_SELECTED_ID as ATTR_LANGWATCH_PROMPT_SELECTED_ID, langwatchAttributes_ATTR_LANGWATCH_PROMPT_VARIABLES as ATTR_LANGWATCH_PROMPT_VARIABLES, langwatchAttributes_ATTR_LANGWATCH_PROMPT_VERSION_ID as ATTR_LANGWATCH_PROMPT_VERSION_ID, langwatchAttributes_ATTR_LANGWATCH_PROMPT_VERSION_NUMBER as ATTR_LANGWATCH_PROMPT_VERSION_NUMBER, langwatchAttributes_ATTR_LANGWATCH_RAG_CONTEXTS as ATTR_LANGWATCH_RAG_CONTEXTS, langwatchAttributes_ATTR_LANGWATCH_SDK_LANGUAGE as ATTR_LANGWATCH_SDK_LANGUAGE, langwatchAttributes_ATTR_LANGWATCH_SDK_NAME as ATTR_LANGWATCH_SDK_NAME, langwatchAttributes_ATTR_LANGWATCH_SDK_VERSION as ATTR_LANGWATCH_SDK_VERSION, langwatchAttributes_ATTR_LANGWATCH_SPAN_TYPE as ATTR_LANGWATCH_SPAN_TYPE, langwatchAttributes_ATTR_LANGWATCH_STREAMING as ATTR_LANGWATCH_STREAMING, langwatchAttributes_ATTR_LANGWATCH_TAGS as ATTR_LANGWATCH_TAGS, langwatchAttributes_ATTR_LANGWATCH_THREAD_ID as ATTR_LANGWATCH_THREAD_ID, langwatchAttributes_ATTR_LANGWATCH_TIMESTAMPS as ATTR_LANGWATCH_TIMESTAMPS, langwatchAttributes_ATTR_LANGWATCH_USER_ID as ATTR_LANGWATCH_USER_ID }; } type OnlyStringValues = { [K in keyof T]: T[K] extends string ? T[K] : never; }[keyof T]; /** * Union type representing all possible attribute keys that can be used in spans. * * This includes: * - Standard OpenTelemetry semantic convention attributes * - LangWatch-specific attributes * - Custom string attributes * * @example * ```typescript * const attributes: SemconvAttributes = { * "http.method": "GET", * "http.url": "https://api.example.com", * "langwatch.span.type": "llm", * "custom.attribute": "value" * }; * ``` */ type SemConvAttributeKey = OnlyStringValues | OnlyStringValues | OnlyStringValues | (string & {}); /** * Record type representing span attributes with semantic convention keys. * * This type ensures type safety when setting attributes on spans while * allowing both standard OpenTelemetry semantic conventions and custom attributes. * * @example * ```typescript * const spanAttributes: SemConvAttributes = { * "service.name": "my-service", * "service.version": "1.0.0", * "langwatch.span.type": "llm", * "custom.user.id": "user123" * }; * ``` */ type SemConvAttributes = Partial>; /** * Record type representing log record attributes with semantic convention keys. * * This type ensures type safety when setting attributes on log records while * allowing both standard OpenTelemetry semantic conventions and custom attributes. * * @example * ```typescript * const logRecordAttributes: SemConvLogRecordAttributes = { * "log.level": "INFO", * "log.source": "my-service", * "log.category": "test", * "user.id": "12345", * "string.attr": "string value", * "number.attr": 42, * "boolean.attr": true, * "array.attr": ["item1", "item2", "item3"], * "object.attr": { key1: "value1", key2: "value2" }, * "null.attr": null, * }; * ``` */ type SemConvLogRecordAttributes = Partial>; export { type SemConvAttributes as S, type SemConvAttributeKey as a, type SemConvLogRecordAttributes as b, langwatchAttributes as l };