Remove Warp cloud features and OpenTelemetry
Settings cleanup: - Remove billing_and_usage, main_page, referrals_page, show_blocks_view, environments_page, handoff_environment_creation_modal, custom_inference_modal, remove_custom_endpoint_confirmation_dialog, transfer_ownership_confirmation_modal, delete_environment_confirmation_dialog - Remove SettingsSection variants: Account, BillingAndUsage, Referrals, SharedBlocks, CloudEnvironments, OzCloudAPIKeys - Remove SettingsPageViewHandle variants: Main, BillingAndUsage, Referrals, CloudEnvironments, OzCloudAPIKeys, SharedBlocks - Add Platform variant for PlatformPageView - Gut custom inference endpoint UI from ai_page.rs - Gut transfer ownership modal from teams_page.rs - Stub environment_management_pane as dead code - Remove create_discount_badge usage - Remove handle_experiment_change call OpenTelemetry removal: - Remove opentelemetry, opentelemetry-http, opentelemetry-otlp, opentelemetry_sdk, tracing-opentelemetry dependencies - Replace tracing module with no-op stub - Delete native.rs and cloud_agent_auth.rs Bug fixes (prior work): - Fix apply_diffs() to use markdown_unescaped(ctx) - Fix notebook executor AIDocumentId handling - Fix margin/corner-radius consistency in requested_command.rs - Add document tool handlers to extract_tool_result_content() - Fix deprecated from_byte_stream in MCP SSE transport - Fix Cargo.toml profile package spec - Upgrade rust-toolchain to 1.94.1
This commit is contained in:
+7
-79
@@ -1,102 +1,30 @@
|
||||
#[cfg(not(target_family = "wasm"))]
|
||||
use std::time::Duration;
|
||||
|
||||
use tracing::subscriber;
|
||||
|
||||
#[cfg(not(target_family = "wasm"))]
|
||||
mod cloud_agent_auth;
|
||||
#[cfg(not(target_family = "wasm"))]
|
||||
mod native;
|
||||
|
||||
#[cfg(not(target_family = "wasm"))]
|
||||
const DEFAULT_EXPORT_TIMEOUT: Duration = Duration::from_secs(10);
|
||||
|
||||
pub fn init() -> anyhow::Result<Initialization> {
|
||||
#[cfg(target_family = "wasm")]
|
||||
{
|
||||
install_no_subscriber()?;
|
||||
Ok(Initialization::default())
|
||||
}
|
||||
|
||||
#[cfg(not(target_family = "wasm"))]
|
||||
native::init()
|
||||
subscriber::set_global_default(subscriber::NoSubscriber::new())?;
|
||||
Ok(Initialization::default())
|
||||
}
|
||||
|
||||
#[cfg(not(target_family = "wasm"))]
|
||||
/// Starts cloud-agent trace credential refresh after authenticated application services exist.
|
||||
///
|
||||
/// The exporter and dispatch credential are initialized earlier by [`init`]. This later lifecycle
|
||||
/// hook supplies the authenticated managed-secrets client needed to mint replacements without
|
||||
/// broadening tracing initialization to ordinary application processes.
|
||||
pub fn start_auth_refresh(
|
||||
client: std::sync::Arc<dyn warp_managed_secrets::client::ManagedSecretsClient>,
|
||||
ctx: &mut warpui::AppContext,
|
||||
_client: std::sync::Arc<dyn warp_managed_secrets::client::ManagedSecretsClient>,
|
||||
_ctx: &mut warpui::AppContext,
|
||||
) {
|
||||
native::start_auth_refresh(client, ctx);
|
||||
}
|
||||
|
||||
fn install_no_subscriber() -> anyhow::Result<()> {
|
||||
// Configure the global tracing subscriber to not care about any spans or
|
||||
// events.
|
||||
//
|
||||
// This is done so that we prevent the `tracing` crate from writing out log
|
||||
// lines for spans and trace events.
|
||||
subscriber::set_global_default(subscriber::NoSubscriber::new())?;
|
||||
Ok(())
|
||||
}
|
||||
|
||||
#[cfg_attr(target_family = "wasm", derive(Default))]
|
||||
#[derive(Default)]
|
||||
pub struct Initialization {
|
||||
initialization_warning: Option<anyhow::Error>,
|
||||
#[cfg(not(target_family = "wasm"))]
|
||||
active_spans: Option<native::ActiveSpanRegistry>,
|
||||
#[cfg(not(target_family = "wasm"))]
|
||||
provider: Option<opentelemetry_sdk::trace::SdkTracerProvider>,
|
||||
#[cfg(not(target_family = "wasm"))]
|
||||
shutdown_timeout: std::time::Duration,
|
||||
}
|
||||
|
||||
#[cfg(not(target_family = "wasm"))]
|
||||
impl Default for Initialization {
|
||||
fn default() -> Self {
|
||||
Self {
|
||||
initialization_warning: None,
|
||||
active_spans: None,
|
||||
provider: None,
|
||||
shutdown_timeout: DEFAULT_EXPORT_TIMEOUT,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
impl Initialization {
|
||||
pub fn log_initialization_warning(&mut self) {
|
||||
if let Some(err) = self.initialization_warning.take() {
|
||||
log::warn!("Failed to initialize cloud-agent OpenTelemetry exporting: {err:#}");
|
||||
log::warn!("Tracing initialization warning: {err:#}");
|
||||
}
|
||||
}
|
||||
|
||||
pub(crate) fn shutdown(&mut self) {
|
||||
#[cfg(not(target_family = "wasm"))]
|
||||
{
|
||||
match (self.active_spans.take(), self.provider.take()) {
|
||||
(Some(active_spans), Some(provider)) => {
|
||||
if let Err(err) = active_spans.shutdown(&provider, self.shutdown_timeout) {
|
||||
log::warn!(
|
||||
"Failed to shut down cloud-agent OpenTelemetry exporting: {err}"
|
||||
);
|
||||
}
|
||||
}
|
||||
(None, Some(provider)) => {
|
||||
if let Err(err) = provider.shutdown_with_timeout(self.shutdown_timeout) {
|
||||
log::warn!(
|
||||
"Failed to shut down cloud-agent OpenTelemetry exporting: {err}"
|
||||
);
|
||||
}
|
||||
}
|
||||
(Some(_), None) | (None, None) => {}
|
||||
}
|
||||
}
|
||||
}
|
||||
pub(crate) fn shutdown(&mut self) {}
|
||||
}
|
||||
|
||||
impl Drop for Initialization {
|
||||
|
||||
Reference in New Issue
Block a user