-
Notifications
You must be signed in to change notification settings - Fork 239
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[dev] Vendor modules and add patch file for StatsD Receiver (#2221)
* go mod vendor * Apply changes to workflows to apply patches * Add statd feature gate patch * Don't link check vendor docs * Ignore vendor dir for linters * Ignore shell scripts in vendor * increase timeout for golangcilint
- Loading branch information
1 parent
af553ea
commit 9468cd0
Showing
13,498 changed files
with
4,096,283 additions
and
5 deletions.
The diff you're trying to view is too large. We only load the first 3000 changed files.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,84 @@ | ||
commit 2effc76f12019edc9689388204ab9faab63ff8f4 | ||
Author: Bryan Aguilar <[email protected]> | ||
Date: Tue Jul 25 17:33:22 2023 -0700 | ||
|
||
Add feature gate for instrumentation scope in statsd receiver | ||
|
||
diff --git a/vendor/github.com/open-telemetry/opentelemetry-collector-contrib/receiver/statsdreceiver/protocol/statsd_parser.go b/vendor/github.com/open-telemetry/opentelemetry-collector-contrib/receiver/statsdreceiver/protocol/statsd_parser.go | ||
index 1cfec5cf..699d6ee7 100644 | ||
--- a/vendor/github.com/open-telemetry/opentelemetry-collector-contrib/receiver/statsdreceiver/protocol/statsd_parser.go | ||
+++ b/vendor/github.com/open-telemetry/opentelemetry-collector-contrib/receiver/statsdreceiver/protocol/statsd_parser.go | ||
@@ -14,6 +14,7 @@ import ( | ||
"github.com/lightstep/go-expohisto/structure" | ||
"go.opentelemetry.io/collector/client" | ||
"go.opentelemetry.io/collector/component" | ||
+ "go.opentelemetry.io/collector/featuregate" | ||
"go.opentelemetry.io/collector/pdata/pcommon" | ||
"go.opentelemetry.io/collector/pdata/pmetric" | ||
"go.opentelemetry.io/otel/attribute" | ||
@@ -30,6 +31,13 @@ type ( | ||
ObserverType string // How the server will aggregate histogram and timings ("gauge", "summary") | ||
) | ||
|
||
+var instNameFeatGate = featuregate.GlobalRegistry().MustRegister("aws.statsd.populateInstrumentationScope", | ||
+ featuregate.StageAlpha, | ||
+ featuregate.WithRegisterFromVersion("v0.82.0"), | ||
+ featuregate.WithRegisterDescription("populates instrumentation scope library name on StatsD receiver "+ | ||
+ "metric data points"), | ||
+) | ||
+ | ||
const ( | ||
tagMetricType = "metric_type" | ||
|
||
@@ -194,21 +202,35 @@ func (p *StatsDParser) GetMetrics() []BatchMetrics { | ||
} | ||
rm := batch.Metrics.ResourceMetrics().AppendEmpty() | ||
for _, metric := range instrument.gauges { | ||
- p.copyMetricAndScope(rm, metric) | ||
+ if instNameFeatGate.IsEnabled() { | ||
+ p.copyMetricAndScope(rm, metric) | ||
+ } else { | ||
+ metric.CopyTo(rm.ScopeMetrics().AppendEmpty()) | ||
+ } | ||
} | ||
|
||
for _, metric := range instrument.timersAndDistributions { | ||
- p.copyMetricAndScope(rm, metric) | ||
+ if instNameFeatGate.IsEnabled() { | ||
+ p.copyMetricAndScope(rm, metric) | ||
+ } else { | ||
+ metric.CopyTo(rm.ScopeMetrics().AppendEmpty()) | ||
+ } | ||
} | ||
|
||
for _, metric := range instrument.counters { | ||
setTimestampsForCounterMetric(metric, p.lastIntervalTime, now) | ||
- p.copyMetricAndScope(rm, metric) | ||
+ if instNameFeatGate.IsEnabled() { | ||
+ p.copyMetricAndScope(rm, metric) | ||
+ } else { | ||
+ metric.CopyTo(rm.ScopeMetrics().AppendEmpty()) | ||
+ } | ||
} | ||
|
||
for desc, summaryMetric := range instrument.summaries { | ||
ilm := rm.ScopeMetrics().AppendEmpty() | ||
- p.setVersionAndNameScope(ilm.Scope()) | ||
+ if instNameFeatGate.IsEnabled() { | ||
+ p.setVersionAndNameScope(ilm.Scope()) | ||
+ } | ||
|
||
buildSummaryMetric( | ||
desc, | ||
@@ -222,8 +244,10 @@ func (p *StatsDParser) GetMetrics() []BatchMetrics { | ||
|
||
for desc, histogramMetric := range instrument.histograms { | ||
ilm := rm.ScopeMetrics().AppendEmpty() | ||
- p.setVersionAndNameScope(ilm.Scope()) | ||
+ if instNameFeatGate.IsEnabled() { | ||
+ p.setVersionAndNameScope(ilm.Scope()) | ||
|
||
+ } | ||
buildHistogramMetric( | ||
desc, | ||
histogramMetric, |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Oops, something went wrong.