diff --git a/docs/attributes-registry/vcs.md b/docs/attributes-registry/vcs.md index 4c5eb5c299..5481906bb0 100644 --- a/docs/attributes-registry/vcs.md +++ b/docs/attributes-registry/vcs.md @@ -18,10 +18,12 @@ This group defines the attributes for [Version Control Systems (VCS)](https://en | `vcs.change.id` | string | The ID of the change (pull request/merge request/changelist) if applicable. This is usually a unique (within repository) identifier generated by the VCS system. | `123` | ![Experimental](https://img.shields.io/badge/-experimental-blue) | | `vcs.change.state` | string | The state of the change (pull request/merge request/changelist). | `open`; `closed`; `merged` | ![Experimental](https://img.shields.io/badge/-experimental-blue) | | `vcs.change.title` | string | The human readable title of the change (pull request/merge request/changelist). This title is often a brief summary of the change and may get merged in to a ref as the commit summary. | `Fixes broken thing`; `feat: add my new feature`; `[chore] update dependency` | ![Experimental](https://img.shields.io/badge/-experimental-blue) | +| `vcs.line_change.type` | string | The type of line change being measured on a branch or change. | `added`; `removed` | ![Experimental](https://img.shields.io/badge/-experimental-blue) | | `vcs.ref.name` | string | The name of the [reference](https://git-scm.com/docs/gitglossary#def_ref) such as **branch** or **tag** in the repository. | `my-feature-branch`; `tag-1-test` | ![Experimental](https://img.shields.io/badge/-experimental-blue) | | `vcs.ref.revision` | string | The revision, literally [revised version](https://www.merriam-webster.com/dictionary/revision), The revision most often refers to a commit object in Git, or a revision number in SVN. [1] | `9d59409acf479dfa0df1aa568182e43e43df8bbe28d60fcf2bc52e30068802cc`; `main`; `123`; `HEAD` | ![Experimental](https://img.shields.io/badge/-experimental-blue) | | `vcs.ref.type` | string | The type of the [reference](https://git-scm.com/docs/gitglossary#def_ref) in the repository. | `branch`; `tag` | ![Experimental](https://img.shields.io/badge/-experimental-blue) | | `vcs.repository.url.full` | string | The [URL](https://en.wikipedia.org/wiki/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/repo` | ![Experimental](https://img.shields.io/badge/-experimental-blue) | +| `vcs.revision_delta.type` | string | The type of . | `ahead`; `behind` | ![Experimental](https://img.shields.io/badge/-experimental-blue) | **[1]:** The revision can be a full [hash value (see glossary)](https://nvlpubs.nist.gov/nistpubs/FIPS/NIST.FIPS.186-5.pdf), of the recorded change to a ref within a repository pointing to a @@ -42,6 +44,13 @@ based on the VCS system and situational context. | `open` | Open 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](https://img.shields.io/badge/-experimental-blue) | | `wip` | WIP (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](https://img.shields.io/badge/-experimental-blue) | +`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. + +| Value | Description | Stability | +| --------- | ---------------------------- | ---------------------------------------------------------------- | +| `added` | How many lines were added. | ![Experimental](https://img.shields.io/badge/-experimental-blue) | +| `removed` | How many lines were removed. | ![Experimental](https://img.shields.io/badge/-experimental-blue) | + `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. | Value | Description | Stability | @@ -49,6 +58,13 @@ based on the VCS system and situational context. | `branch` | [branch](https://git-scm.com/docs/gitglossary#Documentation/gitglossary.txt-aiddefbranchabranch) | ![Experimental](https://img.shields.io/badge/-experimental-blue) | | `tag` | [tag](https://git-scm.com/docs/gitglossary#Documentation/gitglossary.txt-aiddeftagatag) | ![Experimental](https://img.shields.io/badge/-experimental-blue) | +`vcs.revision_delta.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. + +| Value | Description | Stability | +| -------- | --------------------------------------------------------- | ---------------------------------------------------------------- | +| `ahead` | How many revisions the change is ahead of the target ref. | ![Experimental](https://img.shields.io/badge/-experimental-blue) | +| `behind` | How many revisions the change is behind the target ref. | ![Experimental](https://img.shields.io/badge/-experimental-blue) | + ## VCS Deprecated Attributes "Describes deprecated vcs attributes." diff --git a/docs/cicd/cicd-metrics.md b/docs/cicd/cicd-metrics.md index e1f1409f66..3256442449 100644 --- a/docs/cicd/cicd-metrics.md +++ b/docs/cicd/cicd-metrics.md @@ -14,12 +14,12 @@ linkTitle: CICD metrics - [Metric: `vcs.change.count`](#metric-vcschangecount) - [Metric: `vcs.change.duration`](#metric-vcschangeduration) - [Metric: `vcs.change.time_to_approval`](#metric-vcschangetime_to_approval) + - [Metric: `vcs.change.lines_delta`](#metric-vcschangelines_delta) + - [Metric: `vcs.change.revisions_delta`](#metric-vcschangerevisions_delta) - [Metric: `vcs.repository.count`](#metric-vcsrepositorycount) - [Metric: `vcs.ref.count`](#metric-vcsrefcount) - - [Metric: `vcs.ref.lines_added`](#metric-vcsreflines_added) - - [Metric: `vcs.ref.lines_deleted`](#metric-vcsreflines_deleted) - - [Metric: `vcs.ref.revisions_ahead`](#metric-vcsrefrevisions_ahead) - - [Metric: `vcs.ref.revisions_behind`](#metric-vcsrefrevisions_behind) + - [Metric: `vcs.ref.lines_delta`](#metric-vcsreflines_delta) + - [Metric: `vcs.ref.revisions_delta`](#metric-vcsrefrevisions_delta) - [Metric: `vcs.ref.time`](#metric-vcsreftime) - [Metric: `vcs.repository.contributor.count`](#metric-vcsrepositorycontributorcount) @@ -131,11 +131,11 @@ This metric is [recommended][MetricRecommended]. -### Metric: `vcs.repository.count` +### Metric: `vcs.change.lines_delta` This metric is [recommended][MetricRecommended]. - + @@ -144,7 +144,30 @@ This metric is [recommended][MetricRecommended]. | Name | Instrument Type | Unit (UCUM) | Description | Stability | | -------- | --------------- | ----------- | -------------- | --------- | -| `vcs.repository.count` | UpDownCounter | `{repository}` | The number of repositories in an organization | ![Experimental](https://img.shields.io/badge/-experimental-blue) | +| `vcs.change.lines_delta` | Gauge | `{line}` | The number of lines added/removed in a change relative to the target branch of the change) | ![Experimental](https://img.shields.io/badge/-experimental-blue) | + +| Attribute | Type | Description | Examples | [Requirement Level](https://opentelemetry.io/docs/specs/semconv/general/attribute-requirement-level/) | Stability | +|---|---|---|---|---|---| +| [`vcs.line_change.type`](/docs/attributes-registry/vcs.md) | string | The type of line change being measured on a branch or change. | `added`; `removed` | `Required` | ![Experimental](https://img.shields.io/badge/-experimental-blue) | +| [`vcs.ref.name`](/docs/attributes-registry/vcs.md) | string | The name of the [reference](https://git-scm.com/docs/gitglossary#def_ref) such as **branch** or **tag** in the repository. | `my-feature-branch`; `tag-1-test` | `Required` | ![Experimental](https://img.shields.io/badge/-experimental-blue) | +| [`vcs.ref.type`](/docs/attributes-registry/vcs.md) | string | The type of the [reference](https://git-scm.com/docs/gitglossary#def_ref) in the repository. | `branch`; `tag` | `Required` | ![Experimental](https://img.shields.io/badge/-experimental-blue) | +| [`vcs.repository.url.full`](/docs/attributes-registry/vcs.md) | string | The [URL](https://en.wikipedia.org/wiki/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/repo` | `Required` | ![Experimental](https://img.shields.io/badge/-experimental-blue) | + +`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. + +| Value | Description | Stability | +|---|---|---| +| `added` | How many lines were added. | ![Experimental](https://img.shields.io/badge/-experimental-blue) | +| `removed` | How many lines were removed. | ![Experimental](https://img.shields.io/badge/-experimental-blue) | + + +`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. + +| Value | Description | Stability | +|---|---|---| +| `branch` | [branch](https://git-scm.com/docs/gitglossary#Documentation/gitglossary.txt-aiddefbranchabranch) | ![Experimental](https://img.shields.io/badge/-experimental-blue) | +| `tag` | [tag](https://git-scm.com/docs/gitglossary#Documentation/gitglossary.txt-aiddeftagatag) | ![Experimental](https://img.shields.io/badge/-experimental-blue) | + @@ -152,11 +175,11 @@ This metric is [recommended][MetricRecommended]. -### Metric: `vcs.ref.count` +### Metric: `vcs.change.revisions_delta` This metric is [recommended][MetricRecommended]. - + @@ -165,12 +188,14 @@ This metric is [recommended][MetricRecommended]. | Name | Instrument Type | Unit (UCUM) | Description | Stability | | -------- | --------------- | ----------- | -------------- | --------- | -| `vcs.ref.count` | UpDownCounter | `{ref}` | The number of refs of type branch or tag in a repository | ![Experimental](https://img.shields.io/badge/-experimental-blue) | +| `vcs.change.revisions_delta` | Gauge | `{revision}` | The number of revisions (commits) a change is ahead/behind the target branch of the change | ![Experimental](https://img.shields.io/badge/-experimental-blue) | | Attribute | Type | Description | Examples | [Requirement Level](https://opentelemetry.io/docs/specs/semconv/general/attribute-requirement-level/) | Stability | |---|---|---|---|---|---| +| [`vcs.ref.name`](/docs/attributes-registry/vcs.md) | string | The name of the [reference](https://git-scm.com/docs/gitglossary#def_ref) such as **branch** or **tag** in the repository. | `my-feature-branch`; `tag-1-test` | `Required` | ![Experimental](https://img.shields.io/badge/-experimental-blue) | | [`vcs.ref.type`](/docs/attributes-registry/vcs.md) | string | The type of the [reference](https://git-scm.com/docs/gitglossary#def_ref) in the repository. | `branch`; `tag` | `Required` | ![Experimental](https://img.shields.io/badge/-experimental-blue) | | [`vcs.repository.url.full`](/docs/attributes-registry/vcs.md) | string | The [URL](https://en.wikipedia.org/wiki/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/repo` | `Required` | ![Experimental](https://img.shields.io/badge/-experimental-blue) | +| [`vcs.revision_delta.type`](/docs/attributes-registry/vcs.md) | string | The type of . | `ahead`; `behind` | `Required` | ![Experimental](https://img.shields.io/badge/-experimental-blue) | `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. @@ -180,17 +205,25 @@ This metric is [recommended][MetricRecommended]. | `tag` | [tag](https://git-scm.com/docs/gitglossary#Documentation/gitglossary.txt-aiddeftagatag) | ![Experimental](https://img.shields.io/badge/-experimental-blue) | +`vcs.revision_delta.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. + +| Value | Description | Stability | +|---|---|---| +| `ahead` | How many revisions the change is ahead of the target ref. | ![Experimental](https://img.shields.io/badge/-experimental-blue) | +| `behind` | How many revisions the change is behind the target ref. | ![Experimental](https://img.shields.io/badge/-experimental-blue) | + + -### Metric: `vcs.ref.lines_added` +### Metric: `vcs.repository.count` This metric is [recommended][MetricRecommended]. - + @@ -199,21 +232,7 @@ This metric is [recommended][MetricRecommended]. | Name | Instrument Type | Unit (UCUM) | Description | Stability | | -------- | --------------- | ----------- | -------------- | --------- | -| `vcs.ref.lines_added` | Gauge | `{line}` | The number of lines added in a ref (branch) relative to the default branch (trunk) | ![Experimental](https://img.shields.io/badge/-experimental-blue) | - -| Attribute | Type | Description | Examples | [Requirement Level](https://opentelemetry.io/docs/specs/semconv/general/attribute-requirement-level/) | Stability | -|---|---|---|---|---|---| -| [`vcs.ref.name`](/docs/attributes-registry/vcs.md) | string | The name of the [reference](https://git-scm.com/docs/gitglossary#def_ref) such as **branch** or **tag** in the repository. | `my-feature-branch`; `tag-1-test` | `Required` | ![Experimental](https://img.shields.io/badge/-experimental-blue) | -| [`vcs.ref.type`](/docs/attributes-registry/vcs.md) | string | The type of the [reference](https://git-scm.com/docs/gitglossary#def_ref) in the repository. | `branch`; `tag` | `Required` | ![Experimental](https://img.shields.io/badge/-experimental-blue) | -| [`vcs.repository.url.full`](/docs/attributes-registry/vcs.md) | string | The [URL](https://en.wikipedia.org/wiki/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/repo` | `Required` | ![Experimental](https://img.shields.io/badge/-experimental-blue) | - -`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. - -| Value | Description | Stability | -|---|---|---| -| `branch` | [branch](https://git-scm.com/docs/gitglossary#Documentation/gitglossary.txt-aiddefbranchabranch) | ![Experimental](https://img.shields.io/badge/-experimental-blue) | -| `tag` | [tag](https://git-scm.com/docs/gitglossary#Documentation/gitglossary.txt-aiddeftagatag) | ![Experimental](https://img.shields.io/badge/-experimental-blue) | - +| `vcs.repository.count` | UpDownCounter | `{repository}` | The number of repositories in an organization | ![Experimental](https://img.shields.io/badge/-experimental-blue) | @@ -221,11 +240,11 @@ This metric is [recommended][MetricRecommended]. -### Metric: `vcs.ref.lines_deleted` +### Metric: `vcs.ref.count` This metric is [recommended][MetricRecommended]. - + @@ -234,11 +253,10 @@ This metric is [recommended][MetricRecommended]. | Name | Instrument Type | Unit (UCUM) | Description | Stability | | -------- | --------------- | ----------- | -------------- | --------- | -| `vcs.ref.lines_deleted` | Gauge | `{line}` | The number of lines deleted in a ref (branch) relative to the default branch (trunk) | ![Experimental](https://img.shields.io/badge/-experimental-blue) | +| `vcs.ref.count` | UpDownCounter | `{ref}` | The number of refs of type branch or tag in a repository | ![Experimental](https://img.shields.io/badge/-experimental-blue) | | Attribute | Type | Description | Examples | [Requirement Level](https://opentelemetry.io/docs/specs/semconv/general/attribute-requirement-level/) | Stability | |---|---|---|---|---|---| -| [`vcs.ref.name`](/docs/attributes-registry/vcs.md) | string | The name of the [reference](https://git-scm.com/docs/gitglossary#def_ref) such as **branch** or **tag** in the repository. | `my-feature-branch`; `tag-1-test` | `Required` | ![Experimental](https://img.shields.io/badge/-experimental-blue) | | [`vcs.ref.type`](/docs/attributes-registry/vcs.md) | string | The type of the [reference](https://git-scm.com/docs/gitglossary#def_ref) in the repository. | `branch`; `tag` | `Required` | ![Experimental](https://img.shields.io/badge/-experimental-blue) | | [`vcs.repository.url.full`](/docs/attributes-registry/vcs.md) | string | The [URL](https://en.wikipedia.org/wiki/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/repo` | `Required` | ![Experimental](https://img.shields.io/badge/-experimental-blue) | @@ -256,11 +274,11 @@ This metric is [recommended][MetricRecommended]. -### Metric: `vcs.ref.revisions_ahead` +### Metric: `vcs.ref.lines_delta` This metric is [recommended][MetricRecommended]. - + @@ -269,14 +287,23 @@ This metric is [recommended][MetricRecommended]. | Name | Instrument Type | Unit (UCUM) | Description | Stability | | -------- | --------------- | ----------- | -------------- | --------- | -| `vcs.ref.revisions_ahead` | Gauge | `{revision}` | The number of revisions (commits) a ref (branch) is ahead of the default branch (trunk) | ![Experimental](https://img.shields.io/badge/-experimental-blue) | +| `vcs.ref.lines_delta` | Gauge | `{line}` | The number of lines added/removed in a ref (branch) relative to the previous day | ![Experimental](https://img.shields.io/badge/-experimental-blue) | | Attribute | Type | Description | Examples | [Requirement Level](https://opentelemetry.io/docs/specs/semconv/general/attribute-requirement-level/) | Stability | |---|---|---|---|---|---| +| [`vcs.line_change.type`](/docs/attributes-registry/vcs.md) | string | The type of line change being measured on a branch or change. | `added`; `removed` | `Required` | ![Experimental](https://img.shields.io/badge/-experimental-blue) | | [`vcs.ref.name`](/docs/attributes-registry/vcs.md) | string | The name of the [reference](https://git-scm.com/docs/gitglossary#def_ref) such as **branch** or **tag** in the repository. | `my-feature-branch`; `tag-1-test` | `Required` | ![Experimental](https://img.shields.io/badge/-experimental-blue) | | [`vcs.ref.type`](/docs/attributes-registry/vcs.md) | string | The type of the [reference](https://git-scm.com/docs/gitglossary#def_ref) in the repository. | `branch`; `tag` | `Required` | ![Experimental](https://img.shields.io/badge/-experimental-blue) | | [`vcs.repository.url.full`](/docs/attributes-registry/vcs.md) | string | The [URL](https://en.wikipedia.org/wiki/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/repo` | `Required` | ![Experimental](https://img.shields.io/badge/-experimental-blue) | +`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. + +| Value | Description | Stability | +|---|---|---| +| `added` | How many lines were added. | ![Experimental](https://img.shields.io/badge/-experimental-blue) | +| `removed` | How many lines were removed. | ![Experimental](https://img.shields.io/badge/-experimental-blue) | + + `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. | Value | Description | Stability | @@ -291,11 +318,11 @@ This metric is [recommended][MetricRecommended]. -### Metric: `vcs.ref.revisions_behind` +### Metric: `vcs.ref.revisions_delta` This metric is [recommended][MetricRecommended]. - + @@ -304,13 +331,14 @@ This metric is [recommended][MetricRecommended]. | Name | Instrument Type | Unit (UCUM) | Description | Stability | | -------- | --------------- | ----------- | -------------- | --------- | -| `vcs.ref.revisions_behind` | Gauge | `{revision}` | The number of revisions (commits) a ref (branch) is behind the default branch (trunk) | ![Experimental](https://img.shields.io/badge/-experimental-blue) | +| `vcs.ref.revisions_delta` | Gauge | `{revision}` | The number of revisions (commits) a ref (branch) is ahead/behind the default branch (trunk) | ![Experimental](https://img.shields.io/badge/-experimental-blue) | | Attribute | Type | Description | Examples | [Requirement Level](https://opentelemetry.io/docs/specs/semconv/general/attribute-requirement-level/) | Stability | |---|---|---|---|---|---| | [`vcs.ref.name`](/docs/attributes-registry/vcs.md) | string | The name of the [reference](https://git-scm.com/docs/gitglossary#def_ref) such as **branch** or **tag** in the repository. | `my-feature-branch`; `tag-1-test` | `Required` | ![Experimental](https://img.shields.io/badge/-experimental-blue) | | [`vcs.ref.type`](/docs/attributes-registry/vcs.md) | string | The type of the [reference](https://git-scm.com/docs/gitglossary#def_ref) in the repository. | `branch`; `tag` | `Required` | ![Experimental](https://img.shields.io/badge/-experimental-blue) | | [`vcs.repository.url.full`](/docs/attributes-registry/vcs.md) | string | The [URL](https://en.wikipedia.org/wiki/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/repo` | `Required` | ![Experimental](https://img.shields.io/badge/-experimental-blue) | +| [`vcs.revision_delta.type`](/docs/attributes-registry/vcs.md) | string | The type of . | `ahead`; `behind` | `Required` | ![Experimental](https://img.shields.io/badge/-experimental-blue) | `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. @@ -320,6 +348,14 @@ This metric is [recommended][MetricRecommended]. | `tag` | [tag](https://git-scm.com/docs/gitglossary#Documentation/gitglossary.txt-aiddeftagatag) | ![Experimental](https://img.shields.io/badge/-experimental-blue) | +`vcs.revision_delta.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. + +| Value | Description | Stability | +|---|---|---| +| `ahead` | How many revisions the change is ahead of the target ref. | ![Experimental](https://img.shields.io/badge/-experimental-blue) | +| `behind` | How many revisions the change is behind the target ref. | ![Experimental](https://img.shields.io/badge/-experimental-blue) | + + diff --git a/model/vcs/metrics.yaml b/model/vcs/metrics.yaml index 27db2f3504..4839c3669e 100644 --- a/model/vcs/metrics.yaml +++ b/model/vcs/metrics.yaml @@ -57,10 +57,10 @@ groups: requirement_level: required - ref: vcs.ref.type requirement_level: required - - id: metric.vcs.ref.lines_added + - id: metric.vcs.change.lines_delta type: metric - metric_name: vcs.ref.lines_added - brief: 'The number of lines added in a ref (branch) relative to the default branch (trunk)' + metric_name: vcs.change.lines_delta + brief: 'The number of lines added/removed in a change relative to the target branch of the change)' instrument: gauge unit: "{line}" stability: experimental @@ -71,10 +71,12 @@ groups: requirement_level: required - ref: vcs.ref.type requirement_level: required - - id: metric.vcs.ref.lines_deleted + - ref: vcs.line_change.type + requirement_level: required + - id: metric.vcs.ref.lines_delta type: metric - metric_name: vcs.ref.lines_deleted - brief: 'The number of lines deleted in a ref (branch) relative to the default branch (trunk)' + metric_name: vcs.ref.lines_delta + brief: 'The number of lines added/removed in a ref (branch) relative to the previous day' instrument: gauge unit: "{line}" stability: experimental @@ -85,10 +87,12 @@ groups: requirement_level: required - ref: vcs.ref.type requirement_level: required - - id: metric.vcs.ref.revisions_ahead + - ref: vcs.line_change.type + requirement_level: required + - id: metric.vcs.change.revisions_delta type: metric - metric_name: vcs.ref.revisions_ahead - brief: 'The number of revisions (commits) a ref (branch) is ahead of the default branch (trunk)' + metric_name: vcs.change.revisions_delta + brief: 'The number of revisions (commits) a change is ahead/behind the target branch of the change' instrument: gauge unit: "{revision}" stability: experimental @@ -99,10 +103,12 @@ groups: requirement_level: required - ref: vcs.ref.type requirement_level: required - - id: metric.vcs.ref.revisions_behind + - ref: vcs.revision_delta.type + requirement_level: required + - id: metric.vcs.ref.revisions_delta type: metric - metric_name: vcs.ref.revisions_behind - brief: 'The number of revisions (commits) a ref (branch) is behind the default branch (trunk)' + metric_name: vcs.ref.revisions_delta + brief: 'The number of revisions (commits) a ref (branch) is ahead/behind the default branch (trunk)' instrument: gauge unit: "{revision}" stability: experimental @@ -113,6 +119,8 @@ groups: requirement_level: required - ref: vcs.ref.type requirement_level: required + - ref: vcs.revision_delta.type + requirement_level: required - id: metric.vcs.ref.time type: metric metric_name: vcs.ref.time diff --git a/model/vcs/registry.yaml b/model/vcs/registry.yaml index 90ec45dc0e..802823e2b9 100644 --- a/model/vcs/registry.yaml +++ b/model/vcs/registry.yaml @@ -63,6 +63,36 @@ groups: "123", "HEAD", ] + - id: vcs.revision_delta.type + type: + members: + - id: behind + value: behind + brief: "How many revisions the change is behind the target ref." + stability: experimental + - id: ahead + value: ahead + brief: "How many revisions the change is ahead of the target ref." + stability: experimental + stability: experimental + brief: > + The type of . + examples: ["ahead", "behind"] + - id: vcs.line_change.type + type: + members: + - id: added + value: added + brief: "How many lines were added." + stability: experimental + - id: removed + value: removed + brief: "How many lines were removed." + stability: experimental + stability: experimental + brief: > + The type of line change being measured on a branch or change. + examples: ["added", "removed"] - id: vcs.change.title type: string stability: experimental