@contrail/telemetry 2.0.0 → 2.0.1-beta.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/CHANGELOG.md CHANGED
@@ -7,6 +7,10 @@ Versioning follows [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
7
7
 
8
8
  ## [Unreleased]
9
9
 
10
+ ### Fixed
11
+
12
+ - **Remove redundant `contrail.message` and `time` from OTel log attributes** — The Pino `messageKey` and `time` fields were leaking into OTel log record attributes, duplicating the body and timestamp that OTel already provides natively. They are now stripped before emitting.
13
+
10
14
  ## [2.0.0] - 2026-04-06
11
15
 
12
16
  ### Added
@@ -111,7 +111,7 @@ function createOtelStream() {
111
111
  var _a, _b;
112
112
  try {
113
113
  const logRecord = JSON.parse(chunk.toString());
114
- const { level, ...attributes } = logRecord;
114
+ const { level, [semantic_conventions_2.ATTR_LOG_MESSAGE]: message, time: _time, ...attributes } = logRecord;
115
115
  const activeSpan = api_1.trace.getSpan(api_1.context.active());
116
116
  const spanContext = activeSpan === null || activeSpan === void 0 ? void 0 : activeSpan.spanContext();
117
117
  const spanAttributes = getSpanAttributes(activeSpan);
@@ -129,7 +129,7 @@ function createOtelStream() {
129
129
  otelLogger.emit({
130
130
  severityNumber: (_a = logger_config_1.PINO_LEVEL_TO_OTEL_SEVERITY[level]) !== null && _a !== void 0 ? _a : api_logs_1.SeverityNumber.INFO,
131
131
  severityText: (_b = logger_config_1.PINO_LEVEL_TO_NAME[level]) !== null && _b !== void 0 ? _b : 'INFO',
132
- body: attributes[semantic_conventions_2.ATTR_LOG_MESSAGE],
132
+ body: message,
133
133
  // Attribute precedence (last-spread-wins):
134
134
  // 1. safeAttributes — flattened user/log-context attributes (lowest priority)
135
135
  // 2. lambdaEnvAttributes — static Lambda env attributes (override user attrs)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@contrail/telemetry",
3
- "version": "2.0.0",
3
+ "version": "2.0.1-beta.0",
4
4
  "description": "Telemetry and monitoring utilities for contrail services",
5
5
  "main": "lib/index.js",
6
6
  "types": "lib/index.d.ts",