Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
75 changes: 75 additions & 0 deletions javascript/sentry-conventions/src/attributes.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9112,6 +9112,49 @@ export const JVM_THREAD_STATE = 'jvm.thread.state';
*/
export type JVM_THREAD_STATE_TYPE = string;

// Path: model/attributes/koa/koa__name.json

/**
* The name of the Koa middleware or matched route that handled the request. `koa.name`
*
* Attribute Value Type: `string` {@link KOA_NAME_TYPE}
*
* Apply Scrubbing: manual
*
* Attribute defined in OTEL: No
* Visibility: public
*
* @deprecated - No single replacement. SDKs should use http.route for router layers and code.function.name for middleware layers instead.
* @example "/users/:id"
*/
export const KOA_NAME = 'koa.name';

/**
* Type for {@link KOA_NAME} koa.name
*/
export type KOA_NAME_TYPE = string;

// Path: model/attributes/koa/koa__type.json

/**
* The type of the Koa layer that handled the request. `koa.type`
*
* Attribute Value Type: `string` {@link KOA_TYPE_TYPE}
*
* Apply Scrubbing: manual
*
* Attribute defined in OTEL: No
* Visibility: public
*
* @example "router"
*/
export const KOA_TYPE = 'koa.type';

/**
* Type for {@link KOA_TYPE} koa.type
*/
export type KOA_TYPE_TYPE = string;

// Path: model/attributes/lcp.json

