Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add VCS metrics from Github receiver #1383

Merged
Merged
Show file tree
Hide file tree
Changes from 41 commits
Commits
Show all changes
55 commits
Select commit Hold shift + click to select a range
44a1c81
[cicd] add first cicd metric to registry, created cicd-metrics doc
christophe-kamphaus-jemmic Sep 2, 2024
700412a
[cicd] link to cicd doc from parent readme
christophe-kamphaus-jemmic Sep 2, 2024
4d8e3a9
[cicd] fix typo vsc -> vcs
christophe-kamphaus-jemmic Sep 3, 2024
9bd4a95
[cicd] fix toc
christophe-kamphaus-jemmic Sep 3, 2024
592483f
[cicd] use {change} as metric unit
christophe-kamphaus-jemmic Sep 3, 2024
238c764
[cicd] formatting and rename metrics section
christophe-kamphaus-jemmic Sep 3, 2024
ef91dfa
[cicd] add remaining metrics from githubreceiver
christophe-kamphaus-jemmic Sep 3, 2024
f712312
[cicd] fix markdown code quotation
christophe-kamphaus-jemmic Sep 3, 2024
8c2e8a7
[cicd] add changelog entry
christophe-kamphaus-jemmic Sep 3, 2024
a148a4e
[cicd] add closed state to vcs.change.state
christophe-kamphaus-jemmic Sep 6, 2024
347b15b
[cicd] improved brief for vcs.change.state
christophe-kamphaus-jemmic Sep 6, 2024
afaa1f5
[cicd] update vcs.change.state briefs
christophe-kamphaus-jemmic Sep 15, 2024
5a9ffe7
[cicd] combine vcs.change.time_* metrics into one histogram metric
christophe-kamphaus-jemmic Sep 15, 2024
2da96a5
[cicd] update vcs.repository.ref.count brief to follow vcs.repository…
christophe-kamphaus-jemmic Sep 15, 2024
c232041
[cicd] fix metric and table mismatch
christophe-kamphaus-jemmic Sep 15, 2024
aab9f90
[cicd] change instrument from gauge to updowncounter
christophe-kamphaus-jemmic Sep 15, 2024
41543cd
[cicd] replace vcs.repository.name with vcs.repository.url.full in ci…
christophe-kamphaus-jemmic Sep 15, 2024
7f35251
Merge branch 'main' into 1372-vcs-metrics
christophe-kamphaus-jemmic Sep 17, 2024
a5eff73
[cicd] apply changes from #1411 to docs/cicd/cicd-metrics.md
christophe-kamphaus-jemmic Sep 17, 2024
7107911
[cicd] fix yamllint
christophe-kamphaus-jemmic Sep 17, 2024
15fe1fb
Merge branch 'main' into 1372-vcs-metrics
christophe-kamphaus-jemmic Oct 2, 2024
30c8fdb
Merge branch 'main' into 1372-vcs-metrics
christophe-kamphaus-jemmic Oct 3, 2024
344eeed
[cicd] Add /docs/cicd/ to CODEOWNERS
christophe-kamphaus-jemmic Oct 3, 2024
cfcdaf1
[cicd] rename metric and improve description
christophe-kamphaus-jemmic Oct 3, 2024
e174ef3
[cicd] add (PR/MR) to all vcs metric briefs relating to changes
christophe-kamphaus-jemmic Oct 3, 2024
7d114d3
[cicd] rephrase examples in brief to be inclusive
christophe-kamphaus-jemmic Oct 3, 2024
b92cc08
[cicd] make repository count an updowncounter
christophe-kamphaus-jemmic Oct 3, 2024
84b2b6a
[cicd] add metric requirement levels
christophe-kamphaus-jemmic Oct 3, 2024
163e498
[cicd] add wip state to vcs.change.state
christophe-kamphaus-jemmic Oct 3, 2024
d2ce62f
[cicd] add changelist to briefs for change
christophe-kamphaus-jemmic Oct 3, 2024
536a2a7
[cicd] rename vcs.repository.change.* to vcs.change.*
christophe-kamphaus-jemmic Oct 3, 2024
cfffb4f
[cicd] rename vcs.repository.ref.* to vcs.ref.*
christophe-kamphaus-jemmic Oct 3, 2024
0e02a47
[cicd] follow procedure for renaming attributes
christophe-kamphaus-jemmic Oct 3, 2024
1a89934
Merge branch 'main' into 1372-vcs-metrics
christophe-kamphaus-jemmic Oct 10, 2024
b5c4660
[cicd] change instrument type from "gauge histogram" back to gauge
christophe-kamphaus-jemmic Oct 10, 2024
dafdad7
[cicd] combine lines added/removed and revisions ahead/behind metrics
christophe-kamphaus-jemmic Oct 10, 2024
3e122e8
[cicd] fix minor brief issues
christophe-kamphaus-jemmic Oct 10, 2024
513ae8b
Merge branch 'main' into 1372-vcs-metrics
christophe-kamphaus-jemmic Oct 18, 2024
d549367
Merge branch 'main' into 1372-vcs-metrics
christophe-kamphaus-jemmic Oct 24, 2024
e63b2cf
[cicd] small addition to changelog
christophe-kamphaus-jemmic Oct 24, 2024
ee9af4a
Merge branch 'main' into 1372-vcs-metrics
christophe-kamphaus-jemmic Oct 30, 2024
137921c
Merge branch 'main' into 1372-vcs-metrics
christophe-kamphaus-jemmic Nov 1, 2024
fc3096e
[cicd] refine brief of time_to_approval metric
christophe-kamphaus-jemmic Nov 1, 2024
90b4625
[cicd] rename attribute vcs.revision_delta.type to vcs.revision_delta…
christophe-kamphaus-jemmic Nov 1, 2024
b1d8ddc
[cicd] rename metric vcs.repository.contributor.count to vcs.contribu…
christophe-kamphaus-jemmic Nov 1, 2024
5d5a56b
[cicd] add notes for line and revision metrics
christophe-kamphaus-jemmic Nov 1, 2024
46d6194
[cicd] improve vcs.change.lines_delta brief
christophe-kamphaus-jemmic Nov 1, 2024
8f8bb73
[cicd] combine the `lines_delta` and `revisions_delta` metrics from c…
christophe-kamphaus-jemmic Nov 4, 2024
c5d68ee
Merge branch 'main' into 1372-vcs-metrics
christophe-kamphaus-jemmic Nov 5, 2024
df9e0e4
[cicd] follow-up fix after latest merge
christophe-kamphaus-jemmic Nov 5, 2024
f00fced
[cicd] update changelog
christophe-kamphaus-jemmic Nov 7, 2024
879f9f1
[cicd] refine brief for `vcs.change.time_to_approval` metric
christophe-kamphaus-jemmic Nov 7, 2024
4a88a15
Merge branch 'main' into 1372-vcs-metrics
christophe-kamphaus-jemmic Nov 7, 2024
ae7d380
[cicd] fix yamllint
christophe-kamphaus-jemmic Nov 7, 2024
74363d8
Merge branch 'main' into 1372-vcs-metrics
christophe-kamphaus-jemmic Nov 8, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 25 additions & 0 deletions .chloggen/1372-vcs-metrics.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
# Use this changelog template to create an entry for release notes.
#
# If your change doesn't affect end users you should instead start
# your pull request title with [chore] or use the "Skip Changelog" label.

