Skip to content

Commit

Permalink
add gui/composeview as part of available commands
Browse files Browse the repository at this point in the history
Signed-off-by: Guillaume Lours <705411+glours@users.noreply.github.com>
  • Loading branch information
glours committed May 23, 2024
1 parent 7ad73c2 commit 0d6ac18
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 4 deletions.
7 changes: 6 additions & 1 deletion internal/tracing/keyboard_metrics.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,14 +22,19 @@ import (
"go.opentelemetry.io/otel/attribute"
)

func KeyboardMetrics(ctx context.Context, enabled, isDockerDesktopActive, isWatchConfigured bool) {
func KeyboardMetrics(ctx context.Context, enabled, isDockerDesktopActive, isWatchConfigured, isDockerDesktopComposeUI bool) {
commandAvailable := []string{}
if isDockerDesktopActive {
commandAvailable = append(commandAvailable, "gui")
}
if isWatchConfigured {
commandAvailable = append(commandAvailable, "watch")
}

if isDockerDesktopComposeUI {
commandAvailable = append(commandAvailable, "gui/composeview")
}

AddAttributeToSpan(ctx,
attribute.Bool("navmenu.enabled", enabled),
attribute.StringSlice("navmenu.command_available", commandAvailable))
Expand Down
6 changes: 3 additions & 3 deletions pkg/compose/up.go
Original file line number Diff line number Diff line change
Expand Up @@ -97,10 +97,10 @@ func (s *composeService) Up(ctx context.Context, project *types.Project, options
} else {
isWatchConfigured := s.shouldWatch(project)
isDockerDesktopActive := s.isDesktopIntegrationActive()
isDDComposeUI := s.isDesktopUIEnabled()
tracing.KeyboardMetrics(ctx, options.Start.NavigationMenu, isDockerDesktopActive, isWatchConfigured)
isDockerDesktopComposeUI := s.isDesktopUIEnabled()
tracing.KeyboardMetrics(ctx, options.Start.NavigationMenu, isDockerDesktopActive, isWatchConfigured, isDockerDesktopComposeUI)

formatter.NewKeyboardManager(ctx, isDockerDesktopActive, isWatchConfigured, isDDComposeUI, signalChan, s.Watch)
formatter.NewKeyboardManager(ctx, isDockerDesktopActive, isWatchConfigured, isDockerDesktopComposeUI, signalChan, s.Watch)
if options.Start.Watch {
formatter.KeyboardManager.StartWatch(ctx, project, options)
}
Expand Down

0 comments on commit 0d6ac18

Please sign in to comment.