diff --git a/generated/attributes/flag.md b/generated/attributes/flag.md new file mode 100644 index 0000000..7045605 --- /dev/null +++ b/generated/attributes/flag.md @@ -0,0 +1,21 @@ + + +# Flag Attributes + +- [Stable Attributes](#stable-attributes) + - [flag.evaluation.\](#flagevaluationkey) + +## Stable Attributes + +### flag.evaluation.\ + +An instance of a feature flag evaluation. The value of this attribute is the boolean representing the evaluation result. The \ suffix is the name of the feature flag. + +| Property | Value | +| --- | --- | +| Type | `boolean` | +| Has PII | false | +| Exists in OpenTelemetry | No | +| Has dynamic suffix | Yes | +| Example | `flag.evaluation.is_new_ui=true` | + diff --git a/generated/attributes/index.md b/generated/attributes/index.md index c98fa44..50827a7 100644 --- a/generated/attributes/index.md +++ b/generated/attributes/index.md @@ -16,6 +16,7 @@ This directory contains documentation for all available attributes. - [`error` Attributes](./error.md) - [`exception` Attributes](./exception.md) - [`faas` Attributes](./faas.md) +- [`flag` Attributes](./flag.md) - [`frames` Attributes](./frames.md) - [`gen_ai` Attributes](./gen_ai.md) - [`general` Attributes](./general.md) diff --git a/javascript/sentry-conventions/src/attributes.ts b/javascript/sentry-conventions/src/attributes.ts index d2b0190..f337ce5 100644 --- a/javascript/sentry-conventions/src/attributes.ts +++ b/javascript/sentry-conventions/src/attributes.ts @@ -894,6 +894,23 @@ export const FAAS_TIME = 'faas.time'; */ export const FAAS_TRIGGER = 'faas.trigger'; +// Path: model/attributes/flag/flag__evaluation__.json + +/** + * An instance of a feature flag evaluation. The value of this attribute is the boolean representing the evaluation result. The suffix is the name of the feature flag. + * + * Attribute Value Type: boolean + * + * Contains PII: false + * + * Attribute defined in OTEL: No + * + * Has Dynamic Suffix: true + * + * @example "flag.evaluation.is_new_ui=true" + */ +export const FLAG_EVALUATION_KEY = 'flag.evaluation.'; + // Path: model/attributes/frames/frames__delay.json /** @@ -3631,6 +3648,7 @@ export type Attributes = { [FAAS_CRON]?: string; [FAAS_TIME]?: string; [FAAS_TRIGGER]?: string; + [FLAG_EVALUATION_KEY]?: boolean; [FRAMES_DELAY]?: number; [FRAMES_FROZEN]?: number; [FRAMES_SLOW]?: number; @@ -3820,6 +3838,7 @@ export type FullAttributes = { [FAAS_CRON]?: string; [FAAS_TIME]?: string; [FAAS_TRIGGER]?: string; + [FLAG_EVALUATION_KEY]?: boolean; [FRAMES_DELAY]?: number; [FRAMES_FROZEN]?: number; [FRAMES_SLOW]?: number; diff --git a/model/attributes/flag/flag__evaluation__.json b/model/attributes/flag/flag__evaluation__.json new file mode 100644 index 0000000..0701282 --- /dev/null +++ b/model/attributes/flag/flag__evaluation__.json @@ -0,0 +1,11 @@ +{ + "key": "flag.evaluation.", + "brief": "An instance of a feature flag evaluation. The value of this attribute is the boolean representing the evaluation result. The suffix is the name of the feature flag.", + "has_dynamic_suffix": true, + "type": "boolean", + "pii": { + "key": "false" + }, + "is_in_otel": false, + "example": "flag.evaluation.is_new_ui=true" +} diff --git a/model/attributes/sentry/sentry__sdk__integrations.json b/model/attributes/sentry/sentry__sdk__integrations.json index 8f106ee..680cb54 100644 --- a/model/attributes/sentry/sentry__sdk__integrations.json +++ b/model/attributes/sentry/sentry__sdk__integrations.json @@ -6,10 +6,5 @@ "key": "false" }, "is_in_otel": false, - "example": [ - "InboundFilters", - "FunctionToString", - "BrowserApiErrors", - "Breadcrumbs" - ] + "example": ["InboundFilters", "FunctionToString", "BrowserApiErrors", "Breadcrumbs"] } diff --git a/scripts/create_attribute.ts b/scripts/create_attribute.ts index 882ec49..ceedfeb 100644 --- a/scripts/create_attribute.ts +++ b/scripts/create_attribute.ts @@ -1,8 +1,8 @@ +import { execSync } from 'node:child_process'; import fs from 'node:fs'; import path from 'node:path'; import readline from 'node:readline'; import { parseArgs } from 'node:util'; -import { execSync } from 'node:child_process'; import Ajv from 'ajv'; const HELP_TEXT = ` @@ -158,7 +158,7 @@ const createAttribute = async () => { fs.mkdirSync(dirPath, { recursive: true }); } // Convert rest parts to use double underscores instead of dots - const fileName = parts.join('__').replace(//g, 'key'); + const fileName = parts.join('__'); filePath = path.join(dirPath, `${fileName}.json`); }