Skip to content

Commit

Permalink
Full
Browse files Browse the repository at this point in the history
Signed-off-by: cs-308-2023 <[email protected]>
  • Loading branch information
ADI-ROXX committed Jan 21, 2025
1 parent 3b1a1a0 commit fb869e9
Show file tree
Hide file tree
Showing 3 changed files with 46 additions and 58 deletions.
31 changes: 31 additions & 0 deletions cmd/jaeger/internal/features/display.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
// Copyright (c) 2025 The Jaeger Authors.
// SPDX-License-Identifier: Apache-2.0

package features

import (
"fmt"

"go.opentelemetry.io/collector/featuregate"
)

func DisplayFeatures() {
f := featuregate.GlobalRegistry()
if f == nil {
return
}
f.VisitAll(func(g *featuregate.Gate) {
fmt.Printf("Feature:\t%s\n", g.ID())
if !g.IsEnabled() {
fmt.Printf("Default state:\t%s\n", "On")
} else {
fmt.Printf("Default state:\t%s\n", "Off")
}
fmt.Printf("Description:\t%s\n", g.Description())

if ref := g.ReferenceURL(); ref != "" {
fmt.Printf("ReferenceURL:\t%s\n", ref)
}
fmt.Println()
})
}
15 changes: 15 additions & 0 deletions cmd/jaeger/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,12 @@ package main
import (
"log"

"github.com/spf13/cobra"
"github.com/spf13/viper"

"github.com/jaegertracing/jaeger/cmd/internal/docs"
"github.com/jaegertracing/jaeger/cmd/jaeger/internal"
"github.com/jaegertracing/jaeger/cmd/jaeger/internal/features"
"github.com/jaegertracing/jaeger/pkg/config"
"github.com/jaegertracing/jaeger/pkg/version"
)
Expand All @@ -19,6 +21,8 @@ func main() {
command := internal.Command()
command.AddCommand(version.Command())
command.AddCommand(docs.Command(v))
command.AddCommand(featuresCommand())

config.AddFlags(
v,
command,
Expand All @@ -28,3 +32,14 @@ func main() {
log.Fatal(err)
}
}

func featuresCommand() *cobra.Command {
return &cobra.Command{
Use: "features",
Short: "Displays the list of supported features",
Long: "The 'features' command shows all supported features in the current build of Jaeger.",
Run: func(_ *cobra.Command, _ []string) {
features.DisplayFeatures()
},
}
}
58 changes: 0 additions & 58 deletions features/main.go

This file was deleted.

0 comments on commit fb869e9

Please sign in to comment.