Skip to content

Commit 3bcb18c

Browse files
authored
Merge pull request #2366 from aws-observability/rapphil-override-feature-gate
Handle prometheus normalization breaking change
2 parents 67d4ed2 + 7d60b75 commit 3bcb18c

File tree

2 files changed

+27
-6
lines changed

2 files changed

+27
-6
lines changed

README.md

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,10 @@ Use the community resources below for getting help with the ADOT Collector.
2222
Users of the `statsd` receiver, please refer to GitHub Issue - [Warning: StatsD Receiver → EMF Exporter Metric Pipeline Breaking Change](https://github.com/aws-observability/aws-otel-collector/issues/2249)
2323
for information on an upcoming breaking change.
2424

25-
### Notice: ADOT Collector v0.35.0 Breaking Change
26-
Users of the 'awscontainerinsightreceiver', please refer to the GitHub Issue - [Warning: Container Image Default User Change → Important consideration for AWSContainerInsightReceiver](https://github.com/aws-observability/aws-otel-collector/issues/2317) for more information on an upcoming breaking change.
25+
### Notices: ADOT Collector v0.35.0 Breaking Changes
26+
* Users of the 'awscontainerinsightreceiver', please refer to the GitHub Issue - [Warning: Container Image Default User Change → Important consideration for AWSContainerInsightReceiver](https://github.com/aws-observability/aws-otel-collector/issues/2317) for more information on an upcoming breaking change.
27+
* Users of the `prometheus` or `prometheusremotewrite` exporters please refer to the GitHub Issue [Warning: ADOT Collector v0.35.0 breaking change](https://github.com/aws-observability/aws-otel-collector/issues/2367)
28+
for information on an upcoming breaking change.
2729

2830
#### ADOT Collector Built-in Components
2931

cmd/awscollector/main.go

Lines changed: 23 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -88,10 +88,16 @@ func main() {
8888
}
8989
}
9090

91-
// We parse the flags manually here so that we can use feature gates when constructing
92-
// our default component list. Flags also need to be parsed before creating the config provider.
93-
func buildAndParseFlagSet(featgate *featuregate.Registry) (*flag.FlagSet, error) {
94-
flagSet := config.Flags(featgate)
91+
// Override upstream feature gates and print warning messages
92+
func handleBreakingChanges(featgate *featuregate.Registry) error {
93+
// TODO: remove after ADOT Collector v0.34.0 is released
94+
if err := featgate.Set("pkg.translator.prometheus.NormalizeName", false); err != nil {
95+
return err
96+
}
97+
98+
log.Printf("attn: users of the prometheus or prometheusremotewrite exporter please refer to " +
99+
"https://github.com/aws-observability/aws-otel-collector/issues/2367 in regards to an ADOT Collector v0.35.0 " +
100+
"breaking change")
95101

96102
// TODO: remove after ADOT Collector v0.34.0 is released
97103
log.Printf("attn: users of the statsd receiver please refer to " +
@@ -101,6 +107,19 @@ func buildAndParseFlagSet(featgate *featuregate.Registry) (*flag.FlagSet, error)
101107
log.Printf("attn: users of the awscontainerinsightreceiver please refer to " +
102108
"https://github.com/aws-observability/aws-otel-collector/issues/2317 in regards to an ADOT Collector v0.35.0 " +
103109
"breaking change")
110+
111+
return nil
112+
}
113+
114+
// We parse the flags manually here so that we can use feature gates when constructing
115+
// our default component list. Flags also need to be parsed before creating the config provider.
116+
func buildAndParseFlagSet(featgate *featuregate.Registry) (*flag.FlagSet, error) {
117+
if err := handleBreakingChanges(featgate); err != nil {
118+
return nil, err
119+
}
120+
121+
flagSet := config.Flags(featgate)
122+
104123
if err := flagSet.Parse(os.Args[1:]); err != nil {
105124
return nil, err
106125
}

0 commit comments

Comments
 (0)