@@ -33,8 +33,12 @@ public final class CodeIncubatingAttributes {
3333 */
3434 public static final AttributeKey <String > CODE_FILE_PATH = stringKey ("code.file.path" );
3535
36- /** Deprecated, use {@code code.file.path} instead */
37- public static final AttributeKey <String > CODE_FILEPATH = stringKey ("code.filepath" );
36+ /**
37+ * Deprecated, use {@code code.file.path} instead
38+ *
39+ * @deprecated Replaced by {@code code.file.path}
40+ */
41+ @ Deprecated public static final AttributeKey <String > CODE_FILEPATH = stringKey ("code.filepath" );
3842
3943 /**
4044 * Deprecated, use {@code code.function.name} instead
@@ -44,7 +48,30 @@ public final class CodeIncubatingAttributes {
4448 @ Deprecated public static final AttributeKey <String > CODE_FUNCTION = stringKey ("code.function" );
4549
4650 /**
47- * The method or function name, or equivalent (usually rightmost part of the code unit's name).
51+ * The method or function fully-qualified name without arguments. The value should fit the natural
52+ * representation of the language runtime, which is also likely the same used within {@code
53+ * code.stacktrace} attribute value.
54+ *
55+ * <p>Notes:
56+ *
57+ * <p>Values and format depends on each language runtime, thus it is impossible to provide an
58+ * exhaustive list of examples. The values are usually the same (or prefixes of) the ones found in
59+ * native stack trace representation stored in {@code code.stacktrace} without information on
60+ * arguments.
61+ *
62+ * <p>Examples:
63+ *
64+ * <ul>
65+ * <li>Java method: {@code com.example.MyHttpService.serveRequest}
66+ * <li>Java anonymous class method: {@code com.mycompany.Main$1.myMethod}
67+ * <li>Java lambda method: {@code com.mycompany.Main$$Lambda/0x0000748ae4149c00.myMethod}
68+ * <li>PHP function: `GuzzleHttp\Client::transfer
69+ * <li>Go function: {@code github.com/my/repo/pkg.foo.func5}
70+ * <li>Elixir: {@code OpenTelemetry.Ctx.new}
71+ * <li>Erlang: {@code opentelemetry_ctx:new}
72+ * <li>Rust: {@code playground::my_module::my_cool_func}
73+ * <li>C function: {@code fopen}
74+ * </ul>
4875 */
4976 public static final AttributeKey <String > CODE_FUNCTION_NAME = stringKey ("code.function.name" );
5077
@@ -62,15 +89,18 @@ public final class CodeIncubatingAttributes {
6289 @ Deprecated public static final AttributeKey <Long > CODE_LINENO = longKey ("code.lineno" );
6390
6491 /**
65- * The "namespace" within which {@code code.function.name} is defined. Usually the qualified class
66- * or module name, such that {@code code.namespace} + some separator + {@code code.function.name}
67- * form a unique identifier for the code unit.
92+ * Deprecated, namespace is now included into {@code code.function.name}
93+ *
94+ * @deprecated Value should be included in {@code code.function.name} which is expected to be a
95+ * fully-qualified name.
6896 */
69- public static final AttributeKey <String > CODE_NAMESPACE = stringKey ("code.namespace" );
97+ @ Deprecated public static final AttributeKey <String > CODE_NAMESPACE = stringKey ("code.namespace" );
7098
7199 /**
72100 * A stacktrace as a string in the natural representation for the language runtime. The
73- * representation is to be determined and documented by each language SIG.
101+ * representation is identical to <a
102+ * href="/docs/exceptions/exceptions-spans.md#stacktrace-representation">{@code
103+ * exception.stacktrace}</a>.
74104 */
75105 public static final AttributeKey <String > CODE_STACKTRACE = stringKey ("code.stacktrace" );
76106
0 commit comments