Skip to content

Commit 8cd3574

Browse files
logaretmclaude
andauthored
feat: add sentry.timestamp.sequence attribute to the spec (#262)
* feat: attribute definition * feat: Add sentry.timestamp.sequence attribute definition Add attribute for deterministic ordering of logs and metrics when timestamps share the same integer millisecond. Starts at 0 on SDK init, increments by 1 per captured item, resets when the millisecond changes. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> * Revert "feat: Add sentry.timestamp.sequence attribute definition" This reverts commit f412ffa. * feat: Add sentry.timestamp.sequence attribute definition Add attribute for deterministic ordering of logs and metrics when timestamps share the same integer millisecond. Starts at 0 on SDK init, increments by 1 per captured item, resets when the millisecond changes. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> * chore: Regenerate TS/Python bindings for sentry.timestamp.sequence * chore: Add changelog entry for sentry.timestamp.sequence (PR #262) * chore: Regenerate TS/Python bindings --------- Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
1 parent f8d32eb commit 8cd3574

3 files changed

Lines changed: 73 additions & 0 deletions

File tree

javascript/sentry-conventions/src/attributes.ts

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7471,6 +7471,26 @@ export const SENTRY_STATUS_MESSAGE = 'sentry.status.message';
74717471
*/
74727472
export type SENTRY_STATUS_MESSAGE_TYPE = string;
74737473

7474+
// Path: model/attributes/sentry/sentry__timestamp__sequence.json
7475+
7476+
/**
7477+
* A sequencing counter for deterministic ordering of logs or metrics when timestamps share the same integer millisecond. Starts at 0 on SDK initialization, increments by 1 for each captured item, and resets to 0 when the integer millisecond of the current item differs from the previous one. `sentry.timestamp.sequence`
7478+
*
7479+
* Attribute Value Type: `number` {@link SENTRY_TIMESTAMP_SEQUENCE_TYPE}
7480+
*
7481+
* Contains PII: false
7482+
*
7483+
* Attribute defined in OTEL: No
7484+
*
7485+
* @example 0
7486+
*/
7487+
export const SENTRY_TIMESTAMP_SEQUENCE = 'sentry.timestamp.sequence';
7488+
7489+
/**
7490+
* Type for {@link SENTRY_TIMESTAMP_SEQUENCE} sentry.timestamp.sequence
7491+
*/
7492+
export type SENTRY_TIMESTAMP_SEQUENCE_TYPE = number;
7493+
74747494
// Path: model/attributes/sentry/sentry__trace__parent_span_id.json
74757495

74767496
/**
@@ -9334,6 +9354,7 @@ export const ATTRIBUTE_TYPE: Record<string, AttributeType> = {
93349354
[SENTRY_SPAN_SOURCE]: 'string',
93359355
[SENTRY_STATUS_CODE]: 'integer',
93369356
[SENTRY_STATUS_MESSAGE]: 'string',
9357+
[SENTRY_TIMESTAMP_SEQUENCE]: 'integer',
93379358
[SENTRY_TRACE_PARENT_SPAN_ID]: 'string',
93389359
[SENTRY_TRANSACTION]: 'string',
93399360
[SERVER_ADDRESS]: 'string',
@@ -9765,6 +9786,7 @@ export type AttributeName =
97659786
| typeof SENTRY_SPAN_SOURCE
97669787
| typeof SENTRY_STATUS_CODE
97679788
| typeof SENTRY_STATUS_MESSAGE
9789+
| typeof SENTRY_TIMESTAMP_SEQUENCE
97689790
| typeof SENTRY_TRACE_PARENT_SPAN_ID
97699791
| typeof SENTRY_TRANSACTION
97709792
| typeof SERVER_ADDRESS
@@ -14145,6 +14167,17 @@ export const ATTRIBUTE_METADATA: Record<AttributeName, AttributeMetadata> = {
1414514167
example: 'foobar',
1414614168
changelog: [{ version: '0.3.1', prs: [190] }],
1414714169
},
14170+
[SENTRY_TIMESTAMP_SEQUENCE]: {
14171+
brief:
14172+
'A sequencing counter for deterministic ordering of logs or metrics when timestamps share the same integer millisecond. Starts at 0 on SDK initialization, increments by 1 for each captured item, and resets to 0 when the integer millisecond of the current item differs from the previous one.',
14173+
type: 'integer',
14174+
pii: {
14175+
isPii: 'false',
14176+
},
14177+
isInOtel: false,
14178+
example: 0,
14179+
changelog: [{ version: 'next', prs: [262] }],
14180+
},
1414814181
[SENTRY_TRACE_PARENT_SPAN_ID]: {
1414914182
brief:
1415014183
'The span id of the span that was active when the log was collected. This should not be set if there was no active span.',
@@ -15259,6 +15292,7 @@ export type Attributes = {
1525915292
[SENTRY_SPAN_SOURCE]?: SENTRY_SPAN_SOURCE_TYPE;
1526015293
[SENTRY_STATUS_CODE]?: SENTRY_STATUS_CODE_TYPE;
1526115294
[SENTRY_STATUS_MESSAGE]?: SENTRY_STATUS_MESSAGE_TYPE;
15295+
[SENTRY_TIMESTAMP_SEQUENCE]?: SENTRY_TIMESTAMP_SEQUENCE_TYPE;
1526215296
[SENTRY_TRACE_PARENT_SPAN_ID]?: SENTRY_TRACE_PARENT_SPAN_ID_TYPE;
1526315297
[SENTRY_TRANSACTION]?: SENTRY_TRANSACTION_TYPE;
1526415298
[SERVER_ADDRESS]?: SERVER_ADDRESS_TYPE;
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
{
2+
"key": "sentry.timestamp.sequence",
3+
"brief": "A sequencing counter for deterministic ordering of logs or metrics when timestamps share the same integer millisecond. Starts at 0 on SDK initialization, increments by 1 for each captured item, and resets to 0 when the integer millisecond of the current item differs from the previous one.",
4+
"type": "integer",
5+
"pii": {
6+
"key": "false"
7+
},
8+
"is_in_otel": false,
9+
"example": 0,
10+
"changelog": [
11+
{
12+
"version": "next",
13+
"prs": [262]
14+
}
15+
]
16+
}

python/src/sentry_conventions/attributes.py

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4199,6 +4199,18 @@ class ATTRIBUTE_NAMES(metaclass=_AttributeNamesMeta):
41994199
Example: 200
42004200
"""
42014201

4202+
# Path: model/attributes/sentry/sentry__timestamp__sequence.json
4203+
SENTRY_TIMESTAMP_SEQUENCE: Literal["sentry.timestamp.sequence"] = (
4204+
"sentry.timestamp.sequence"
4205+
)
4206+
"""A sequencing counter for deterministic ordering of logs or metrics when timestamps share the same integer millisecond. Starts at 0 on SDK initialization, increments by 1 for each captured item, and resets to 0 when the integer millisecond of the current item differs from the previous one.
4207+
4208+
Type: int
4209+
Contains PII: false
4210+
Defined in OTEL: No
4211+
Example: 0
4212+
"""
4213+
42024214
# Path: model/attributes/sentry/sentry__trace__parent_span_id.json
42034215
SENTRY_TRACE_PARENT_SPAN_ID: Literal["sentry.trace.parent_span_id"] = (
42044216
"sentry.trace.parent_span_id"
@@ -9114,6 +9126,16 @@ class ATTRIBUTE_NAMES(metaclass=_AttributeNamesMeta):
91149126
ChangelogEntry(version="0.4.0", prs=[223, 228]),
91159127
],
91169128
),
9129+
"sentry.timestamp.sequence": AttributeMetadata(
9130+
brief="A sequencing counter for deterministic ordering of logs or metrics when timestamps share the same integer millisecond. Starts at 0 on SDK initialization, increments by 1 for each captured item, and resets to 0 when the integer millisecond of the current item differs from the previous one.",
9131+
type=AttributeType.INTEGER,
9132+
pii=PiiInfo(isPii=IsPii.FALSE),
9133+
is_in_otel=False,
9134+
example=0,
9135+
changelog=[
9136+
ChangelogEntry(version="next", prs=[262]),
9137+
],
9138+
),
91179139
"sentry.trace.parent_span_id": AttributeMetadata(
91189140
brief="The span id of the span that was active when the log was collected. This should not be set if there was no active span.",
91199141
type=AttributeType.STRING,
@@ -10229,6 +10251,7 @@ class ATTRIBUTE_NAMES(metaclass=_AttributeNamesMeta):
1022910251
"sentry.span.source": str,
1023010252
"sentry.status.message": str,
1023110253
"sentry.status_code": int,
10254+
"sentry.timestamp.sequence": int,
1023210255
"sentry.trace.parent_span_id": str,
1023310256
"sentry.transaction": str,
1023410257
"server.address": str,

0 commit comments

Comments
 (0)