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

Add more initializer-related info to /insights API #20572

Merged
merged 7 commits into from
Feb 26, 2025
Merged

Conversation

geropl
Copy link
Member

@geropl geropl commented Jan 31, 2025

Description

This PR introduces the following shape on the ListWorkspaceSessionsApi:

  message Metrics {
    [...]

    // initializer_metrics are all metrics exported from the content initializer on workspace start
    InitializerMetrics initializer_metrics = 3;
  }

  // Add these new message definitions
  message InitializerMetric {
    // Duration in nanoseconds (standard protobuf duration)
    google.protobuf.Duration duration = 1;

    // Size in bytes
    uint64 size = 2;
  }

  message InitializerMetrics {
    // Git contains metrics for the git initializer step
    InitializerMetric git = 1;

    // FileDownload contains metrics for the file download initializer step
    InitializerMetric file_download = 2;

    // Snapshot contains metrics for the snapshot initializer step
    // This used for workspaces started from snapshots.
    InitializerMetric snapshot = 3;

    // Backup contains metrics for the backup initializer step
    InitializerMetric backup = 4;

    // Prebuild contains metrics for the prebuild initializer step
    InitializerMetric prebuild = 5;

    // Composite contains metrics for the composite initializer step
    InitializerMetric composite = 6;
  }

It has basically the same content as the "metrics" shape "ready" in the workspace's ready file.

Example CSV: gitpod-sessions-supercorp-20250218-20250225.csv

Related Issue(s)

Fixes CLC-1052

How to test

Documentation

Preview status

gitpod:summary

Build Options

Build
  • /werft with-werft
    Run the build with werft instead of GHA
  • leeway-no-cache
  • /werft no-test
    Run Leeway with --dont-test
Publish
  • /werft publish-to-npm
  • /werft publish-to-jb-marketplace
Installer
  • analytics=segment
  • with-dedicated-emulation
  • workspace-feature-flags
    Add desired feature flags to the end of the line above, space separated
Preview Environment / Integration Tests
  • /werft with-local-preview
    If enabled this will build install/preview
  • /werft with-preview
  • /werft with-large-vm
  • /werft with-gce-vm
    If enabled this will create the environment on GCE infra
  • /werft preemptible
    Saves cost. Untick this only if you're really sure you need a non-preemtible machine.
  • with-integration-tests=all
    Valid options are all, workspace, webapp, ide, jetbrains, vscode, ssh. If enabled, with-preview and with-large-vm will be enabled.
  • with-monitoring

/hold

Copy link
Contributor

This pull request has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@github-actions github-actions bot added the meta: stale This issue/PR is stale and will be closed soon label Feb 15, 2025
@geropl geropl force-pushed the gpl/1052-more-metrics branch from 7040de0 to fb6c6d7 Compare February 18, 2025 14:03
@roboquat roboquat added size/XL and removed size/L labels Feb 18, 2025
@github-actions github-actions bot removed the meta: stale This issue/PR is stale and will be closed soon label Feb 18, 2025
@roboquat roboquat added size/XXL and removed size/XL labels Feb 19, 2025
@geropl geropl force-pushed the gpl/1052-more-metrics branch 3 times, most recently from 850049d to 78c04d6 Compare February 25, 2025 16:43
@geropl geropl marked this pull request as ready for review February 25, 2025 16:56
@geropl geropl requested review from a team as code owners February 25, 2025 16:56
@geropl
Copy link
Member Author

geropl commented Feb 25, 2025

@iQQBot Would be awesome if you could help review all the workspace/ws-daemon parts of this PR, with a focus on how these changes could fail/block a workspaces start, which should never be the case. 🙏

@geropl geropl changed the title [WIP] Add more initializer-related info to /insights API Add more initializer-related info to /insights API Feb 25, 2025
@geropl geropl force-pushed the gpl/1052-more-metrics branch from 78c04d6 to 8683749 Compare February 26, 2025 10:06
Copy link
Member

@filiptronicek filiptronicek left a comment

Choose a reason for hiding this comment

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

Left some comments, including blocking ones. Continuing with my review in the bg...

…m ws-manager-api into it

Tool: gitpod/catfood.gitpod.cloud
Tool: gitpod/catfood.gitpod.cloud
Tool: gitpod/catfood.gitpod.cloud
Tool: gitpod/catfood.gitpod.cloud
@geropl geropl force-pushed the gpl/1052-more-metrics branch from 2b87939 to d1dd415 Compare February 26, 2025 13:35
@geropl
Copy link
Member Author

geropl commented Feb 26, 2025

Redeploying the preview...

@geropl
Copy link
Member Author

geropl commented Feb 26, 2025

Done @filiptronicek

fromBackup is filled now 💪

Copy link
Member

Awesome sauce! Looks great

Copy link
Member

@filiptronicek filiptronicek left a comment

Choose a reason for hiding this comment

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

Tested and reviewed (although I just skimmed over the ws-daemon changes). Looks amazing!

wrt the initializer types: I managed to catch 'em all, so I'm satisfied ;).
image

}

// waitForAndReadExtraFiles tries to read the content of the extra files passed to the content initializer, and waits up to 1s to do so
Copy link
Member

Choose a reason for hiding this comment

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

out of curiousity: was waiting the 1s the fix to your problems with the file being empty?

Co-authored-by: Filip Troníček <filip@gitpod.io>
@geropl
Copy link
Member Author

geropl commented Feb 26, 2025

@iQQBot Waiting for your feedback now 👍

Copy link
Contributor

@iQQBot iQQBot left a comment

Choose a reason for hiding this comment

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

Code LGTM, Just curious, why use the fd method to transfer data? Don't we already have file records in filepath.Join(ws.Location, ".gitpod/ready")? We can also directly read this file.

@geropl
Copy link
Member Author

geropl commented Feb 26, 2025

/unhold

@roboquat roboquat merged commit 26f7f5d into main Feb 26, 2025
19 checks passed
@roboquat roboquat deleted the gpl/1052-more-metrics branch February 26, 2025 19:34
@geropl
Copy link
Member Author

geropl commented Feb 26, 2025

Just curious, why use the fd method to transfer data? Don't we already have file records in filepath.Join(ws.Location, ".gitpod/ready")? We can also directly read this file.

True! I wanted to to decouple both aspects, and found we already have that .ExtraFiles mechanism, so happily used that. 🙂

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants