Semantic Conventions for CICD Metrics

Status: Experimental

VCS Metrics

The conventions described in this section are specific to Version Control Systems.

Disclaimer: These are initial VCS metrics and attributes but more may be added in the future.

Metric: vcs.change.count

This metric is recommended.

NameInstrument TypeUnit (UCUM)DescriptionStability
vcs.change.countUpDownCounter{change}The number of changes (pull requests/merge requests/changelists) in a repository, categorized by their state (e.g. open or merged)Experimental
AttributeTypeDescriptionExamplesRequirement LevelStability
vcs.change.statestringThe state of the change (pull request/merge request/changelist).open; closed; mergedRequiredExperimental
vcs.repository.url.fullstringThe URL of the repository providing the complete address in order to locate and identify the repository.https://github.com/opentelemetry/open-telemetry-collector-contrib; https://gitlab.com/my-org/my-project/my-projects-project/repoRequiredExperimental

vcs.change.state has the following list of well-known values. If one of them applies, then the respective value MUST be used; otherwise, a custom value MAY be used.

ValueDescriptionStability
closedClosed means the merge request has been closed without merging. This can happen for various reasons, such as the changes being deemed unnecessary, the issue being resolved in another way, or the author deciding to withdraw the request.Experimental
mergedMerged indicates that the change has been successfully integrated into the target codebase.Experimental
openOpen means the change is currently active and under review. It hasn’t been merged into the target branch yet, and it’s still possible to make changes or add comments.Experimental
wipWIP (work-in-progress, draft) means the change is still in progress and not yet ready for a full review. It might still undergo significant changes.Experimental

Metric: vcs.change.duration

This metric is recommended.

NameInstrument TypeUnit (UCUM)DescriptionStability
vcs.change.durationGaugesThe time duration a change (pull request/merge request/changelist) has been in a given state.Experimental
AttributeTypeDescriptionExamplesRequirement LevelStability
vcs.change.statestringThe state of the change (pull request/merge request/changelist).open; closed; mergedRequiredExperimental
vcs.ref.head.namestringThe name of the reference such as branch or tag in the repository.my-feature-branch; tag-1-testRequiredExperimental
vcs.repository.url.fullstringThe URL of the repository providing the complete address in order to locate and identify the repository.https://github.com/opentelemetry/open-telemetry-collector-contrib; https://gitlab.com/my-org/my-project/my-projects-project/repoRequiredExperimental

vcs.change.state has the following list of well-known values. If one of them applies, then the respective value MUST be used; otherwise, a custom value MAY be used.

ValueDescriptionStability
closedClosed means the merge request has been closed without merging. This can happen for various reasons, such as the changes being deemed unnecessary, the issue being resolved in another way, or the author deciding to withdraw the request.Experimental
mergedMerged indicates that the change has been successfully integrated into the target codebase.Experimental
openOpen means the change is currently active and under review. It hasn’t been merged into the target branch yet, and it’s still possible to make changes or add comments.Experimental
wipWIP (work-in-progress, draft) means the change is still in progress and not yet ready for a full review. It might still undergo significant changes.Experimental

Metric: vcs.change.time_to_approval

This metric is recommended.

NameInstrument TypeUnit (UCUM)DescriptionStability
vcs.change.time_to_approvalGaugesThe amount of time since its creation it took a change (pull request/merge request/changelist) to get the first approvalExperimental
AttributeTypeDescriptionExamplesRequirement LevelStability
vcs.ref.head.namestringThe name of the reference such as branch or tag in the repository.my-feature-branch; tag-1-testRequiredExperimental
vcs.repository.url.fullstringThe URL of the repository providing the complete address in order to locate and identify the repository.https://github.com/opentelemetry/open-telemetry-collector-contrib; https://gitlab.com/my-org/my-project/my-projects-project/repoRequiredExperimental

Metric: vcs.repository.count

This metric is recommended.

NameInstrument TypeUnit (UCUM)DescriptionStability
vcs.repository.countUpDownCounter{repository}The number of repositories in an organizationExperimental

Metric: vcs.ref.count

This metric is recommended.

NameInstrument TypeUnit (UCUM)DescriptionStability
vcs.ref.countUpDownCounter{ref}The number of refs of type branch or tag in a repositoryExperimental
AttributeTypeDescriptionExamplesRequirement LevelStability
vcs.ref.typestringThe type of the reference in the repository.branch; tagRequiredExperimental
vcs.repository.url.fullstringThe URL of the repository providing the complete address in order to locate and identify the repository.https://github.com/opentelemetry/open-telemetry-collector-contrib; https://gitlab.com/my-org/my-project/my-projects-project/repoRequiredExperimental

vcs.ref.type has the following list of well-known values. If one of them applies, then the respective value MUST be used; otherwise, a custom value MAY be used.

ValueDescriptionStability
branchbranchExperimental
tagtagExperimental

Metric: vcs.ref.lines_delta

This metric is recommended.

NameInstrument TypeUnit (UCUM)DescriptionStability
vcs.ref.lines_deltaGauge{line}The number of lines added/removed in a ref (branch) relative to the ref from the vcs.ref.base.name attribute [1]Experimental

[1]: This metric should be reported for each vcs.line_change.type value. For example if a ref added 3 lines and removed 2 lines, instrumentation SHOULD report two measurements: 3 and 2 (both positive numbers). If number of lines added/removed should be calculated from the start of time, then vcs.ref.base.name SHOULD be set to an empty string.

