@contrail/telemetry 2.0.4 → 2.0.5-alpha-log-body.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,12 @@ Versioning follows [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
|
|
7
7
|
|
|
8
8
|
## [Unreleased]
|
|
9
9
|
|
|
10
|
+
## [2.0.5] - 2026-04-17
|
|
11
|
+
|
|
12
|
+
### Added
|
|
13
|
+
|
|
14
|
+
- **`contrail.log.body` attribute** — Every OTel log record now carries a `contrail.log.body` custom attribute that duplicates the log body. This enables grouping and filtering by log message in observability UIs (e.g. Dash0) that only expose custom attributes, not the standard `body` field.
|
|
15
|
+
|
|
10
16
|
## [2.0.4] - 2026-04-16
|
|
11
17
|
|
|
12
18
|
### Added
|
package/lib/logger/index.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import pino from 'pino';
|
|
2
2
|
export { parseOtelResourceAttributes } from './parse-otel-resource-attributes';
|
|
3
3
|
export { PINO_LEVEL_TO_OTEL_SEVERITY, PINO_LEVEL_TO_NAME } from './logger-config';
|
|
4
|
-
export { ATTR_LOG_MESSAGE, ATTR_LOG_PAYLOAD } from './semantic-conventions';
|
|
4
|
+
export { ATTR_LOG_MESSAGE, ATTR_LOG_BODY, ATTR_LOG_PAYLOAD } from './semantic-conventions';
|
|
5
5
|
export { loggerStorage, withLogAttributes } from './log-context';
|
|
6
6
|
export declare const baseLogger: pino.Logger<never, boolean>;
|
|
7
7
|
export declare const logger: pino.Logger;
|
package/lib/logger/index.js
CHANGED
|
@@ -4,7 +4,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
4
4
|
};
|
|
5
5
|
var _a, _b, _c, _d, _e, _f, _g;
|
|
6
6
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
7
|
-
exports.logger = exports.baseLogger = exports.withLogAttributes = exports.loggerStorage = exports.ATTR_LOG_PAYLOAD = exports.ATTR_LOG_MESSAGE = exports.PINO_LEVEL_TO_NAME = exports.PINO_LEVEL_TO_OTEL_SEVERITY = exports.parseOtelResourceAttributes = void 0;
|
|
7
|
+
exports.logger = exports.baseLogger = exports.withLogAttributes = exports.loggerStorage = exports.ATTR_LOG_PAYLOAD = exports.ATTR_LOG_BODY = exports.ATTR_LOG_MESSAGE = exports.PINO_LEVEL_TO_NAME = exports.PINO_LEVEL_TO_OTEL_SEVERITY = exports.parseOtelResourceAttributes = void 0;
|
|
8
8
|
exports.addStream = addStream;
|
|
9
9
|
exports.flushLogs = flushLogs;
|
|
10
10
|
const pino_1 = __importDefault(require("pino"));
|
|
@@ -28,6 +28,7 @@ Object.defineProperty(exports, "PINO_LEVEL_TO_OTEL_SEVERITY", { enumerable: true
|
|
|
28
28
|
Object.defineProperty(exports, "PINO_LEVEL_TO_NAME", { enumerable: true, get: function () { return logger_config_2.PINO_LEVEL_TO_NAME; } });
|
|
29
29
|
var semantic_conventions_3 = require("./semantic-conventions");
|
|
30
30
|
Object.defineProperty(exports, "ATTR_LOG_MESSAGE", { enumerable: true, get: function () { return semantic_conventions_3.ATTR_LOG_MESSAGE; } });
|
|
31
|
+
Object.defineProperty(exports, "ATTR_LOG_BODY", { enumerable: true, get: function () { return semantic_conventions_3.ATTR_LOG_BODY; } });
|
|
31
32
|
Object.defineProperty(exports, "ATTR_LOG_PAYLOAD", { enumerable: true, get: function () { return semantic_conventions_3.ATTR_LOG_PAYLOAD; } });
|
|
32
33
|
var log_context_1 = require("./log-context");
|
|
33
34
|
Object.defineProperty(exports, "loggerStorage", { enumerable: true, get: function () { return log_context_1.loggerStorage; } });
|
|
@@ -163,6 +164,7 @@ function createOtelStream() {
|
|
|
163
164
|
// environment, even if user code accidentally sets a conflicting key.
|
|
164
165
|
attributes: {
|
|
165
166
|
...safeAttributes,
|
|
167
|
+
[semantic_conventions_2.ATTR_LOG_BODY]: message,
|
|
166
168
|
...lambdaEnvAttributes,
|
|
167
169
|
...spanAttributes,
|
|
168
170
|
},
|
|
@@ -5,6 +5,11 @@
|
|
|
5
5
|
* Attribute key for the log message body.
|
|
6
6
|
*/
|
|
7
7
|
export declare const ATTR_LOG_MESSAGE: "contrail.message";
|
|
8
|
+
/**
|
|
9
|
+
* Custom attribute that duplicates the log body so it is available for
|
|
10
|
+
* grouping / filtering in observability UIs that only expose custom attributes.
|
|
11
|
+
*/
|
|
12
|
+
export declare const ATTR_LOG_BODY: "contrail.log.body";
|
|
8
13
|
/**
|
|
9
14
|
* Attribute key for user-provided log payload objects.
|
|
10
15
|
*/
|
|
@@ -3,11 +3,16 @@
|
|
|
3
3
|
* Log-specific semantic conventions.
|
|
4
4
|
*/
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.ATTR_LOG_PAYLOAD = exports.ATTR_LOG_MESSAGE = void 0;
|
|
6
|
+
exports.ATTR_LOG_PAYLOAD = exports.ATTR_LOG_BODY = exports.ATTR_LOG_MESSAGE = void 0;
|
|
7
7
|
/**
|
|
8
8
|
* Attribute key for the log message body.
|
|
9
9
|
*/
|
|
10
10
|
exports.ATTR_LOG_MESSAGE = 'contrail.message';
|
|
11
|
+
/**
|
|
12
|
+
* Custom attribute that duplicates the log body so it is available for
|
|
13
|
+
* grouping / filtering in observability UIs that only expose custom attributes.
|
|
14
|
+
*/
|
|
15
|
+
exports.ATTR_LOG_BODY = 'contrail.log.body';
|
|
11
16
|
/**
|
|
12
17
|
* Attribute key for user-provided log payload objects.
|
|
13
18
|
*/
|