diff --git a/Makefile b/Makefile index e903f95e3a9..043ebf5e4c0 100644 --- a/Makefile +++ b/Makefile @@ -218,6 +218,10 @@ generate-mocks: $(MOCKERY) certs: cd pkg/config/tlscfg/testdata && ./gen-certs.sh +.PHONY: features +features: + go run ./cmd/jaeger/features + .PHONY: certs-dryrun certs-dryrun: cd pkg/config/tlscfg/testdata && ./gen-certs.sh -d diff --git a/cmd/jaeger/features/main.go b/cmd/jaeger/features/main.go new file mode 100644 index 00000000000..24a69e4c950 --- /dev/null +++ b/cmd/jaeger/features/main.go @@ -0,0 +1,48 @@ +// Copyright (c) 2023 The Jaeger Authors. +// SPDX-License-Identifier: Apache-2.0 + +package main + +import ( + "fmt" + + "go.opentelemetry.io/collector/component" + "go.opentelemetry.io/collector/confmap" + "go.opentelemetry.io/collector/confmap/provider/envprovider" + "go.opentelemetry.io/collector/confmap/provider/fileprovider" + "go.opentelemetry.io/collector/confmap/provider/httpprovider" + "go.opentelemetry.io/collector/confmap/provider/httpsprovider" + "go.opentelemetry.io/collector/confmap/provider/yamlprovider" + "go.opentelemetry.io/collector/otelcol" + + "github.com/jaegertracing/jaeger/cmd/jaeger/internal" + "github.com/jaegertracing/jaeger/pkg/version" +) + +func main() { + info := component.BuildInfo{ + Command: "jaeger", + Description: internal.GetDescription(), + Version: version.Get().GitVersion, + } + + settings := otelcol.CollectorSettings{ + BuildInfo: info, + Factories: internal.Components, + ConfigProviderSettings: otelcol.ConfigProviderSettings{ + ResolverSettings: confmap.ResolverSettings{ + ProviderFactories: []confmap.ProviderFactory{ + envprovider.NewFactory(), + fileprovider.NewFactory(), + httpprovider.NewFactory(), + httpsprovider.NewFactory(), + yamlprovider.NewFactory(), + }, + }, + }, + } + + fmt.Println("\n" + internal.GetDescription()) + fmt.Println("List of feature gate identifiers. Prefix with '-' to disable the feature. '+' or no prefix will enable the feature.\n ") + otelcol.FeatureCommand(settings) +} diff --git a/cmd/jaeger/internal/command.go b/cmd/jaeger/internal/command.go index 6ac217dadd6..e98459e2222 100644 --- a/cmd/jaeger/internal/command.go +++ b/cmd/jaeger/internal/command.go @@ -26,6 +26,10 @@ var yamlAllInOne embed.FS const description = "Jaeger backend v2" +func GetDescription() string { + return description +} + func Command() *cobra.Command { info := component.BuildInfo{ Command: "jaeger",