AttributeTypeDescriptionExamplesRequirement LevelStability
vcs.line_change.typestringThe type of line change being measured on a branch or change.added; removedRequiredExperimental
vcs.ref.base.namestringThe name of the reference such as branch or tag in the repository.my-feature-branch; tag-1-testRequiredExperimental
vcs.ref.base.typestringThe type of the reference in the repository.branch; tagRequiredExperimental
vcs.ref.head.namestringThe name of the reference such as branch or tag in the repository.my-feature-branch; tag-1-testRequiredExperimental
vcs.ref.head.typestringThe type of the reference in the repository.branch; tagRequiredExperimental
vcs.repository.url.fullstringThe URL of the repository providing the complete address in order to locate and identify the repository.https://github.com/opentelemetry/open-telemetry-collector-contrib; https://gitlab.com/my-org/my-project/my-projects-project/repoRequiredExperimental
vcs.change.idstringThe ID of the change (pull request/merge request/changelist) if applicable. This is usually a unique (within repository) identifier generated by the VCS system.123Conditionally Required if a change is associate with the ref.Experimental

vcs.line_change.type has the following list of well-known values. If one of them applies, then the respective value MUST be used; otherwise, a custom value MAY be used.

ValueDescriptionStability
addedHow many lines were added.Experimental
removedHow many lines were removed.Experimental

vcs.ref.base.type has the following list of well-known values. If one of them applies, then the respective value MUST be used; otherwise, a custom value MAY be used.

ValueDescriptionStability
branchbranchExperimental
tagtagExperimental

vcs.ref.head.type has the following list of well-known values. If one of them applies, then the respective value MUST be used; otherwise, a custom value MAY be used.

ValueDescriptionStability
branchbranchExperimental
tagtagExperimental

Metric: vcs.ref.revisions_delta

This metric is recommended.

NameInstrument TypeUnit (UCUM)DescriptionStability
vcs.ref.revisions_deltaGauge{revision}The number of revisions (commits) a ref (branch) is ahead/behind the branch from the vcs.ref.base.name attribute [1]Experimental

[1]: This metric should be reported for each vcs.revision_delta.direction value. For example if branch a is 3 commits behind and 2 commits ahead of trunk, instrumentation SHOULD report two measurements: 3 and 2 (both positive numbers) and vcs.ref.base.name is set to trunk.

AttributeTypeDescriptionExamplesRequirement LevelStability
vcs.ref.base.namestringThe name of the reference such as branch or tag in the repository.my-feature-branch; tag-1-testRequiredExperimental
vcs.ref.base.typestringThe type of the reference in the repository.branch; tagRequiredExperimental
vcs.ref.head.namestringThe name of the reference such as branch or tag in the repository.my-feature-branch; tag-1-testRequiredExperimental
vcs.ref.head.typestringThe type of the reference in the repository.branch; tagRequiredExperimental
vcs.repository.url.fullstringThe URL of the repository providing the complete address in order to locate and identify the repository.https://github.com/opentelemetry/open-telemetry-collector-contrib; https://gitlab.com/my-org/my-project/my-projects-project/repoRequiredExperimental
vcs.revision_delta.directionstringThe type of revision comparison.ahead; behindRequiredExperimental
vcs.change.idstringThe ID of the change (pull request/merge request/changelist) if applicable. This is usually a unique (within repository) identifier generated by the VCS system.123Conditionally Required if a change is associate with the ref.Experimental

vcs.ref.base.type has the following list of well-known values. If one of them applies, then the respective value MUST be used; otherwise, a custom value MAY be used.

ValueDescriptionStability
branchbranchExperimental
tagtagExperimental

vcs.ref.head.type has the following list of well-known values. If one of them applies, then the respective value MUST be used; otherwise, a custom value MAY be used.

ValueDescriptionStability
branchbranchExperimental
tagtagExperimental

vcs.revision_delta.direction has the following list of well-known values. If one of them applies, then the respective value MUST be used; otherwise, a custom value MAY be used.

ValueDescriptionStability
aheadHow many revisions the change is ahead of the target ref.Experimental
behindHow many revisions the change is behind the target ref.Experimental

Metric: vcs.ref.time

This metric is recommended.

NameInstrument TypeUnit (UCUM)DescriptionStability
vcs.ref.timeGaugesTime a ref (branch) created from the default branch (trunk) has existed. The ref.type attribute will always be branchExperimental
AttributeTypeDescriptionExamplesRequirement LevelStability
vcs.ref.head.namestringThe name of the reference such as branch or tag in the repository.my-feature-branch; tag-1-testRequiredExperimental
vcs.ref.head.typestringThe type of the reference in the repository.branch; tagRequiredExperimental
vcs.repository.url.fullstringThe URL of the repository providing the complete address in order to locate and identify the repository.https://github.com/opentelemetry/open-telemetry-collector-contrib; https://gitlab.com/my-org/my-project/my-projects-project/repoRequiredExperimental

vcs.ref.head.type has the following list of well-known values. If one of them applies, then the respective value MUST be used; otherwise, a custom value MAY be used.

ValueDescriptionStability
branchbranchExperimental
tagtagExperimental

Metric: vcs.contributor.count

This metric is opt-in.

NameInstrument TypeUnit (UCUM)DescriptionStability
vcs.contributor.countGauge{contributor}The number of unique contributors to a repositoryExperimental
AttributeTypeDescriptionExamplesRequirement LevelStability
vcs.repository.url.fullstringThe URL of the repository providing the complete address in order to locate and identify the repository.https://github.com/opentelemetry/open-telemetry-collector-contrib; https://gitlab.com/my-org/my-project/my-projects-project/repoRequiredExperimental