# One of 'breaking', 'deprecation', 'new_component', 'enhancement', 'bug_fix'
change_type: breaking

# The name of the area of concern in the attributes-registry, (e.g. http, cloud, db)
component: vcs

# A brief description of the change. Surround your text with quotes ("") if it needs to start with a backtick (`).
note: Add the VCS metrics from the GitHub Receiver
christophe-kamphaus-jemmic marked this conversation as resolved.
Show resolved Hide resolved

# Mandatory: One or more tracking issues related to the change. You can use the PR number here if no issue exists.
# The values here must be integers.
issues: [1372]

# (Optional) One or more lines of additional information to render under the primary note.
# These lines will be padded with 2 spaces and then inserted directly into the document.
# Use pipe (|) for multiline entries.
subtext: |
christophe-kamphaus-jemmic marked this conversation as resolved.
Show resolved Hide resolved
- The VCS attributes `vcs.change.state`, `vcs.revision_delta.type` and `vcs.line_change.type` have been added to the registry.
- `vcs.repository.change.*` attributes have been deprecated and moved to `vcs.change.*`.
- `vcs.repository.ref.*` attributes have been deprecated and moved to `vcs.ref.*`.
1 change: 1 addition & 0 deletions .github/CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,7 @@
/model/user/ @open-telemetry/specs-semconv-approvers @open-telemetry/semconv-security-approvers

