@sentry/conventions 0.19.0 → 0.20.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/README.md CHANGED
@@ -23,5 +23,27 @@
23
23
  The package exports:
24
24
 
25
25
  - `attributes`: contains constants for all attribute names and their types, as defined in the Sentry semantic conventions
26
+ - `attributes.ATTRIBUTE_METADATA`: provides metadata about attributes, such as their type, scrubbing definition, deprecation info, and lookup keys
26
27
  - `attributes.Attributes`: represents a bag of typed attributes
27
28
  - `op`: contains constants for span operations used in Sentry
29
+
30
+ ## Attribute Key Chains
31
+
32
+ An attribute's value may be readable under several keys: its own, the names Sentry search exposes it as, and the deprecated attributes it replaces. `ATTRIBUTE_METADATA[key].keys` lists all of them, most preferred first:
33
+
34
+ ```ts
35
+ import { ATTRIBUTE_METADATA, HTTP_METHOD } from '@sentry/conventions/attributes';
36
+
37
+ ATTRIBUTE_METADATA[HTTP_METHOD].keys;
38
+ // ['http.request.method', 'http.method', 'http.request_method', 'method']
39
+ ```
40
+
41
+ The order within a chain is:
42
+
43
+ 1. the attribute heading the chain, followed by the names it is exposed as in Sentry search
44
+ 2. its non-deprecated aliases, each followed by their own search names
45
+ 3. the deprecated attributes it replaces, in alphabetical order, each followed by their own search names
46
+
47
+ Deprecated attributes are only added to a chain if their status is `normalize` or `backfill`.
48
+ If an attribute is deprecated with another status or status `null`, it's own `keys` array will not contain any
49
+ replacing attribute. Therefore, there's **no guarantee** for a stable attribute in a key chain.