Skip to content

Commit

Permalink
chore(deps): bump prometheus dependencies
Browse files Browse the repository at this point in the history
Signed-off-by: william.vanhevelingen <william.vanhevelingen@acquia.com>

fixes #12429, fixes #12272, fixes #11957

Signed-off-by: william.vanhevelingen <william.vanhevelingen@acquia.com>
  • Loading branch information
blkperl committed Feb 26, 2024
1 parent a927379 commit 5a25998
Show file tree
Hide file tree
Showing 4 changed files with 29 additions and 32 deletions.
9 changes: 4 additions & 5 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -39,9 +39,9 @@ require (
github.com/klauspost/pgzip v1.2.6
github.com/minio/minio-go/v7 v7.0.66
github.com/pkg/errors v0.9.1
github.com/prometheus/client_golang v1.16.0
github.com/prometheus/client_model v0.3.0
github.com/prometheus/common v0.42.0
github.com/prometheus/client_golang v1.18.0
github.com/prometheus/client_model v0.6.0
github.com/prometheus/common v0.48.0
github.com/robfig/cron/v3 v3.0.1
github.com/sethvargo/go-limiter v0.7.2
github.com/sirupsen/logrus v1.9.3
Expand Down Expand Up @@ -224,7 +224,6 @@ require (
github.com/lithammer/dedent v1.1.0 // indirect
github.com/magiconair/properties v1.8.7 // indirect
github.com/mailru/easyjson v0.7.7 // indirect
github.com/matttproud/golang_protobuf_extensions v1.0.4 // indirect
github.com/minio/md5-simd v1.1.2 // indirect
github.com/minio/sha256-simd v1.0.1 // indirect
github.com/mitchellh/copystructure v1.2.0 // indirect
Expand All @@ -246,7 +245,7 @@ require (
github.com/peterbourgon/diskv v2.0.1+incompatible // indirect
github.com/pkg/browser v0.0.0-20210911075715-681adbf594b8 // indirect
github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 // indirect
github.com/prometheus/procfs v0.10.1 // indirect
github.com/prometheus/procfs v0.12.0 // indirect
github.com/rs/xid v1.5.0 // indirect
github.com/russross/blackfriday v1.6.0 // indirect
github.com/russross/blackfriday/v2 v2.1.0 // indirect
Expand Down
18 changes: 8 additions & 10 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -758,8 +758,6 @@ github.com/mattn/go-runewidth v0.0.7/go.mod h1:H031xJmbD/WCDINGzjvQ9THkh0rPKHF+m
github.com/mattn/go-sqlite3 v1.14.17/go.mod h1:2eHXhiwb8IkHr+BDWZGa96P6+rkvnG63S2DGjv9HUNg=
github.com/matttproud/golang_protobuf_extensions v1.0.1/go.mod h1:D8He9yQNgCq6Z5Ld7szi9bcBfOoFv/3dc6xSMkL2PC0=
github.com/matttproud/golang_protobuf_extensions v1.0.2-0.20181231171920-c182affec369/go.mod h1:BSXmuO+STAnVfrANrmjBb36TMTDstsz7MSK+HVaYKv4=
github.com/matttproud/golang_protobuf_extensions v1.0.4 h1:mmDVorXM7PCGKw94cs5zkfA9PSy5pEvNWRP0ET0TIVo=
github.com/matttproud/golang_protobuf_extensions v1.0.4/go.mod h1:BSXmuO+STAnVfrANrmjBb36TMTDstsz7MSK+HVaYKv4=
github.com/miekg/dns v1.0.14/go.mod h1:W1PPwlIAgtquWBMBEV9nkV9Cazfe8ScdGz/Lj7v3Nrg=
github.com/minio/md5-simd v1.1.2 h1:Gdi1DZK69+ZVMoNHRXJyNcxrMA4dSxoYHZSQbirFg34=
github.com/minio/md5-simd v1.1.2/go.mod h1:MzdKDxYpY2BT9XQFocsiZf/NKVtR7nkE4RoEpN+20RM=
Expand Down Expand Up @@ -864,27 +862,27 @@ github.com/prometheus/client_golang v1.0.0/go.mod h1:db9x61etRT2tGnBNRi70OPL5Fsn
github.com/prometheus/client_golang v1.7.1/go.mod h1:PY5Wy2awLA44sXw4AOSfFBetzPP4j5+D6mVACh+pe2M=
github.com/prometheus/client_golang v1.11.0/go.mod h1:Z6t4BnS23TR94PD6BsDNk8yVqroYurpAkEiz0P2BEV0=
github.com/prometheus/client_golang v1.12.1/go.mod h1:3Z9XVyYiZYEO+YQWt3RD2R3jrbd179Rt297l4aS6nDY=
github.com/prometheus/client_golang v1.16.0 h1:yk/hx9hDbrGHovbci4BY+pRMfSuuat626eFsHb7tmT8=
github.com/prometheus/client_golang v1.16.0/go.mod h1:Zsulrv/L9oM40tJ7T815tM89lFEugiJ9HzIqaAx4LKc=
github.com/prometheus/client_golang v1.18.0 h1:HzFfmkOzH5Q8L8G+kSJKUx5dtG87sewO+FoDDqP5Tbk=
github.com/prometheus/client_golang v1.18.0/go.mod h1:T+GXkCk5wSJyOqMIzVgvvjFDlkOQntgjkJWKrN5txjA=
github.com/prometheus/client_model v0.0.0-20180712105110-5c3871d89910/go.mod h1:MbSGuTsp3dbXC40dX6PRTWyKYBIrTGTE9sqQNg2J8bo=
github.com/prometheus/client_model v0.0.0-20190129233127-fd36f4220a90/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA=
github.com/prometheus/client_model v0.0.0-20190812154241-14fe0d1b01d4/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA=
github.com/prometheus/client_model v0.2.0/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA=
github.com/prometheus/client_model v0.3.0 h1:UBgGFHqYdG/TPFD1B1ogZywDqEkwp3fBMvqdiQ7Xew4=
github.com/prometheus/client_model v0.3.0/go.mod h1:LDGWKZIo7rky3hgvBe+caln+Dr3dPggB5dvjtD7w9+w=
github.com/prometheus/client_model v0.6.0 h1:k1v3CzpSRUTrKMppY35TLwPvxHqBu0bYgxZzqGIgaos=
github.com/prometheus/client_model v0.6.0/go.mod h1:NTQHnmxFpouOD0DpvP4XujX3CdOAGQPoaGhyTchlyt8=
github.com/prometheus/common v0.4.1/go.mod h1:TNfzLD0ON7rHzMJeJkieUDPYmFC7Snx/y86RQel1bk4=
github.com/prometheus/common v0.10.0/go.mod h1:Tlit/dnDKsSWFlCLTWaA1cyBgKHSMdTB80sz/V91rCo=
github.com/prometheus/common v0.26.0/go.mod h1:M7rCNAaPfAosfx8veZJCuw84e35h3Cfd9VFqTh1DIvc=
github.com/prometheus/common v0.32.1/go.mod h1:vu+V0TpY+O6vW9J44gczi3Ap/oXXR10b+M/gUGO4Hls=
github.com/prometheus/common v0.42.0 h1:EKsfXEYo4JpWMHH5cg+KOUWeuJSov1Id8zGR8eeI1YM=
github.com/prometheus/common v0.42.0/go.mod h1:xBwqVerjNdUDjgODMpudtOMwlOwf2SaTr1yjz4b7Zbc=
github.com/prometheus/common v0.48.0 h1:QO8U2CdOzSn1BBsmXJXduaaW+dY/5QLjfB8svtSzKKE=
github.com/prometheus/common v0.48.0/go.mod h1:0/KsvlIEfPQCQ5I2iNSAWKPZziNCvRs5EC6ILDTlAPc=
github.com/prometheus/procfs v0.0.0-20181005140218-185b4288413d/go.mod h1:c3At6R/oaqEKCNdg8wHV1ftS6bRYblBhIjjI8uT2IGk=
github.com/prometheus/procfs v0.0.2/go.mod h1:TjEm7ze935MbeOT/UhFTIMYKhuLP4wbCsTZCD3I8kEA=
github.com/prometheus/procfs v0.1.3/go.mod h1:lV6e/gmhEcM9IjHGsFOCxxuZ+z1YqCvr4OA4YeYWdaU=
github.com/prometheus/procfs v0.6.0/go.mod h1:cz+aTbrPOrUb4q7XlbU9ygM+/jj0fzG6c1xBZuNvfVA=
github.com/prometheus/procfs v0.7.3/go.mod h1:cz+aTbrPOrUb4q7XlbU9ygM+/jj0fzG6c1xBZuNvfVA=
github.com/prometheus/procfs v0.10.1 h1:kYK1Va/YMlutzCGazswoHKo//tZVlFpKYh+PymziUAg=
github.com/prometheus/procfs v0.10.1/go.mod h1:nwNm2aOCAYw8uTR/9bWRREkZFxAUcWzPHWJq+XBB/FM=
github.com/prometheus/procfs v0.12.0 h1:jluTpSng7V9hY0O2R9DzzJHYb2xULk9VTR1V1R/k6Bo=
github.com/prometheus/procfs v0.12.0/go.mod h1:pcuDEFsWDnvcgNzo4EEweacyhjeA9Zk3cnaOZAZEfOo=
github.com/remyoudompheng/bigfft v0.0.0-20190728182440-6a916e37a237/go.mod h1:qqbHyh8v60DhA7CoWK5oRCqLrMHRGoxYCSS9EjAz6Eo=
github.com/remyoudompheng/bigfft v0.0.0-20200410134404-eec4a21b6bb0/go.mod h1:qqbHyh8v60DhA7CoWK5oRCqLrMHRGoxYCSS9EjAz6Eo=
github.com/remyoudompheng/bigfft v0.0.0-20230129092748-24d4a6f8daec/go.mod h1:qqbHyh8v60DhA7CoWK5oRCqLrMHRGoxYCSS9EjAz6Eo=
Expand Down
28 changes: 14 additions & 14 deletions workflow/controller/operator_metrics_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ func TestBasicMetric(t *testing.T) {
metric := controller.metrics.GetCustomMetric(metricDesc).(prometheus.Gauge)
metricString, err := getMetricStringValue(metric)
assert.NoError(t, err)
assert.Contains(t, metricString, `label:<name:"name" value:"random-int" > gauge:<value:`)
assert.Contains(t, metricString, `label:{name:"name" value:"random-int"} gauge:{value:`)
}

var gaugeMetric = `
Expand Down Expand Up @@ -148,22 +148,22 @@ func TestGaugeMetric(t *testing.T) {
metricAddGauge := controller.metrics.GetCustomMetric(metricAddDesc).(prometheus.Gauge)
metricAddGaugeValue, err := getMetricStringValue(metricAddGauge)
assert.NoError(t, err)
assert.Contains(t, metricAddGaugeValue, `label:<name:"name" value:"random-int" > gauge:<value:10 >`)
assert.Contains(t, metricAddGaugeValue, `label:{name:"name" value:"random-int"} gauge:{value:10}`)

metricSubGauge := controller.metrics.GetCustomMetric(metricSubDesc).(prometheus.Gauge)
metricSubGaugeValue, err := getMetricStringValue(metricSubGauge)
assert.NoError(t, err)
assert.Contains(t, metricSubGaugeValue, `label:<name:"name" value:"random-int" > gauge:<value:-5 >`)
assert.Contains(t, metricSubGaugeValue, `label:{name:"name" value:"random-int"} gauge:{value:-5}`)

metricSetGauge := controller.metrics.GetCustomMetric(metricSetDesc).(prometheus.Gauge)
metricSetGaugeValue, err := getMetricStringValue(metricSetGauge)
assert.NoError(t, err)
assert.Contains(t, metricSetGaugeValue, `label:<name:"name" value:"random-int" > gauge:<value:50 >`)
assert.Contains(t, metricSetGaugeValue, `label:{name:"name" value:"random-int"} gauge:{value:50}`)

metricDefaultGauge := controller.metrics.GetCustomMetric(metricDefaultDesc).(prometheus.Gauge)
metricDefaultGaugeValue, err := getMetricStringValue(metricDefaultGauge)
assert.NoError(t, err)
assert.Contains(t, metricDefaultGaugeValue, `label:<name:"name" value:"random-int" > gauge:<value:15 >`)
assert.Contains(t, metricDefaultGaugeValue, `label:{name:"name" value:"random-int"} gauge:{value:15}`)
}

var counterMetric = `
Expand Down Expand Up @@ -221,13 +221,13 @@ func TestCounterMetric(t *testing.T) {
metricTotalCounter := controller.metrics.GetCustomMetric(metricTotalDesc).(prometheus.Counter)
metricTotalCounterString, err := getMetricStringValue(metricTotalCounter)
assert.NoError(t, err)
assert.Contains(t, metricTotalCounterString, `label:<name:"name" value:"flakey" > counter:<value:1 >`)
assert.Contains(t, metricTotalCounterString, `label:{name:"name" value:"flakey"} counter:{value:1`)

metricErrorCounter, ok := controller.metrics.GetCustomMetric(metricErrorDesc).(prometheus.Counter)
if ok {
metricErrorCounterString, err := getMetricStringValue(metricErrorCounter)
assert.NoError(t, err)
assert.Contains(t, metricErrorCounterString, `label:<name:"name" value:"flakey" > counter:<value:1 >`)
assert.Contains(t, metricErrorCounterString, `label:{name:"name" value:"flakey"} counter:{value:1`)
}
}

Expand Down Expand Up @@ -325,7 +325,7 @@ func TestMetricEmissionSameOperationCreationAndFailure(t *testing.T) {
metricErrorCounter := controller.metrics.GetCustomMetric(metricErrorDesc).(prometheus.Counter)
metricErrorCounterString, err := getMetricStringValue(metricErrorCounter)
assert.NoError(t, err)
assert.Contains(t, metricErrorCounterString, `counter:<value:1 > `)
assert.Contains(t, metricErrorCounterString, `counter:{value:1 `)
}

var testRetryStrategyMetric = `
Expand Down Expand Up @@ -406,14 +406,14 @@ func TestRetryStrategyMetric(t *testing.T) {
metricErrorCounter := controller.metrics.GetCustomMetric(metricErrorDesc).(prometheus.Counter)
metricErrorCounterString, err := getMetricStringValue(metricErrorCounter)
assert.NoError(t, err)
assert.Contains(t, metricErrorCounterString, `counter:<value:1 > `)
assert.Contains(t, metricErrorCounterString, `counter:{value:1 `)

metricErrorDesc = wf.Spec.Templates[1].Metrics.Prometheus[0].GetDesc()
assert.NotNil(t, controller.metrics.GetCustomMetric(metricErrorDesc))
metricErrorCounter = controller.metrics.GetCustomMetric(metricErrorDesc).(prometheus.Counter)
metricErrorCounterString, err = getMetricStringValue(metricErrorCounter)
assert.NoError(t, err)
assert.Contains(t, metricErrorCounterString, `counter:<value:1 > `)
assert.Contains(t, metricErrorCounterString, `counter:{value:1 `)
}
}

Expand Down Expand Up @@ -524,7 +524,7 @@ func TestDAGTmplMetrics(t *testing.T) {
metricHistogram := controller.metrics.GetCustomMetric(metricDesc).(prometheus.Histogram)
metricHistogramString, err := getMetricStringValue(metricHistogram)
assert.NoError(t, err)
assert.Contains(t, metricHistogramString, `histogram:<sample_count:1 sample_sum:5`)
assert.Contains(t, metricHistogramString, `histogram:{sample_count:1 sample_sum:5 `)

tmpl = woc.wf.GetTemplateByName("flakey")
assert.NotNil(t, tmpl)
Expand All @@ -533,7 +533,7 @@ func TestDAGTmplMetrics(t *testing.T) {
metricCounter := controller.metrics.GetCustomMetric(metricDesc).(prometheus.Counter)
metricCounterString, err := getMetricStringValue(metricCounter)
assert.NoError(t, err)
assert.Contains(t, metricCounterString, `counter:<value:1 > `)
assert.Contains(t, metricCounterString, `counter:{value:1 `)
}

var testRealtimeWorkflowMetric = `
Expand Down Expand Up @@ -584,7 +584,7 @@ func TestRealtimeWorkflowMetric(t *testing.T) {
metricErrorCounter := controller.metrics.GetCustomMetric(metricErrorDesc)
metricErrorCounterString, err := getMetricStringValue(metricErrorCounter)
assert.NoError(t, err)
assert.Contains(t, metricErrorCounterString, `label:<name:"workflowName" value:"test-foobar" > gauge:<value:`)
assert.Contains(t, metricErrorCounterString, `label:{name:"label" value:"foobar"} label:{name:"workflowName" value:"test-foobar"} gauge:{value:`)

value1, err := getMetricGaugeValue(controller.metrics.GetCustomMetric(metricErrorDesc))
assert.NoError(t, err)
Expand Down Expand Up @@ -651,7 +651,7 @@ func TestRealtimeWorkflowMetricWithGlobalParameters(t *testing.T) {
metricErrorCounter := controller.metrics.GetCustomMetric(metricErrorDesc)
metricErrorCounterString, err := getMetricStringValue(metricErrorCounter)
assert.NoError(t, err)
assert.Contains(t, metricErrorCounterString, `label:<name:"workflowName" value:"test-foobar" > gauge:<value:`)
assert.Contains(t, metricErrorCounterString, `label:{name:"label" value:"foobar"} label:{name:"workflowName" value:"test-foobar"} gauge:{value:`)
}

var testProcessedRetryNode = `
Expand Down
6 changes: 3 additions & 3 deletions workflow/metrics/metrics_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,9 @@ import (
"github.com/argoproj/argo-workflows/v3/pkg/apis/workflow/v1alpha1"
)

func write(metric prometheus.Metric) dto.Metric {
var m dto.Metric
err := metric.Write(&m)
func write(metric prometheus.Metric) *dto.Metric {
m := &dto.Metric{}
err := metric.Write(m)
if err != nil {
panic(err)
}
Expand Down

0 comments on commit 5a25998

Please sign in to comment.