# CICD semantic conventions
/docs/cicd/ @open-telemetry/specs-semconv-approvers @open-telemetry/semconv-cicd-approvers
adrielp marked this conversation as resolved.
Show resolved Hide resolved
/model/artifact/ @open-telemetry/specs-semconv-approvers @open-telemetry/semconv-cicd-approvers
/model/cicd/ @open-telemetry/specs-semconv-approvers @open-telemetry/semconv-cicd-approvers
/model/code/ @open-telemetry/specs-semconv-approvers @open-telemetry/semconv-cicd-approvers
Expand Down
1 change: 1 addition & 0 deletions docs/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ The benefit to using Semantic Conventions is in following a common naming scheme
Semantic Conventions are defined for the following areas:

* **[General](general/README.md): General Semantic Conventions**.
* [CICD](cicd/cicd-metrics.md): Semantic Conventions for CICD systems.
christophe-kamphaus-jemmic marked this conversation as resolved.
Show resolved Hide resolved
christophe-kamphaus-jemmic marked this conversation as resolved.
Show resolved Hide resolved
* [Cloud Providers](cloud-providers/README.md): Semantic Conventions for cloud providers libraries.
* [CloudEvents](cloudevents/README.md): Semantic Conventions for the CloudEvents specification.
* [Database](database/README.md): Semantic Conventions for database operations.
Expand Down
58 changes: 53 additions & 5 deletions docs/attributes-registry/vcs.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,18 +6,24 @@

# VCS

