vcsconv
v1.47.0
Documentation
pkg.go.dev ↗Package vcsconv provides types and functionality for OpenTelemetry semantic conventions in the "vcs" namespace.
Types
ChangeCount
type ChangeCount struct {
metric.Int64UpDownCounter
}
ChangeCount is an instrument used to record metric values conforming to the "vcs.change.count" semantic conventions. It represents the number of changes (pull requests/merge requests/changelists) in a repository, categorized by their state (e.g. open or merged).
NewChangeCount
func NewChangeCount( m metric.Meter, opt ...metric.Int64UpDownCounterOption, ) (ChangeCount, error)
NewChangeCount returns a new ChangeCount instrument.
ChangeCount.Add
func (m ChangeCount) Add( ctx context.Context, incr int64, changeState ChangeStateAttr, repositoryUrlFull string, attrs ...attribute.KeyValue, )
Add adds incr to the existing count.
The changeState is the the state of the change (pull request/merge request/changelist).
The repositoryUrlFull is the the canonical URL of the repository providing the complete HTTP(S) address in order to locate and identify the repository through a browser.
All additional attrs passed are included in the recorded value.
ChangeCount.AttrOwnerName
func (ChangeCount) AttrOwnerName(val string) attribute.KeyValue
AttrOwnerName returns an optional attribute for the "vcs.owner.name" semantic convention. It represents the group owner within the version control system.
ChangeCount.AttrProviderName
func (ChangeCount) AttrProviderName(val ProviderNameAttr) attribute.KeyValue
AttrProviderName returns an optional attribute for the "vcs.provider.name" semantic convention. It represents the name of the version control system provider.
ChangeCount.AttrRepositoryName
func (ChangeCount) AttrRepositoryName(val string) attribute.KeyValue
AttrRepositoryName returns an optional attribute for the "vcs.repository.name" semantic convention. It represents the human readable name of the repository. It SHOULD NOT include any additional identifier like Group/SubGroup in GitLab or organization in GitHub.
ChangeCount.Description
func (ChangeCount) Description() string
Description returns the semantic convention description of the instrument
ChangeCount.Inst
func (m ChangeCount) Inst() metric.Int64UpDownCounter
Inst returns the underlying metric instrument.
ChangeCount.Name
func (ChangeCount) Name() string
Name returns the semantic convention name of the instrument.
ChangeCount.Unit
func (ChangeCount) Unit() string
Unit returns the semantic convention unit of the instrument
ChangeDuration
type ChangeDuration struct {
metric.Float64Gauge
}
ChangeDuration is an instrument used to record metric values conforming to the "vcs.change.duration" semantic conventions. It represents the time duration a change (pull request/merge request/changelist) has been in a given state.
NewChangeDuration
func NewChangeDuration( m metric.Meter, opt ...metric.Float64GaugeOption, ) (ChangeDuration, error)
NewChangeDuration returns a new ChangeDuration instrument.
ChangeDuration.AttrOwnerName
func (ChangeDuration) AttrOwnerName(val string) attribute.KeyValue
AttrOwnerName returns an optional attribute for the "vcs.owner.name" semantic convention. It represents the group owner within the version control system.
ChangeDuration.AttrProviderName
func (ChangeDuration) AttrProviderName(val ProviderNameAttr) attribute.KeyValue
AttrProviderName returns an optional attribute for the "vcs.provider.name" semantic convention. It represents the name of the version control system provider.
ChangeDuration.AttrRepositoryName
func (ChangeDuration) AttrRepositoryName(val string) attribute.KeyValue
AttrRepositoryName returns an optional attribute for the "vcs.repository.name" semantic convention. It represents the human readable name of the repository. It SHOULD NOT include any additional identifier like Group/SubGroup in GitLab or organization in GitHub.
ChangeDuration.Description
func (ChangeDuration) Description() string
Description returns the semantic convention description of the instrument
ChangeDuration.Inst
func (m ChangeDuration) Inst() metric.Float64Gauge
Inst returns the underlying metric instrument.
ChangeDuration.Name
func (ChangeDuration) Name() string
Name returns the semantic convention name of the instrument.
ChangeDuration.Record
func (m ChangeDuration) Record( ctx context.Context, val float64, changeState ChangeStateAttr, refHeadName string, repositoryUrlFull string, attrs ...attribute.KeyValue, )
Record records val to the current distribution.
The changeState is the the state of the change (pull request/merge request/changelist).
The refHeadName is the the name of the reference such as **branch** or **tag** in the repository.
The repositoryUrlFull is the the canonical URL of the repository providing the complete HTTP(S) address in order to locate and identify the repository through a browser.
All additional attrs passed are included in the recorded value.
ChangeDuration.Unit
func (ChangeDuration) Unit() string
Unit returns the semantic convention unit of the instrument
ChangeStateAttr
type ChangeStateAttr string
ChangeStateAttr is an attribute conforming to the vcs.change.state semantic conventions. It represents the state of the change (pull request/merge request/changelist).
ChangeStateOpen (4 declarations)
var ( // ChangeStateOpen is the 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. ChangeStateOpen ChangeStateAttr = "open" // ChangeStateWip is the 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. ChangeStateWip ChangeStateAttr = "wip" // ChangeStateClosed is the 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. ChangeStateClosed ChangeStateAttr = "closed" // ChangeStateMerged is the merged indicates that the change has been // successfully integrated into the target codebase. ChangeStateMerged ChangeStateAttr = "merged" )
ChangeTimeToApproval
type ChangeTimeToApproval struct {
metric.Float64Gauge
}
ChangeTimeToApproval is an instrument used to record metric values conforming to the "vcs.change.time_to_approval" semantic conventions. It represents the amount of time since its creation it took a change (pull request/merge request/changelist) to get the first approval.
NewChangeTimeToApproval
func NewChangeTimeToApproval( m metric.Meter, opt ...metric.Float64GaugeOption, ) (ChangeTimeToApproval, error)
NewChangeTimeToApproval returns a new ChangeTimeToApproval instrument.
ChangeTimeToApproval.AttrOwnerName
func (ChangeTimeToApproval) AttrOwnerName(val string) attribute.KeyValue
AttrOwnerName returns an optional attribute for the "vcs.owner.name" semantic convention. It represents the group owner within the version control system.
ChangeTimeToApproval.AttrProviderName
func (ChangeTimeToApproval) AttrProviderName(val ProviderNameAttr) attribute.KeyValue
AttrProviderName returns an optional attribute for the "vcs.provider.name" semantic convention. It represents the name of the version control system provider.
ChangeTimeToApproval.AttrRefBaseName
func (ChangeTimeToApproval) AttrRefBaseName(val string) attribute.KeyValue
AttrRefBaseName returns an optional attribute for the "vcs.ref.base.name" semantic convention. It represents the name of the reference such as **branch** or **tag** in the repository.
ChangeTimeToApproval.AttrRefBaseRevision
func (ChangeTimeToApproval) AttrRefBaseRevision(val string) attribute.KeyValue
AttrRefBaseRevision returns an optional attribute for the "vcs.ref.base.revision" semantic convention. It represents the revision, literally revised version, The revision most often refers to a commit object in Git, or a revision number in SVN.
ChangeTimeToApproval.AttrRefHeadRevision
func (ChangeTimeToApproval) AttrRefHeadRevision(val string) attribute.KeyValue
AttrRefHeadRevision returns an optional attribute for the "vcs.ref.head.revision" semantic convention. It represents the revision, literally revised version, The revision most often refers to a commit object in Git, or a revision number in SVN.
ChangeTimeToApproval.AttrRepositoryName
func (ChangeTimeToApproval) AttrRepositoryName(val string) attribute.KeyValue
AttrRepositoryName returns an optional attribute for the "vcs.repository.name" semantic convention. It represents the human readable name of the repository. It SHOULD NOT include any additional identifier like Group/SubGroup in GitLab or organization in GitHub.
ChangeTimeToApproval.Description
func (ChangeTimeToApproval) Description() string
Description returns the semantic convention description of the instrument
ChangeTimeToApproval.Inst
func (m ChangeTimeToApproval) Inst() metric.Float64Gauge
Inst returns the underlying metric instrument.
ChangeTimeToApproval.Name
func (ChangeTimeToApproval) Name() string
Name returns the semantic convention name of the instrument.
ChangeTimeToApproval.Record
func (m ChangeTimeToApproval) Record( ctx context.Context, val float64, refHeadName string, repositoryUrlFull string, attrs ...attribute.KeyValue, )
Record records val to the current distribution.
The refHeadName is the the name of the reference such as **branch** or **tag** in the repository.
The repositoryUrlFull is the the canonical URL of the repository providing the complete HTTP(S) address in order to locate and identify the repository through a browser.
All additional attrs passed are included in the recorded value.
ChangeTimeToApproval.Unit
func (ChangeTimeToApproval) Unit() string
Unit returns the semantic convention unit of the instrument
ChangeTimeToMerge
type ChangeTimeToMerge struct {
metric.Float64Gauge
}
ChangeTimeToMerge is an instrument used to record metric values conforming to the "vcs.change.time_to_merge" semantic conventions. It represents the amount of time since its creation it took a change (pull request/merge request/changelist) to get merged into the target(base) ref.
NewChangeTimeToMerge
func NewChangeTimeToMerge( m metric.Meter, opt ...metric.Float64GaugeOption, ) (ChangeTimeToMerge, error)
NewChangeTimeToMerge returns a new ChangeTimeToMerge instrument.
ChangeTimeToMerge.AttrOwnerName
func (ChangeTimeToMerge) AttrOwnerName(val string) attribute.KeyValue
AttrOwnerName returns an optional attribute for the "vcs.owner.name" semantic convention. It represents the group owner within the version control system.
ChangeTimeToMerge.AttrProviderName
func (ChangeTimeToMerge) AttrProviderName(val ProviderNameAttr) attribute.KeyValue
AttrProviderName returns an optional attribute for the "vcs.provider.name" semantic convention. It represents the name of the version control system provider.
ChangeTimeToMerge.AttrRefBaseName
func (ChangeTimeToMerge) AttrRefBaseName(val string) attribute.KeyValue
AttrRefBaseName returns an optional attribute for the "vcs.ref.base.name" semantic convention. It represents the name of the reference such as **branch** or **tag** in the repository.
ChangeTimeToMerge.AttrRefBaseRevision
func (ChangeTimeToMerge) AttrRefBaseRevision(val string) attribute.KeyValue
AttrRefBaseRevision returns an optional attribute for the "vcs.ref.base.revision" semantic convention. It represents the revision, literally revised version, The revision most often refers to a commit object in Git, or a revision number in SVN.
ChangeTimeToMerge.AttrRefHeadRevision
func (ChangeTimeToMerge) AttrRefHeadRevision(val string) attribute.KeyValue
AttrRefHeadRevision returns an optional attribute for the "vcs.ref.head.revision" semantic convention. It represents the revision, literally revised version, The revision most often refers to a commit object in Git, or a revision number in SVN.
ChangeTimeToMerge.AttrRepositoryName
func (ChangeTimeToMerge) AttrRepositoryName(val string) attribute.KeyValue
AttrRepositoryName returns an optional attribute for the "vcs.repository.name" semantic convention. It represents the human readable name of the repository. It SHOULD NOT include any additional identifier like Group/SubGroup in GitLab or organization in GitHub.
ChangeTimeToMerge.Description
func (ChangeTimeToMerge) Description() string
Description returns the semantic convention description of the instrument
ChangeTimeToMerge.Inst
func (m ChangeTimeToMerge) Inst() metric.Float64Gauge
Inst returns the underlying metric instrument.
ChangeTimeToMerge.Name
func (ChangeTimeToMerge) Name() string
Name returns the semantic convention name of the instrument.
ChangeTimeToMerge.Record
func (m ChangeTimeToMerge) Record( ctx context.Context, val float64, refHeadName string, repositoryUrlFull string, attrs ...attribute.KeyValue, )
Record records val to the current distribution.
The refHeadName is the the name of the reference such as **branch** or **tag** in the repository.
The repositoryUrlFull is the the canonical URL of the repository providing the complete HTTP(S) address in order to locate and identify the repository through a browser.
All additional attrs passed are included in the recorded value.
ChangeTimeToMerge.Unit
func (ChangeTimeToMerge) Unit() string
Unit returns the semantic convention unit of the instrument
ContributorCount
type ContributorCount struct {
metric.Int64Gauge
}
ContributorCount is an instrument used to record metric values conforming to the "vcs.contributor.count" semantic conventions. It represents the number of unique contributors to a repository.
NewContributorCount
func NewContributorCount( m metric.Meter, opt ...metric.Int64GaugeOption, ) (ContributorCount, error)
NewContributorCount returns a new ContributorCount instrument.
ContributorCount.AttrOwnerName
func (ContributorCount) AttrOwnerName(val string) attribute.KeyValue
AttrOwnerName returns an optional attribute for the "vcs.owner.name" semantic convention. It represents the group owner within the version control system.
ContributorCount.AttrProviderName
func (ContributorCount) AttrProviderName(val ProviderNameAttr) attribute.KeyValue
AttrProviderName returns an optional attribute for the "vcs.provider.name" semantic convention. It represents the name of the version control system provider.
ContributorCount.AttrRepositoryName
func (ContributorCount) AttrRepositoryName(val string) attribute.KeyValue
AttrRepositoryName returns an optional attribute for the "vcs.repository.name" semantic convention. It represents the human readable name of the repository. It SHOULD NOT include any additional identifier like Group/SubGroup in GitLab or organization in GitHub.
ContributorCount.Description
func (ContributorCount) Description() string
Description returns the semantic convention description of the instrument
ContributorCount.Inst
func (m ContributorCount) Inst() metric.Int64Gauge
Inst returns the underlying metric instrument.
ContributorCount.Name
func (ContributorCount) Name() string
Name returns the semantic convention name of the instrument.
ContributorCount.Record
func (m ContributorCount) Record( ctx context.Context, val int64, repositoryUrlFull string, attrs ...attribute.KeyValue, )
Record records val to the current distribution.
The repositoryUrlFull is the the canonical URL of the repository providing the complete HTTP(S) address in order to locate and identify the repository through a browser.
All additional attrs passed are included in the recorded value.
ContributorCount.Unit
func (ContributorCount) Unit() string
Unit returns the semantic convention unit of the instrument
LineChangeTypeAttr
type LineChangeTypeAttr string
LineChangeTypeAttr is an attribute conforming to the vcs.line_change.type semantic conventions. It represents the type of line change being measured on a branch or change.
LineChangeTypeAdded (2 declarations)
var ( // LineChangeTypeAdded is the how many lines were added. LineChangeTypeAdded LineChangeTypeAttr = "added" // LineChangeTypeRemoved is the how many lines were removed. LineChangeTypeRemoved LineChangeTypeAttr = "removed" )
ProviderNameAttr
type ProviderNameAttr string
ProviderNameAttr is an attribute conforming to the vcs.provider.name semantic conventions. It represents the name of the version control system provider.
ProviderNameGithub (4 declarations)
var ( // ProviderNameGithub is the [GitHub]. // // [GitHub]: https://github.com ProviderNameGithub ProviderNameAttr = "github" // ProviderNameGitlab is the [GitLab]. // // [GitLab]: https://gitlab.com ProviderNameGitlab ProviderNameAttr = "gitlab" // ProviderNameGittea is the [Gitea]. // // [Gitea]: https://gitea.io ProviderNameGittea ProviderNameAttr = "gittea" // ProviderNameBitbucket is the [Bitbucket]. // // [Bitbucket]: https://bitbucket.org ProviderNameBitbucket ProviderNameAttr = "bitbucket" )
RefBaseTypeAttr
type RefBaseTypeAttr string
RefBaseTypeAttr is an attribute conforming to the vcs.ref.base.type semantic conventions. It represents the type of the reference in the repository.
RefBaseTypeBranch (2 declarations)
var ( // RefBaseTypeBranch is the [branch]. // // [branch]: https://git-scm.com/docs/gitglossary#Documentation/gitglossary.txt-aiddefbranchabranch RefBaseTypeBranch RefBaseTypeAttr = "branch" // RefBaseTypeTag is the [tag]. // // [tag]: https://git-scm.com/docs/gitglossary#Documentation/gitglossary.txt-aiddeftagatag RefBaseTypeTag RefBaseTypeAttr = "tag" )
RefCount
type RefCount struct {
metric.Int64UpDownCounter
}
RefCount is an instrument used to record metric values conforming to the "vcs.ref.count" semantic conventions. It represents the number of refs of type branch or tag in a repository.
NewRefCount
func NewRefCount( m metric.Meter, opt ...metric.Int64UpDownCounterOption, ) (RefCount, error)
NewRefCount returns a new RefCount instrument.
RefCount.Add
func (m RefCount) Add( ctx context.Context, incr int64, refType RefTypeAttr, repositoryUrlFull string, attrs ...attribute.KeyValue, )
Add adds incr to the existing count.
The refType is the the type of the reference in the repository.
The repositoryUrlFull is the the canonical URL of the repository providing the complete HTTP(S) address in order to locate and identify the repository through a browser.
All additional attrs passed are included in the recorded value.
RefCount.AttrOwnerName
func (RefCount) AttrOwnerName(val string) attribute.KeyValue
AttrOwnerName returns an optional attribute for the "vcs.owner.name" semantic convention. It represents the group owner within the version control system.
RefCount.AttrProviderName
func (RefCount) AttrProviderName(val ProviderNameAttr) attribute.KeyValue
AttrProviderName returns an optional attribute for the "vcs.provider.name" semantic convention. It represents the name of the version control system provider.
RefCount.AttrRepositoryName
func (RefCount) AttrRepositoryName(val string) attribute.KeyValue
AttrRepositoryName returns an optional attribute for the "vcs.repository.name" semantic convention. It represents the human readable name of the repository. It SHOULD NOT include any additional identifier like Group/SubGroup in GitLab or organization in GitHub.
RefCount.Description
func (RefCount) Description() string
Description returns the semantic convention description of the instrument
RefCount.Inst
func (m RefCount) Inst() metric.Int64UpDownCounter
Inst returns the underlying metric instrument.
RefCount.Name
func (RefCount) Name() string
Name returns the semantic convention name of the instrument.
RefCount.Unit
func (RefCount) Unit() string
Unit returns the semantic convention unit of the instrument
RefHeadTypeAttr
type RefHeadTypeAttr string
RefHeadTypeAttr is an attribute conforming to the vcs.ref.head.type semantic conventions. It represents the type of the reference in the repository.
RefHeadTypeBranch (2 declarations)
var ( // RefHeadTypeBranch is the [branch]. // // [branch]: https://git-scm.com/docs/gitglossary#Documentation/gitglossary.txt-aiddefbranchabranch RefHeadTypeBranch RefHeadTypeAttr = "branch" // RefHeadTypeTag is the [tag]. // // [tag]: https://git-scm.com/docs/gitglossary#Documentation/gitglossary.txt-aiddeftagatag RefHeadTypeTag RefHeadTypeAttr = "tag" )
RefLinesDelta
type RefLinesDelta struct {
metric.Int64Gauge
}
RefLinesDelta is an instrument used to record metric values conforming to the "vcs.ref.lines_delta" semantic conventions. It represents the number of lines added/removed in a ref (branch) relative to the ref from the `vcs.ref.base.name` attribute.
NewRefLinesDelta
func NewRefLinesDelta( m metric.Meter, opt ...metric.Int64GaugeOption, ) (RefLinesDelta, error)
NewRefLinesDelta returns a new RefLinesDelta instrument.
RefLinesDelta.AttrChangeID
func (RefLinesDelta) AttrChangeID(val string) attribute.KeyValue
AttrChangeID returns an optional attribute for the "vcs.change.id" semantic convention. It represents 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.
RefLinesDelta.AttrOwnerName
func (RefLinesDelta) AttrOwnerName(val string) attribute.KeyValue
AttrOwnerName returns an optional attribute for the "vcs.owner.name" semantic convention. It represents the group owner within the version control system.
RefLinesDelta.AttrProviderName
func (RefLinesDelta) AttrProviderName(val ProviderNameAttr) attribute.KeyValue
AttrProviderName returns an optional attribute for the "vcs.provider.name" semantic convention. It represents the name of the version control system provider.
RefLinesDelta.AttrRepositoryName
func (RefLinesDelta) AttrRepositoryName(val string) attribute.KeyValue
AttrRepositoryName returns an optional attribute for the "vcs.repository.name" semantic convention. It represents the human readable name of the repository. It SHOULD NOT include any additional identifier like Group/SubGroup in GitLab or organization in GitHub.
RefLinesDelta.Description
func (RefLinesDelta) Description() string
Description returns the semantic convention description of the instrument
RefLinesDelta.Inst
func (m RefLinesDelta) Inst() metric.Int64Gauge
Inst returns the underlying metric instrument.
RefLinesDelta.Name
func (RefLinesDelta) Name() string
Name returns the semantic convention name of the instrument.
RefLinesDelta.Record
func (m RefLinesDelta) Record( ctx context.Context, val int64, lineChangeType LineChangeTypeAttr, refBaseName string, refBaseType RefBaseTypeAttr, refHeadName string, refHeadType RefHeadTypeAttr, repositoryUrlFull string, attrs ...attribute.KeyValue, )
Record records val to the current distribution.
The lineChangeType is the the type of line change being measured on a branch or change.
The refBaseName is the the name of the reference such as **branch** or **tag** in the repository.
The refBaseType is the the type of the reference in the repository.
The refHeadName is the the name of the reference such as **branch** or **tag** in the repository.
The refHeadType is the the type of the reference in the repository.
The repositoryUrlFull is the the canonical URL of the repository providing the complete HTTP(S) address in order to locate and identify the repository through a browser.
All additional attrs passed are included in the recorded value.
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.
RefLinesDelta.Unit
func (RefLinesDelta) Unit() string
Unit returns the semantic convention unit of the instrument
RefRevisionsDelta
type RefRevisionsDelta struct {
metric.Int64Gauge
}
RefRevisionsDelta is an instrument used to record metric values conforming to the "vcs.ref.revisions_delta" semantic conventions. It represents the number of revisions (commits) a ref (branch) is ahead/behind the branch from the `vcs.ref.base.name` attribute.
NewRefRevisionsDelta
func NewRefRevisionsDelta( m metric.Meter, opt ...metric.Int64GaugeOption, ) (RefRevisionsDelta, error)
NewRefRevisionsDelta returns a new RefRevisionsDelta instrument.
RefRevisionsDelta.AttrChangeID
func (RefRevisionsDelta) AttrChangeID(val string) attribute.KeyValue
AttrChangeID returns an optional attribute for the "vcs.change.id" semantic convention. It represents 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.
RefRevisionsDelta.AttrOwnerName
func (RefRevisionsDelta) AttrOwnerName(val string) attribute.KeyValue
AttrOwnerName returns an optional attribute for the "vcs.owner.name" semantic convention. It represents the group owner within the version control system.
RefRevisionsDelta.AttrProviderName
func (RefRevisionsDelta) AttrProviderName(val ProviderNameAttr) attribute.KeyValue
AttrProviderName returns an optional attribute for the "vcs.provider.name" semantic convention. It represents the name of the version control system provider.
RefRevisionsDelta.AttrRepositoryName
func (RefRevisionsDelta) AttrRepositoryName(val string) attribute.KeyValue
AttrRepositoryName returns an optional attribute for the "vcs.repository.name" semantic convention. It represents the human readable name of the repository. It SHOULD NOT include any additional identifier like Group/SubGroup in GitLab or organization in GitHub.
RefRevisionsDelta.Description
func (RefRevisionsDelta) Description() string
Description returns the semantic convention description of the instrument
RefRevisionsDelta.Inst
func (m RefRevisionsDelta) Inst() metric.Int64Gauge
Inst returns the underlying metric instrument.
RefRevisionsDelta.Name
func (RefRevisionsDelta) Name() string
Name returns the semantic convention name of the instrument.
RefRevisionsDelta.Record
func (m RefRevisionsDelta) Record( ctx context.Context, val int64, refBaseName string, refBaseType RefBaseTypeAttr, refHeadName string, refHeadType RefHeadTypeAttr, repositoryUrlFull string, revisionDeltaDirection RevisionDeltaDirectionAttr, attrs ...attribute.KeyValue, )
Record records val to the current distribution.
The refBaseName is the the name of the reference such as **branch** or **tag** in the repository.
The refBaseType is the the type of the reference in the repository.
The refHeadName is the the name of the reference such as **branch** or **tag** in the repository.
The refHeadType is the the type of the reference in the repository.
The repositoryUrlFull is the the canonical URL of the repository providing the complete HTTP(S) address in order to locate and identify the repository through a browser.
The revisionDeltaDirection is the the type of revision comparison.
All additional attrs passed are included in the recorded value.
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`.
RefRevisionsDelta.Unit
func (RefRevisionsDelta) Unit() string
Unit returns the semantic convention unit of the instrument
RefTime
type RefTime struct {
metric.Float64Gauge
}
RefTime is an instrument used to record metric values conforming to the "vcs.ref.time" semantic conventions. It represents the time a ref (branch) created from the default branch (trunk) has existed. The `ref.type` attribute will always be `branch`.
NewRefTime
func NewRefTime( m metric.Meter, opt ...metric.Float64GaugeOption, ) (RefTime, error)
NewRefTime returns a new RefTime instrument.
RefTime.AttrOwnerName
func (RefTime) AttrOwnerName(val string) attribute.KeyValue
AttrOwnerName returns an optional attribute for the "vcs.owner.name" semantic convention. It represents the group owner within the version control system.
RefTime.AttrProviderName
func (RefTime) AttrProviderName(val ProviderNameAttr) attribute.KeyValue
AttrProviderName returns an optional attribute for the "vcs.provider.name" semantic convention. It represents the name of the version control system provider.
RefTime.AttrRepositoryName
func (RefTime) AttrRepositoryName(val string) attribute.KeyValue
AttrRepositoryName returns an optional attribute for the "vcs.repository.name" semantic convention. It represents the human readable name of the repository. It SHOULD NOT include any additional identifier like Group/SubGroup in GitLab or organization in GitHub.
RefTime.Description
func (RefTime) Description() string
Description returns the semantic convention description of the instrument
RefTime.Inst
func (m RefTime) Inst() metric.Float64Gauge
Inst returns the underlying metric instrument.
RefTime.Name
func (RefTime) Name() string
Name returns the semantic convention name of the instrument.
RefTime.Record
func (m RefTime) Record( ctx context.Context, val float64, refHeadName string, refHeadType RefHeadTypeAttr, repositoryUrlFull string, attrs ...attribute.KeyValue, )
Record records val to the current distribution.
The refHeadName is the the name of the reference such as **branch** or **tag** in the repository.
The refHeadType is the the type of the reference in the repository.
The repositoryUrlFull is the the canonical URL of the repository providing the complete HTTP(S) address in order to locate and identify the repository through a browser.
All additional attrs passed are included in the recorded value.
RefTime.Unit
func (RefTime) Unit() string
Unit returns the semantic convention unit of the instrument
RefTypeAttr
type RefTypeAttr string
RefTypeAttr is an attribute conforming to the vcs.ref.type semantic conventions. It represents the type of the reference in the repository.
RefTypeBranch (2 declarations)
var ( // RefTypeBranch is the [branch]. // // [branch]: https://git-scm.com/docs/gitglossary#Documentation/gitglossary.txt-aiddefbranchabranch RefTypeBranch RefTypeAttr = "branch" // RefTypeTag is the [tag]. // // [tag]: https://git-scm.com/docs/gitglossary#Documentation/gitglossary.txt-aiddeftagatag RefTypeTag RefTypeAttr = "tag" )
RepositoryCount
type RepositoryCount struct {
metric.Int64UpDownCounter
}
RepositoryCount is an instrument used to record metric values conforming to the "vcs.repository.count" semantic conventions. It represents the number of repositories in an organization.
NewRepositoryCount
func NewRepositoryCount( m metric.Meter, opt ...metric.Int64UpDownCounterOption, ) (RepositoryCount, error)
NewRepositoryCount returns a new RepositoryCount instrument.
RepositoryCount.Add
func (m RepositoryCount) Add( ctx context.Context, incr int64, attrs ...attribute.KeyValue, )
Add adds incr to the existing count.
All additional attrs passed are included in the recorded value.
RepositoryCount.AttrOwnerName
func (RepositoryCount) AttrOwnerName(val string) attribute.KeyValue
AttrOwnerName returns an optional attribute for the "vcs.owner.name" semantic convention. It represents the group owner within the version control system.
RepositoryCount.AttrProviderName
func (RepositoryCount) AttrProviderName(val ProviderNameAttr) attribute.KeyValue
AttrProviderName returns an optional attribute for the "vcs.provider.name" semantic convention. It represents the name of the version control system provider.
RepositoryCount.Description
func (RepositoryCount) Description() string
Description returns the semantic convention description of the instrument
RepositoryCount.Inst
func (m RepositoryCount) Inst() metric.Int64UpDownCounter
Inst returns the underlying metric instrument.
RepositoryCount.Name
func (RepositoryCount) Name() string
Name returns the semantic convention name of the instrument.
RepositoryCount.Unit
func (RepositoryCount) Unit() string
Unit returns the semantic convention unit of the instrument
RevisionDeltaDirectionAttr
type RevisionDeltaDirectionAttr string
RevisionDeltaDirectionAttr is an attribute conforming to the vcs.revision_delta.direction semantic conventions. It represents the type of revision comparison.
RevisionDeltaDirectionBehind (2 declarations)
var ( // RevisionDeltaDirectionBehind is the how many revisions the change is behind // the target ref. RevisionDeltaDirectionBehind RevisionDeltaDirectionAttr = "behind" // RevisionDeltaDirectionAhead is the how many revisions the change is ahead of // the target ref. RevisionDeltaDirectionAhead RevisionDeltaDirectionAttr = "ahead" )