Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Handle prometheus normalization breaking change #2366

Merged
merged 2 commits into from
Sep 22, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,10 @@ Use the community resources below for getting help with the ADOT Collector.
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)
for information on an upcoming breaking change.

### Notice: ADOT Collector v0.35.0 Breaking Change
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.
### Notices: ADOT Collector v0.35.0 Breaking Changes
* 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.
* 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)
for information on an upcoming breaking change.

#### ADOT Collector Built-in Components

Expand Down
27 changes: 23 additions & 4 deletions cmd/awscollector/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -88,10 +88,16 @@ func main() {
}
}

// We parse the flags manually here so that we can use feature gates when constructing
// our default component list. Flags also need to be parsed before creating the config provider.
func buildAndParseFlagSet(featgate *featuregate.Registry) (*flag.FlagSet, error) {
flagSet := config.Flags(featgate)
// Override upstream feature gates and print warning messages
func handleBreakingChanges(featgate *featuregate.Registry) error {
// TODO: remove after ADOT Collector v0.34.0 is released
if err := featgate.Set("pkg.translator.prometheus.NormalizeName", false); err != nil {
return err
}

log.Printf("attn: users of the prometheus or prometheusremotewrite exporter please refer to " +
"https://github.com/aws-observability/aws-otel-collector/issues/2367 in regards to an ADOT Collector v0.35.0 " +
"breaking change")

// TODO: remove after ADOT Collector v0.34.0 is released
log.Printf("attn: users of the statsd receiver please refer to " +
Expand All @@ -101,6 +107,19 @@ func buildAndParseFlagSet(featgate *featuregate.Registry) (*flag.FlagSet, error)
log.Printf("attn: users of the awscontainerinsightreceiver please refer to " +
"https://github.com/aws-observability/aws-otel-collector/issues/2317 in regards to an ADOT Collector v0.35.0 " +
"breaking change")

return nil
}

// We parse the flags manually here so that we can use feature gates when constructing
// our default component list. Flags also need to be parsed before creating the config provider.
func buildAndParseFlagSet(featgate *featuregate.Registry) (*flag.FlagSet, error) {
if err := handleBreakingChanges(featgate); err != nil {
return nil, err
}

flagSet := config.Flags(featgate)

if err := flagSet.Parse(os.Args[1:]); err != nil {
return nil, err
}
Expand Down
Loading