- [VCS Repository Attributes](#vcs-repository-attributes)
- [VCS Deprecated Attributes](#vcs-deprecated-attributes)

## VCS Repository Attributes

This group defines the attributes for [Version Control Systems (VCS)](https://en.wikipedia.org/wiki/Version_control).

| Attribute | Type | Description | Examples | Stability |
|---|---|---|---|---|
| <a id="vcs-repository-change-id" href="#vcs-repository-change-id">`vcs.repository.change.id`</a> | string | The ID of the change (pull request/merge request) if applicable. This is usually a unique (within repository) identifier generated by the VCS system. | `123` | ![Experimental](https://img.shields.io/badge/-experimental-blue) |
| <a id="vcs-repository-change-title" href="#vcs-repository-change-title">`vcs.repository.change.title`</a> | string | The human readable title of the change (pull request/merge request). 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) |
| <a id="vcs-repository-ref-name" href="#vcs-repository-ref-name">`vcs.repository.ref.name`</a> | 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) |
| <a id="vcs-repository-ref-revision" href="#vcs-repository-ref-revision">`vcs.repository.ref.revision`</a> | 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) |
| <a id="vcs-repository-ref-type" href="#vcs-repository-ref-type">`vcs.repository.ref.type`</a> | 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) |
| <a id="vcs-change-id" href="#vcs-change-id">`vcs.change.id`</a> | 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) |
| <a id="vcs-change-state" href="#vcs-change-state">`vcs.change.state`</a> | string | The state of the change (pull request/merge request/changelist). | `open`; `closed`; `merged` | ![Experimental](https://img.shields.io/badge/-experimental-blue) |
| <a id="vcs-change-title" href="#vcs-change-title">`vcs.change.title`</a> | 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) |
| <a id="vcs-line-change-type" href="#vcs-line-change-type">`vcs.line_change.type`</a> | string | The type of line change being measured on a branch or change. | `added`; `removed` | ![Experimental](https://img.shields.io/badge/-experimental-blue) |
| <a id="vcs-ref-name" href="#vcs-ref-name">`vcs.ref.name`</a> | 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) |
| <a id="vcs-ref-revision" href="#vcs-ref-revision">`vcs.ref.revision`</a> | 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) |
| <a id="vcs-ref-type" href="#vcs-ref-type">`vcs.ref.type`</a> | 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) |
| <a id="vcs-repository-url-full" href="#vcs-repository-url-full">`vcs.repository.url.full`</a> | 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) |
| <a id="vcs-revision-delta-type" href="#vcs-revision-delta-type">`vcs.revision_delta.type`</a> | string | The type of revision comparison. | `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
Expand All @@ -29,6 +35,48 @@ it is identical to the `ref.name`, it SHOULD still be included. It is
up to the implementer to decide which value to set as the revision
based on the VCS system and situational context.

`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.

| Value | Description | Stability |
|---|---|---|
| `closed` | Closed 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](https://img.shields.io/badge/-experimental-blue) |
| `merged` | Merged indicates that the change has been successfully integrated into the target codebase. | ![Experimental](https://img.shields.io/badge/-experimental-blue) |
| `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 |
|---|---|---|
| `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."

| Attribute | Type | Description | Examples | Stability |
|---|---|---|---|---|
| <a id="vcs-repository-change-id" href="#vcs-repository-change-id">`vcs.repository.change.id`</a> | string | Deprecated, use `vcs.change.id` instead. | `123` | ![Deprecated](https://img.shields.io/badge/-deprecated-red)<br>Deprecated, use `vcs.change.id` instead. |
| <a id="vcs-repository-change-title" href="#vcs-repository-change-title">`vcs.repository.change.title`</a> | string | Deprecated, use `vcs.change.title` instead. | `Fixes broken thing`; `feat: add my new feature`; `[chore] update dependency` | ![Deprecated](https://img.shields.io/badge/-deprecated-red)<br>Deprecated, use `vcs.change.title` instead. |
| <a id="vcs-repository-ref-name" href="#vcs-repository-ref-name">`vcs.repository.ref.name`</a> | string | Deprecated, use `vcs.ref.name` instead. | `my-feature-branch`; `tag-1-test` | ![Deprecated](https://img.shields.io/badge/-deprecated-red)<br>Deprecated, use `vcs.ref.name` instead. |
| <a id="vcs-repository-ref-revision" href="#vcs-repository-ref-revision">`vcs.repository.ref.revision`</a> | string | Deprecated, use `vcs.ref.revision` instead. | `9d59409acf479dfa0df1aa568182e43e43df8bbe28d60fcf2bc52e30068802cc`; `main`; `123`; `HEAD` | ![Deprecated](https://img.shields.io/badge/-deprecated-red)<br>Deprecated, use `vcs.ref.revision` instead. |
| <a id="vcs-repository-ref-type" href="#vcs-repository-ref-type">`vcs.repository.ref.type`</a> | string | Deprecated, use `vcs.ref.type` instead. | `branch`; `tag` | ![Deprecated](https://img.shields.io/badge/-deprecated-red)<br>Deprecated, use `vcs.ref.type` instead. |

`vcs.repository.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.
christophe-kamphaus-jemmic marked this conversation as resolved.
Show resolved Hide resolved

| Value | Description | Stability |
Expand Down
Loading
Loading