@dash0/sdk-web 0.20.0 → 0.21.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/dist/dash0.iife.js +1 -1
- package/dist/dash0.iife.js.map +1 -1
- package/dist/dash0.js +1 -1
- package/dist/dash0.js.map +1 -1
- package/dist/dash0.umd.cjs +1 -1
- package/dist/dash0.umd.cjs.map +1 -1
- package/dist/modules/api/init.js +2 -0
- package/dist/modules/api/init_test.js +220 -1
- package/dist/modules/api/vcs.js +196 -0
- package/dist/modules/semantic-conventions.js +8 -0
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/dist/types/api/vcs.d.ts +10 -0
- package/dist/types/semantic-conventions.d.ts +7 -0
- package/dist/types/types/options.d.ts +53 -0
- package/package.json +1 -1
- package/src/api/init.ts +3 -0
- package/src/api/init_test.ts +288 -1
- package/src/api/vcs.ts +359 -0
- package/src/semantic-conventions.ts +9 -0
- package/src/types/options.ts +56 -0
package/src/types/options.ts
CHANGED
|
@@ -4,6 +4,29 @@ import { Endpoint, Vars, PropagatorConfig } from "../vars";
|
|
|
4
4
|
|
|
5
5
|
export type InstrumentationName = "@dash0/navigation" | "@dash0/web-vitals" | "@dash0/error" | "@dash0/fetch";
|
|
6
6
|
|
|
7
|
+
/**
|
|
8
|
+
* VCS (version control) context describing the build the SDK is running
|
|
9
|
+
* inside. Used both as the public manual-override shape on `InitOptions.vcs`
|
|
10
|
+
* and internally as the merged result of auto-detection. Each field maps to
|
|
11
|
+
* a standard OpenTelemetry `vcs.*` resource attribute.
|
|
12
|
+
*/
|
|
13
|
+
export type VcsAttributes = {
|
|
14
|
+
/** vcs.provider.name — e.g. "github", "gitlab", "bitbucket". */
|
|
15
|
+
providerName?: string;
|
|
16
|
+
/** vcs.owner.name — repository owner / organization. */
|
|
17
|
+
ownerName?: string;
|
|
18
|
+
/** vcs.repository.name — short repository name (no owner prefix). */
|
|
19
|
+
repositoryName?: string;
|
|
20
|
+
/** vcs.repository.url.full — canonical repository URL. */
|
|
21
|
+
repositoryUrlFull?: string;
|
|
22
|
+
/** vcs.ref.head.name — branch or tag name the build was made from. */
|
|
23
|
+
refHeadName?: string;
|
|
24
|
+
/** vcs.ref.head.revision — commit SHA the build was made from. */
|
|
25
|
+
refHeadRevision?: string;
|
|
26
|
+
/** vcs.change.id — pull/merge request identifier (preview deploys). */
|
|
27
|
+
changeId?: string;
|
|
28
|
+
};
|
|
29
|
+
|
|
7
30
|
export type InitOptions = {
|
|
8
31
|
serviceName: string;
|
|
9
32
|
serviceNamespace?: string;
|
|
@@ -28,6 +51,39 @@ export type InitOptions = {
|
|
|
28
51
|
*/
|
|
29
52
|
rejectSuspiciousServiceName?: boolean;
|
|
30
53
|
|
|
54
|
+
/**
|
|
55
|
+
* When `true`, disable auto-detection of VCS (version control) context
|
|
56
|
+
* from the build environment. By default the SDK reads VCS context from
|
|
57
|
+
* Vercel (`NEXT_PUBLIC_VERCEL_GIT_*`) and Netlify
|
|
58
|
+
* (`NEXT_PUBLIC_REPOSITORY_URL`, `NEXT_PUBLIC_BRANCH`,
|
|
59
|
+
* `NEXT_PUBLIC_COMMIT_REF`, `NEXT_PUBLIC_REVIEW_ID`) and applies the values
|
|
60
|
+
* as resource attributes following the OTel `vcs.*` semantic conventions:
|
|
61
|
+
*
|
|
62
|
+
* - vcs.provider.name
|
|
63
|
+
* - vcs.owner.name
|
|
64
|
+
* - vcs.repository.name
|
|
65
|
+
* - vcs.repository.url.full
|
|
66
|
+
* - vcs.ref.head.name
|
|
67
|
+
* - vcs.ref.head.revision
|
|
68
|
+
* - vcs.change.id
|
|
69
|
+
*
|
|
70
|
+
* Pairing telemetry with the git commit + branch the build came from lets
|
|
71
|
+
* Dash0 Agent answer questions like "which PR introduced this error?".
|
|
72
|
+
*
|
|
73
|
+
* Note: any fields supplied via `vcs` are still applied even when this flag
|
|
74
|
+
* is `true` — manual overrides always win. Set this flag when you want to
|
|
75
|
+
* prevent env-var reads entirely but still supply context explicitly.
|
|
76
|
+
*/
|
|
77
|
+
disableVcsDetection?: boolean;
|
|
78
|
+
|
|
79
|
+
/**
|
|
80
|
+
* Manually specify VCS (version control) context. Each provided field
|
|
81
|
+
* overrides the value the SDK would otherwise auto-detect from the build
|
|
82
|
+
* environment for that attribute. Use this for non-Vercel/Netlify
|
|
83
|
+
* deployments, or when the auto-detected values are wrong.
|
|
84
|
+
*/
|
|
85
|
+
vcs?: VcsAttributes;
|
|
86
|
+
|
|
31
87
|
/**
|
|
32
88
|
* OTLP endpoints to which the generated telemetry should be sent to.
|
|
33
89
|
*/
|