/**
Expand Down Expand Up @@ -16438,6 +16481,8 @@ export const ATTRIBUTE_TYPE: Record<string, AttributeType> = {
'jvm.memory.type': 'string',
'jvm.thread.daemon': 'boolean',
'jvm.thread.state': 'string',
'koa.name': 'string',
'koa.type': 'string',
lcp: 'double',
'lcp.element': 'string',
'lcp.id': 'string',
Expand Down Expand Up @@ -17163,6 +17208,8 @@ export type AttributeName =
| typeof JVM_MEMORY_TYPE
| typeof JVM_THREAD_DAEMON
| typeof JVM_THREAD_STATE
| typeof KOA_NAME
| typeof KOA_TYPE
| typeof LCP
| typeof LCP_ELEMENT
| typeof LCP_ID
Expand Down Expand Up @@ -23073,6 +23120,32 @@ export const ATTRIBUTE_METADATA: Record<AttributeName, AttributeMetadata> = {
example: 'blocked',
changelog: [{ version: '0.1.0', prs: [127] }, { version: '0.0.0' }],
},
'koa.name': {
brief: 'The name of the Koa middleware or matched route that handled the request.',
type: 'string',
applyScrubbing: {
key: 'manual',
},
isInOtel: false,
visibility: 'public',
example: '/users/:id',
deprecation: {
reason:
'No single replacement. SDKs should use http.route for router layers and code.function.name for middleware layers instead.',
},
changelog: [{ version: 'next', prs: [490], description: 'Added koa.name attribute as deprecated' }],
},
'koa.type': {
brief: 'The type of the Koa layer that handled the request.',
type: 'string',
applyScrubbing: {
key: 'manual',
},
isInOtel: false,
visibility: 'public',
example: 'router',
changelog: [{ version: 'next', prs: [471], description: 'Added koa.type attribute' }],
},
lcp: {
brief: 'The value of the recorded Largest Contentful Paint (LCP) web vital',
type: 'double',
Expand Down Expand Up @@ -27490,6 +27563,8 @@ export type Attributes = {
[JVM_MEMORY_TYPE]?: JVM_MEMORY_TYPE_TYPE;
[JVM_THREAD_DAEMON]?: JVM_THREAD_DAEMON_TYPE;
[JVM_THREAD_STATE]?: JVM_THREAD_STATE_TYPE;
[KOA_NAME]?: KOA_NAME_TYPE;
[KOA_TYPE]?: KOA_TYPE_TYPE;
[LCP]?: LCP_TYPE;
[LCP_ELEMENT]?: LCP_ELEMENT_TYPE;
[LCP_ID]?: LCP_ID_TYPE;
Expand Down
22 changes: 22 additions & 0 deletions model/attributes/koa/koa__name.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
{
"key": "koa.name",
"brief": "The name of the Koa middleware or matched route that handled the request.",
"type": "string",
"apply_scrubbing": {
"key": "manual"
},
"is_in_otel": false,
"example": "/users/:id",
"visibility": "public",
"deprecation": {
"_status": null,
"reason": "No single replacement. SDKs should use http.route for router layers and code.function.name for middleware layers instead."
},
"changelog": [
{
"version": "next",
"prs": [490],
"description": "Added koa.name attribute as deprecated"
}
]
}
18 changes: 18 additions & 0 deletions model/attributes/koa/koa__type.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
{
"key": "koa.type",
"brief": "The type of the Koa layer that handled the request.",
"type": "string",
"apply_scrubbing": {
"key": "manual"
},
"is_in_otel": false,
"example": "router",
"visibility": "public",
"changelog": [
{
"version": "next",
"prs": [471],
"description": "Added koa.type attribute"
}
]
}
57 changes: 57 additions & 0 deletions python/src/sentry_conventions/attributes.py
Original file line number Diff line number Diff line change
Expand Up @@ -216,6 +216,7 @@ class _AttributeNamesMeta(type):
"HTTP_URL",
"HTTP_USER_AGENT",
"INP",
"KOA_NAME",
"LCP_ELEMENT",
"LCP_ID",
"LCP_LOADTIME",
Expand Down Expand Up @@ -5439,6 +5440,29 @@ class ATTRIBUTE_NAMES(metaclass=_AttributeNamesMeta):
Example: "blocked"
"""

# Path: model/attributes/koa/koa__name.json
KOA_NAME: Literal["koa.name"] = "koa.name"
"""The name of the Koa middleware or matched route that handled the request.

Type: str
Apply Scrubbing: manual
Defined in OTEL: No
Visibility: public
DEPRECATED: No replacement at this time - No single replacement. SDKs should use http.route for router layers and code.function.name for middleware layers instead.
Example: "/users/:id"
"""

# Path: model/attributes/koa/koa__type.json
KOA_TYPE: Literal["koa.type"] = "koa.type"
"""The type of the Koa layer that handled the request.

Type: str
Apply Scrubbing: manual
Defined in OTEL: No
Visibility: public
Example: "router"
"""

# Path: model/attributes/lcp/lcp__element.json
LCP_ELEMENT: Literal["lcp.element"] = "lcp.element"
"""The dom element responsible for the largest contentful paint.
Expand Down Expand Up @@ -15320,6 +15344,37 @@ class ATTRIBUTE_NAMES(metaclass=_AttributeNamesMeta):
ChangelogEntry(version="0.0.0"),
],
),
"koa.name": AttributeMetadata(
brief="The name of the Koa middleware or matched route that handled the request.",
type=AttributeType.STRING,
apply_scrubbing=ApplyScrubbingInfo(key=ApplyScrubbing.MANUAL),
is_in_otel=False,
visibility=Visibility.PUBLIC,
example="/users/:id",
deprecation=DeprecationInfo(
reason="No single replacement. SDKs should use http.route for router layers and code.function.name for middleware layers instead."
),
changelog=[
ChangelogEntry(
version="next",
prs=[490],
description="Added koa.name attribute as deprecated",
),
],
),
"koa.type": AttributeMetadata(
brief="The type of the Koa layer that handled the request.",
type=AttributeType.STRING,
apply_scrubbing=ApplyScrubbingInfo(key=ApplyScrubbing.MANUAL),
is_in_otel=False,
visibility=Visibility.PUBLIC,
example="router",
changelog=[
ChangelogEntry(
version="next", prs=[471], description="Added koa.type attribute"
),
],
),
"lcp.element": AttributeMetadata(
brief="The dom element responsible for the largest contentful paint.",
type=AttributeType.STRING,
Expand Down Expand Up @@ -19921,6 +19976,8 @@ class ATTRIBUTE_NAMES(metaclass=_AttributeNamesMeta):
"jvm.memory.type": str,
"jvm.thread.daemon": bool,
"jvm.thread.state": str,
"koa.name": str,
"koa.type": str,
"lcp.element": str,
"lcp.id": str,
"lcp.loadTime": int,
Expand Down
2 changes: 1 addition & 1 deletion scripts/generate_attributes.ts
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ function writeToJs(attributesDir: string, attributeFiles: string[]) {
let individualConstants = '';

// Generate individual attribute constants with documentation AND build the explicit type map
for (const { file, key, constantName, attributeJson, isDeprecated } of allAttributes) {
for (const { file, key, constantName, attributeJson, _isDeprecated } of allAttributes) {
const { brief, type, apply_scrubbing, is_in_otel, example, has_dynamic_suffix, deprecation, alias } = attributeJson;
const visibility = getVisibility(attributeJson);

Expand Down
3 changes: 1 addition & 2 deletions scripts/gzip_folder.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import { createReadStream, createWriteStream } from 'node:fs';
import { join } from 'node:path';
import { createWriteStream } from 'node:fs';
import { pipeline } from 'node:stream';
import { promisify } from 'node:util';
import { createGzip } from 'node:zlib';
Expand Down
2 changes: 1 addition & 1 deletion test/attributes.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -237,7 +237,7 @@ describe('alias group consistency', async () => {
const failedGroups: Array<{ group: string[]; missingAliases: Array<{ key: string; missing: string[] }> }> = [];

// Validate each group
for (const [canonicalKey, group] of aliasGroups) {
for (const [_canonicalKey, group] of aliasGroups) {
const groupArray = Array.from(group).sort();
const missingAliases: Array<{ key: string; missing: string[] }> = [];

Expand Down
Loading