@oneuptime/common 11.5.2 → 11.5.3

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.
@@ -0,0 +1,149 @@
1
+ /*
2
+ * Single source of truth for the OpenTelemetry GenAI (gen_ai.*) semantic
3
+ * convention attribute keys OneUptime recognizes when it detects and
4
+ * denormalizes LLM / GenAI / agent telemetry, plus cheap fallbacks for the two
5
+ * dominant instrumentation libraries:
6
+ * - OpenLLMetry / Traceloop (gen_ai.* + traceloop.*)
7
+ * - OpenInference / Arize (llm.* + openinference.span.kind)
8
+ *
9
+ * Both the server-side ingest extractor
10
+ * (Common/Server/Utils/Telemetry/LlmSpan.ts) and the client-side display parser
11
+ * (App/FeatureSet/Dashboard/src/Utils/LlmSpanDisplay.ts) import these lists so
12
+ * the two cannot silently drift apart when a new attribute is added — add a
13
+ * newly recognized key HERE, once.
14
+ *
15
+ * Order matters: within each list the preferred convention comes first and the
16
+ * lookup helpers return the first key that is present.
17
+ */
18
+ // Provider / system, e.g. "openai", "anthropic", "aws.bedrock".
19
+ export const LlmSystemAttributeKeys = [
20
+ "gen_ai.system",
21
+ "gen_ai.provider.name",
22
+ "llm.system",
23
+ "llm.provider",
24
+ ];
25
+ // Operation, e.g. "chat", "embeddings", "execute_tool", "invoke_agent".
26
+ export const LlmOperationAttributeKeys = [
27
+ "gen_ai.operation.name",
28
+ "llm.request.type",
29
+ "openinference.span.kind",
30
+ ];
31
+ // Model requested by the caller.
32
+ export const LlmRequestModelAttributeKeys = [
33
+ "gen_ai.request.model",
34
+ "llm.model_name",
35
+ "llm.request.model",
36
+ ];
37
+ // Model the provider actually served (often the resolved/pinned model).
38
+ export const LlmResponseModelAttributeKeys = [
39
+ "gen_ai.response.model",
40
+ "llm.response.model",
41
+ ];
42
+ export const LlmInputTokenAttributeKeys = [
43
+ "gen_ai.usage.input_tokens",
44
+ "gen_ai.usage.prompt_tokens",
45
+ "llm.token_count.prompt",
46
+ "llm.usage.prompt_tokens",
47
+ ];
48
+ export const LlmOutputTokenAttributeKeys = [
49
+ "gen_ai.usage.output_tokens",
50
+ "gen_ai.usage.completion_tokens",
51
+ "llm.token_count.completion",
52
+ "llm.usage.completion_tokens",
53
+ ];
54
+ export const LlmTotalTokenAttributeKeys = [
55
+ "gen_ai.usage.total_tokens",
56
+ "llm.token_count.total",
57
+ "llm.usage.total_tokens",
58
+ ];
59
+ // Cost in USD. Only populated when the SDK reports it (no built-in pricing).
60
+ export const LlmCostAttributeKeys = [
61
+ "gen_ai.usage.cost",
62
+ "gen_ai.usage.cost_usd",
63
+ "gen_ai.usage.total_cost",
64
+ "llm.usage.total_cost",
65
+ ];
66
+ export const LlmAgentNameAttributeKeys = [
67
+ "gen_ai.agent.name",
68
+ "agent.name",
69
+ ];
70
+ export const LlmToolNameAttributeKeys = [
71
+ "gen_ai.tool.name",
72
+ "tool.name",
73
+ ];
74
+ /*
75
+ * Request-parameter keys — surfaced only in the display panel, never
76
+ * denormalized to DB columns.
77
+ */
78
+ export const LlmTemperatureAttributeKeys = [
79
+ "gen_ai.request.temperature",
80
+ "llm.request.temperature",
81
+ ];
82
+ export const LlmMaxTokensAttributeKeys = [
83
+ "gen_ai.request.max_tokens",
84
+ "llm.request.max_tokens",
85
+ ];
86
+ export const LlmTopPAttributeKeys = [
87
+ "gen_ai.request.top_p",
88
+ "llm.request.top_p",
89
+ ];
90
+ export const LlmFinishReasonAttributeKeys = [
91
+ "gen_ai.response.finish_reasons",
92
+ "gen_ai.response.finish_reason",
93
+ "llm.response.finish_reason",
94
+ ];
95
+ /*
96
+ * Attribute-key namespace prefixes. Any span carrying an attribute in one of
97
+ * these namespaces is treated as an LLM/GenAI span as a last resort.
98
+ */
99
+ export const LlmAttributeNamespacePrefixes = [
100
+ "gen_ai.",
101
+ "llm.",
102
+ "traceloop.",
103
+ ];
104
+ export const LlmPromptIndexedMessageConventions = [
105
+ // OpenLLMetry indexed prompts.
106
+ { prefix: "gen_ai.prompt", contentSuffix: "content", roleSuffix: "role" },
107
+ // OpenInference indexed input messages.
108
+ {
109
+ prefix: "llm.input_messages",
110
+ contentSuffix: "message.content",
111
+ roleSuffix: "message.role",
112
+ },
113
+ ];
114
+ export const LlmCompletionIndexedMessageConventions = [
115
+ // OpenLLMetry indexed completions.
116
+ {
117
+ prefix: "gen_ai.completion",
118
+ contentSuffix: "content",
119
+ roleSuffix: "role",
120
+ },
121
+ // OpenInference indexed output messages.
122
+ {
123
+ prefix: "llm.output_messages",
124
+ contentSuffix: "message.content",
125
+ roleSuffix: "message.role",
126
+ },
127
+ ];
128
+ // JSON-encoded message-array attribute keys (checked in order).
129
+ export const LlmPromptJsonAttributeKeys = [
130
+ "gen_ai.input.messages",
131
+ "gen_ai.prompt",
132
+ "input.value",
133
+ ];
134
+ export const LlmCompletionJsonAttributeKeys = [
135
+ "gen_ai.output.messages",
136
+ "gen_ai.completion",
137
+ "output.value",
138
+ ];
139
+ // Span-event names carrying prompt/completion content.
140
+ export const LlmPromptEventNames = [
141
+ "gen_ai.system.message",
142
+ "gen_ai.user.message",
143
+ "gen_ai.tool.message",
144
+ ];
145
+ export const LlmCompletionEventNames = [
146
+ "gen_ai.assistant.message",
147
+ "gen_ai.choice",
148
+ ];
149
+ //# sourceMappingURL=LlmConventions.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"LlmConventions.js","sourceRoot":"","sources":["../../../../Types/Telemetry/LlmConventions.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAEH,gEAAgE;AAChE,MAAM,CAAC,MAAM,sBAAsB,GAAkB;IACnD,eAAe;IACf,sBAAsB;IACtB,YAAY;IACZ,cAAc;CACf,CAAC;AAEF,wEAAwE;AACxE,MAAM,CAAC,MAAM,yBAAyB,GAAkB;IACtD,uBAAuB;IACvB,kBAAkB;IAClB,yBAAyB;CAC1B,CAAC;AAEF,iCAAiC;AACjC,MAAM,CAAC,MAAM,4BAA4B,GAAkB;IACzD,sBAAsB;IACtB,gBAAg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+B;IAC/B,EAAE,MAAM,EAAE,eAAe,EAAE,aAAa,EAAE,SAAS,EAAE,UAAU,EAAE,MAAM,EAAE;IACzE,wCAAwC;IACxC;QACE,MAAM,EAAE,oBAAoB;QAC5B,aAAa,EAAE,iBAAiB;QAChC,UAAU,EAAE,cAAc;KAC3B;CACF,CAAC;AAEJ,MAAM,CAAC,MAAM,sCAAsC,GACjD;IACE,mCAAmC;IACnC;QACE,MAAM,EAAE,mBAAmB;QAC3B,aAAa,EAAE,SAAS;QACxB,UAAU,EAAE,MAAM;KACnB;IACD,yCAAyC;IACzC;QACE,MAAM,EAAE,qBAAqB;QAC7B,aAAa,EAAE,iBAAiB;QAChC,UAAU,EAAE,cAAc;KAC3B;CACF,CAAC;AAEJ,gEAAgE;AAChE,MAAM,CAAC,MAAM,0BAA0B,GAAkB;IACvD,uBAAuB;IACvB,eAAe;IACf,aAAa;CACd,CAAC;AAEF,MAAM,CAAC,MAAM,8BAA8B,GAAkB;IAC3D,wBAAwB;IACxB,mBAAmB;IACnB,cAAc;CACf,CAAC;AAEF,uDAAuD;AACvD,MAAM,CAAC,MAAM,mBAAmB,GAAkB;IAChD,uBAAuB;IACvB,qBAAqB;IACrB,qBAAqB;CACtB,CAAC;AAEF,MAAM,CAAC,MAAM,uBAAuB,GAAkB;IACpD,0BAA0B;IAC1B,eAAe;CAChB,CAAC"}
@@ -4,10 +4,7 @@ const PlaceholderText = (props) => {
4
4
  var _a;
5
5
  const { translateString } = useTranslateValue();
6
6
  const translatedText = (_a = translateString(props.text)) !== null && _a !== void 0 ? _a : props.text;
7
- return (React.createElement("span", { className: "inline-flex items-center gap-1.5 text-gray-400 italic text-sm select-none px-2 py-0.5 rounded-md bg-gray-50 border border-dashed border-gray-200" },
8
- React.createElement("svg", { className: "w-3.5 h-3.5 text-gray-300", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor" },
9
- React.createElement("path", { strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: 1.5, d: "M20 12H4" })),
10
- translatedText));
7
+ return (React.createElement("span", { className: "inline-flex items-center whitespace-nowrap rounded-md border border-dashed border-gray-300 bg-gray-50 px-2 py-0.5 align-middle text-sm font-normal text-gray-500 select-none" }, translatedText));
11
8
  };
12
9
  export default PlaceholderText;
13
10
  //# sourceMappingURL=PlaceholderText.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"PlaceholderText.js","sourceRoot":"","sources":["../../../../../UI/Components/Detail/PlaceholderText.tsx"],"names":[],"mappings":"AAAA,OAAO,iBAAiB,MAAM,yBAAyB,CAAC;AACxD,OAAO,KAA0C,MAAM,OAAO,CAAC;AAM/D,MAAM,eAAe,GAAsC,CACzD,KAAqB,EACP,EAAE;;IAChB,MAAM,EAAE,eAAe,EAAE,GAAG,iBAAiB,EAAE,CAAC;IAChD,MAAM,cAAc,GAAW,MAAA,eAAe,CAAC,KAAK,CAAC,IAAI,CAAC,mCAAI,KAAK,CAAC,IAAI,CAAC;IACzE,OAAO,CACL,8BAAM,SAAS,EAAC,kJAAkJ;QAChK,6BACE,SAAS,EAAC,2BAA2B,EACrC,IAAI,EAAC,MAAM,EACX,OAAO,EAAC,WAAW,EACnB,MAAM,EAAC,cAAc;YAErB,8BACE,aAAa,EAAC,OAAO,EACrB,cAAc,EAAC,OAAO,EACtB,WAAW,EAAE,GAAG,EAChB,CAAC,EAAC,UAAU,GACZ,CACE;QACL,cAAc,CACV,CACR,CAAC;AACJ,CAAC,CAAC;AAEF,eAAe,eAAe,CAAC"}
1
+ {"version":3,"file":"PlaceholderText.js","sourceRoot":"","sources":["../../../../../UI/Components/Detail/PlaceholderText.tsx"],"names":[],"mappings":"AAAA,OAAO,iBAAiB,MAAM,yBAAyB,CAAC;AACxD,OAAO,KAA0C,MAAM,OAAO,CAAC;AAM/D,MAAM,eAAe,GAAsC,CACzD,KAAqB,EACP,EAAE;;IAChB,MAAM,EAAE,eAAe,EAAE,GAAG,iBAAiB,EAAE,CAAC;IAChD,MAAM,cAAc,GAAW,MAAA,eAAe,CAAC,KAAK,CAAC,IAAI,CAAC,mCAAI,KAAK,CAAC,IAAI,CAAC;IACzE,OAAO,CACL,8BAAM,SAAS,EAAC,8KAA8K,IAC3L,cAAc,CACV,CACR,CAAC;AACJ,CAAC,CAAC;AAEF,eAAe,eAAe,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@oneuptime/common",
3
- "version": "11.5.2",
3
+ "version": "11.5.3",
4
4
  "description": "",
5
5
  "repository": {
6
6
  "type": "git",