Skip to content

Commit

Permalink
Feedbacks
Browse files Browse the repository at this point in the history
Signed-off-by: Ashmita Bohara <[email protected]>
  • Loading branch information
Ashmita152 committed Jun 12, 2021
1 parent 447cac0 commit fa02eb1
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions pkg/version/build.go
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,11 @@ type Info struct {
BuildDate string `json:"buildDate"`
}

// InfoMetrics hold metrics about build information
type InfoMetrics struct {
BuildInfo metrics.Gauge `metric:"build_info"`
}

// Get creates and initialized Info object
func Get() Info {
return Info{
Expand All @@ -43,21 +48,16 @@ func Get() Info {
}
}

// InfoMetrics hold metrics about build information
type InfoMetrics struct {
BuildInfo metrics.Gauge `metric:"build_info"`
}

// NewInfoMetrics returns a InfoMetrics
func NewInfoMetrics(infoMetrics metrics.Factory) *InfoMetrics {
func NewInfoMetrics(metricsFactory metrics.Factory) *InfoMetrics {
var info InfoMetrics

buildTags := map[string]string{
"revision": commitSHA,
"version": latestVersion,
"build_date": date,
}
metrics.Init(&info, infoMetrics, buildTags)
metrics.Init(&info, metricsFactory, buildTags)
info.BuildInfo.Update(1)

return &info
Expand Down

0 comments on commit fa02eb1

Please sign in to comment.