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

[GEN-1702] Add odigos UI beta flag #1760

Merged

Conversation

alonkeyval
Copy link
Collaborator

This pull request introduces several changes to the cli/cmd/ui.go and frontend directories, focusing on adding support for a beta UI, enhancing instrumentation labeling, and refactoring the code to use the Gin framework for HTTP handling.

Support for Beta UI:

  • Added a new constant betaDefaultPort and modified the uiCmd to include a beta flag that allows port-forwarding the beta UI pod on port 3001. (cli/cmd/ui.go) [1] [2] [3]
  • Updated the frontend/main.go to support running a separate server for the beta UI, including embedding the beta UI files and handling GraphQL requests. (frontend/main.go) [1] [2] [3] [4] [5] [6] [7]

Instrumentation Labeling Enhancements:

  • Renamed WorkloadLabeled to AppInstrumentationLabeled and introduced new fields NsInstrumentationLabeled and InstrumentationEffective to track instrumentation status more accurately. (frontend/endpoints/applications.go) [1] [2] [3] [4] [5]
  • Modified the logic to determine if the entire namespace is instrumented and updated the response accordingly. (frontend/endpoints/applications.go)

Refactoring to Use Gin Framework:

  • Updated several endpoints to use the Gin framework for handling HTTP requests, improving the structure and maintainability of the code. (frontend/endpoints/config.go, frontend/endpoints/destinations.go, frontend/endpoints/namespaces.go, frontend/endpoints/sources.go) [1] [2] [3] [4] [5]

Dockerfile Update:

  • Added a new copy command to include additional dependencies in the Docker build process. (frontend/Dockerfile)

These changes collectively improve the functionality and maintainability of the code, providing better support for a beta UI and enhancing the instrumentation labeling mechanism.

alonkeyval and others added 30 commits August 27, 2024 15:01
[GEN-1361] feat: get destination - gql
[GEN-1043] chore: insert destinations and action to cp and create resolvers
[GEN-1405] chore: change api to new schema and delete unused files
Copy link

Add beta ui to cli

cli/cmd/resources/ui.go Show resolved Hide resolved
cli/cmd/ui.go Outdated Show resolved Hide resolved
cli/cmd/ui.go Outdated Show resolved Hide resolved
cli/cmd/ui.go Outdated Show resolved Hide resolved
frontend/main.go Outdated
@@ -215,6 +271,8 @@ func httpFileServerWith404(fs http.FileSystem) http.Handler {
})
}

////dep server
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

??

frontend/main.go Outdated
@@ -204,7 +260,7 @@ func startHTTPServer(flags *Flags, odigosMetrics *collectormetrics.OdigosMetrics
return r, nil
}

func httpFileServerWith404(fs http.FileSystem) http.Handler {
func httpFileDepServerWith404(fs http.FileSystem) http.Handler {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

unused - remove

cli/cmd/ui.go Outdated
func init() {
rootCmd.AddCommand(uiCmd)
uiCmd.Flags().Int("port", defaultPort, "port to listen on")
uiCmd.Flags().Int("port", defaultPort, "Port to listen on 3000")
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
uiCmd.Flags().Int("port", defaultPort, "Port to listen on 3000")
uiCmd.Flags().Int("port", defaultPort, "Port to listen on")

cli/cmd/ui.go Outdated
uiCmd.Flags().String("address", "localhost", "Address to listen on")
uiCmd.Flags().Bool("beta", false, "this flag is used to start the beta version of the UI")
Copy link
Collaborator

@blumamir blumamir Nov 17, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
uiCmd.Flags().Bool("beta", false, "this flag is used to start the beta version of the UI")
uiCmd.Flags().Bool("beta", false, "use new experimental ui")

@alonkeyval alonkeyval merged commit 34c2c74 into odigos-io:odigos-ui-beta Nov 17, 2024
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants