Skip to content

Commit 8946486

Browse files
authoredJun 27, 2022
Merge pull request #1709 from Shopify/ahayworth/merge-shopify-changes-v0.53.0
Merge shopify changes onto v0.53.0
2 parents 1cbacd8 + f0611ea commit 8946486

File tree

27 files changed

+529
-420
lines changed

27 files changed

+529
-420
lines changed
 

‎.github/dependabot.yml

+176-168
Large diffs are not rendered by default.

‎Makefile

+4-4
Original file line numberDiff line numberDiff line change
@@ -158,23 +158,23 @@ gendependabot:
158158
@echo " - package-ecosystem: \"github-actions\"" >> ${DEPENDABOT_PATH}
159159
@echo " directory: \"/\"" >> ${DEPENDABOT_PATH}
160160
@echo " schedule:" >> ${DEPENDABOT_PATH}
161-
@echo " interval: \"weekly\"" >> ${DEPENDABOT_PATH}
161+
@echo " interval: \"monthly\"" >> ${DEPENDABOT_PATH}
162162
@echo "Add entry for \"/\" docker"
163163
@echo " - package-ecosystem: \"docker\"" >> ${DEPENDABOT_PATH}
164164
@echo " directory: \"/\"" >> ${DEPENDABOT_PATH}
165165
@echo " schedule:" >> ${DEPENDABOT_PATH}
166-
@echo " interval: \"weekly\"" >> ${DEPENDABOT_PATH}
166+
@echo " interval: \"monthly\"" >> ${DEPENDABOT_PATH}
167167
@echo "Add entry for \"/\" gomod"
168168
@echo " - package-ecosystem: \"gomod\"" >> ${DEPENDABOT_PATH}
169169
@echo " directory: \"/\"" >> ${DEPENDABOT_PATH}
170170
@echo " schedule:" >> ${DEPENDABOT_PATH}
171-
@echo " interval: \"weekly\"" >> ${DEPENDABOT_PATH}
171+
@echo " interval: \"monthly\"" >> ${DEPENDABOT_PATH}
172172
@set -e; for dir in $(NONROOT_MODS); do \
173173
echo "Add entry for \"$${dir:1}\""; \
174174
echo " - package-ecosystem: \"gomod\"" >> ${DEPENDABOT_PATH}; \
175175
echo " directory: \"$${dir:1}\"" >> ${DEPENDABOT_PATH}; \
176176
echo " schedule:" >> ${DEPENDABOT_PATH}; \
177-
echo " interval: \"weekly\"" >> ${DEPENDABOT_PATH}; \
177+
echo " interval: \"monthly\"" >> ${DEPENDABOT_PATH}; \
178178
done
179179

180180
# Define a delegation target for each module

‎cmd/configschema/go.mod

+4-2
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ require (
77
github.com/google/uuid v1.3.0
88
github.com/open-telemetry/opentelemetry-collector-contrib v0.53.0
99
github.com/open-telemetry/opentelemetry-collector-contrib/pkg/resourcetotelemetry v0.53.0
10-
github.com/stretchr/testify v1.7.2
10+
github.com/stretchr/testify v1.7.4
1111
go.opentelemetry.io/collector v0.53.0
1212
go.opentelemetry.io/collector/pdata v0.53.0
1313
go.uber.org/multierr v1.8.0
@@ -449,7 +449,7 @@ require (
449449
github.com/spf13/jwalterweatherman v1.1.0 // indirect
450450
github.com/spf13/pflag v1.0.5 // indirect
451451
github.com/spf13/viper v1.11.0 // indirect
452-
github.com/stretchr/objx v0.3.0 // indirect
452+
github.com/stretchr/objx v0.4.0 // indirect
453453
github.com/subosito/gotenv v1.2.0 // indirect
454454
github.com/syndtr/gocapability v0.0.0-20200815063812-42c35b437635 // indirect
455455
github.com/syndtr/goleveldb v1.0.0 // indirect
@@ -883,3 +883,5 @@ exclude github.com/StackExchange/wmi v1.2.0
883883

884884
// see https://github.com/distribution/distribution/issues/3590
885885
exclude github.com/docker/distribution v2.8.0+incompatible
886+
887+
replace github.com/prometheus/client_golang => github.com/prometheus/client_golang v1.12.2-0.20220318110013-3bc8f2c651ff

‎cmd/configschema/go.sum

+6-40
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎exporter/prometheusexporter/collector.go

+25
Original file line numberDiff line numberDiff line change
@@ -215,11 +215,36 @@ func (c *collector) convertDoubleHistogram(metric pmetric.Metric, resourceAttrs
215215
points[bucket] = cumCount
216216
}
217217

218+
arrLen := ip.Exemplars().Len()
219+
exemplars := make([]prometheus.Exemplar, arrLen)
220+
for i := 0; i < arrLen; i++ {
221+
e := ip.Exemplars().At(i)
222+
223+
labels := make(prometheus.Labels, e.FilteredAttributes().Len())
224+
e.FilteredAttributes().Range(func(k string, v pcommon.Value) bool {
225+
labels[k] = v.AsString()
226+
return true
227+
})
228+
229+
exemplars[i] = prometheus.Exemplar{
230+
Value: e.DoubleVal(),
231+
Labels: labels,
232+
Timestamp: e.Timestamp().AsTime(),
233+
}
234+
}
235+
218236
m, err := prometheus.NewConstHistogram(desc, ip.Count(), ip.Sum(), points, attributes...)
219237
if err != nil {
220238
return nil, err
221239
}
222240

241+
if arrLen > 0 {
242+
m, err = prometheus.NewMetricWithExemplars(m, exemplars...)
243+
if err != nil {
244+
return nil, err
245+
}
246+
}
247+
223248
if c.sendTimestamps {
224249
return prometheus.NewMetricWithTimestamp(ip.Timestamp().AsTime(), m), nil
225250
}

0 commit comments

Comments
 (0)
Failed to load comments.