- Notifications
You must be signed in to change notification settings - Fork1k
fix: merge cherry-picked items for v2.26.0#19678
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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
Merged
Merged
Uh oh!
There was an error while loading.Please reload this page.
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.Learn more about bidirectional Unicode characters
Quick fix for following issue in CLI:```$ go run ./cmd/coder exp task listEncountered an error running "coder exp task list", see "coder exp task list --help" for more informationerror: Trace=[list tasks: ]Internal error fetching task prompts and states.workspace 14d548f4-aaad-40dd-833b-6ffe9c9d31bc is not an AI task workspaceexit status 1```This occurs in a short time window directly after creating a new task.I took a stab at writing a test for this, but ran out of time. I'm notentirely sure what causes non-AI-task workspaces to be returned in thequery but I suspect it's when a workspace build is pending or running.(cherry picked from commitdbc6c98)
This PR reverts github.com/mark3labs/mcp-go to 0.32.0, which was theversion used by#18670 thatintroduced MCP HTTP support in Coder, and ensures dependabot doesn'tupgrade it automatically.A bug has been introduced in a recent version of mcp-go that causes someHTTP MCP requests to fail with the error message```[erro] coderd.mcp: Failed to handle sampling response: no active session found for session mcp-session-e3cb7333-284f-46bd-a009-d611f1b690f6```The bug may be related to this issue:mark3labs/mcp-go#554.(cherry picked from commita2945b0)
## DescriptionThis PR introduces one counter and two histograms related to workspacecreation and claiming. The goal is to provide clearer observability intohow workspaces are created (regular vs prebuild) and the time cost ofthose operations.### `coderd_workspace_creation_total`* Metric type: Counter* Name: `coderd_workspace_creation_total`* Labels: `organization_name`, `template_name`, `preset_name`This counter tracks whether a regular workspace (not created from aprebuild pool) was created using a preset or not.Currently, we already expose `coderd_prebuilt_workspaces_claimed_total`for claimed prebuilt workspaces, but we lack a comparable metric forregular workspace creations. This metric fills that gap, making itpossible to compare regular creations against claims.Implementation notes:* Exposed as a `coderd_` metric, consistent with other workspace-relatedmetrics (e.g. `coderd_api_workspace_latest_build`:https://github.com/coder/coder/blob/main/coderd/prometheusmetrics/prometheusmetrics.go#L149).* Every `defaultRefreshRate` (1 minute ), DB query`GetRegularWorkspaceCreateMetrics` is executed to fetch all regularworkspaces (not created from a prebuild pool).* The counter is updated with the total from all time (not just sincemetric introduction). This differs from the histograms below, which onlyaccumulate from their introduction forward.### `coderd_workspace_creation_duration_seconds` &`coderd_prebuilt_workspace_claim_duration_seconds`* Metric types: Histogram* Names: * `coderd_workspace_creation_duration_seconds`* Labels: `organization_name`, `template_name`, `preset_name`, `type`(`regular`, `prebuild`) * `coderd_prebuilt_workspace_claim_duration_seconds` * Labels: `organization_name`, `template_name`, `preset_name`We already have `coderd_provisionerd_workspace_build_timings_seconds`,which tracks build run times for all workspace builds handled by theprovisioner daemon.However, in the context of this issue, we are only interested increation and claim build times, not all transitions; additionally, thismetric does not include `preset_name`, and adding it there wouldsignificantly increase cardinality. Therefore, separate more focusedmetrics are introduced here:* `coderd_workspace_creation_duration_seconds`: Build time to create aworkspace (either a regular workspace or the build into a prebuild pool,for prebuild initial provisioning build).* `coderd_prebuilt_workspace_claim_duration_seconds`: Time to claim aprebuilt workspace from the pool.The reason for two separate histograms is that:* Creation (regular or prebuild): provisioning builds with similar timemagnitude, generally expected to take longer than a claim operation.* Claim: expected to be a much faster provisioning build.#### Native histogram usageProvisioning times vary widely between projects. Using static bucketsrisks unbalanced or poorly informative histograms.To address this, these metrics use [Prometheus nativehistograms](https://prometheus.io/docs/specs/native_histograms/):* First introduced in Prometheus v2.40.0* Recommended stable usage from v2.45+* Requires Go client `prometheus/client_golang` v1.15.0+* Experimental and must be explicitly enabled on the server(`--enable-feature=native-histograms`)For compatibility, we also retain a classic bucket definition (alignedwith the existing provisioner metric:https://github.com/coder/coder/blob/main/provisionerd/provisionerd.go#L182-L189).* If native histograms are enabled, Prometheus ingests thehigh-resolution histogram.* If not, it falls back to the predefined buckets.Implementation notes:* Unlike the counter, these histograms are updated in real-time atworkspace build job completion.* They reflect data only from the point of introduction forward (nohistorical backfill).## Relates toCloses:#19528Native histograms tested in observability stack:coder/observability#50(cherry picked from commit0ab345c)
…19601)Previously, if you had a new license that would start before the currentone fully expired, you would get a warning. Now, the license validityperiods are merged together, and a warning is only generated based onthe end of the current contiguous period of license coverage.Closes#19498(cherry picked from commit605dad8)
…ic (#19641)## DescriptionWhen creating a prebuilt workspace, both `flags.IsPrebuild` and`flags.IsFirstBuild` are true. Previously, the logic rejected cases withmultiple flags, so `coderd_workspace_creation_duration_seconds` wasn’tupdated for prebuilt creations. This is the only valid scenario wheretwo flags can be true.## Changes* Fix logic to update `coderd_workspace_creation_duration_seconds`metric for prebuilt workspaces.* Add prebuild helper functions to coderdenttest (other prebuild testscan reuse this).* Update workspace's provisionerdmetric tests to include this metric.Follow-up:#19503Related to:#19528(cherry picked from commit353f5de)
(cherry picked from commit6e55ed8)
- Removes GetManagedAgentCount query- Adds new table `usage_events_daily` which stores aggregated usageevents by the type and UTC day- Adds trigger to update the values in this table when a new row isinserted into `usage_events`- Adds a migration that adds `usage_events_daily` rows for existing datain `usage_events`- Adds tests for the trigger- Adds tests for the backfill query in the migrationSince the `usage_events` table is unreleased currently, this migrationwill do nothing on real deployments and will only affect previewdeployments such as dogfood.Closescoder/internal#943(cherry picked from commit39bf3ba)
Fixes#19671(re-?)Adds an audit log entry when an API key is created via `coderlogin`.NOTE: This does _not_ backfill audit logs.<img width="1354" height="207" alt="Screenshot 2025-09-02 at 14 16 24"src="https://github.com/user-attachments/assets/921e85c1-eced-4a19-9d37-8f84f4af1e73"/>(cherry picked from commitbd6e91e)
sreya approved these changesSep 2, 2025
0a73f84
intorelease/2.26 13 checks passed
Uh oh!
There was an error while loading.Please reload this page.
Sign up for freeto subscribe to this conversation on GitHub. Already have an account?Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading.Please reload this page.
https://www.notion.so/coderhq/Release-261d579be592801ea4ccc5fd72f3596a?showMoveTo=true&saveParent=true