### Install Dependencies and Start Development Server Source: https://github.com/madesroches/micromegas/blob/main/doc/high-frequency-observability/README.md Installs project dependencies and starts a local development server with hot reloading. Open http://localhost:5173 in your browser. ```bash yarn install yarn dev ``` -------------------------------- ### Grafana Plugin Quick Start Example Source: https://github.com/madesroches/micromegas/blob/main/tasks/completed/grafana_repo_merge/repository_merge_study.md Basic commands for getting started with the Micromegas Grafana Datasource Plugin, including dependency installation, development server startup, and building the plugin. ```bash # Install dependencies npm install # Start development npm run dev # Build plugin npm run build ``` -------------------------------- ### Update Getting Started README Yarn Installation Source: https://github.com/madesroches/micromegas/blob/main/tasks/completed/yarn4_migration_plan.md Change the Getting Started README to recommend 'corepack enable' for Yarn installation. ```markdown [Yarn](https://yarnpkg.com/) (`npm install -g yarn`) ``` ```markdown corepack enable ``` -------------------------------- ### Install Frontend Dependencies and Start Dev Server Source: https://github.com/madesroches/micromegas/blob/main/analytics-web-app/README.md Installs JavaScript dependencies using Yarn and starts the Vite development server for the frontend. The dev server proxies API requests to the backend. ```bash cd analytics-web-app yarn install yarn dev ``` -------------------------------- ### Build MkDocs Documentation Source: https://github.com/madesroches/micromegas/blob/main/mkdocs/docs/development/build.md Installs documentation dependencies, starts a local development server, and builds the static site for MkDocs. ```bash pip install -r mkdocs/docs-requirements.txt cd mkdocs mkdocs serve mkdocs build ``` -------------------------------- ### Install and Build Welcome App Source: https://github.com/madesroches/micromegas/blob/main/tasks/completed/yarn4_migration_plan.md Install dependencies and build the welcome application. ```bash cd welcome && yarn install && yarn build ``` -------------------------------- ### Current Grafana Plugin Setup Source: https://github.com/madesroches/micromegas/blob/main/tasks/completed/grafana_repo_merge/repository_merge_study.md Demonstrates the current multi-repository setup for the Grafana plugin, requiring separate clones and installations. ```bash # Current workflow - separate clone git clone https://github.com/madesroches/grafana-micromegas-datasource cd grafana-micromegas-datasource npm install go install github.com/magefile/mage npm run dev # Start webpack dev server docker compose up # Start local Grafana ``` -------------------------------- ### Documentation Build Setup and Execution Source: https://github.com/madesroches/micromegas/blob/main/tasks/completed/grafana_repo_merge/repository_merge_study.md Configures the Python environment for documentation builds, installs MkDocs and its requirements, and then builds the documentation strictly using the specified configuration file. ```yaml - uses: actions/checkout@v3 - uses: actions/setup-python@v4 with: python-version: '3.11' - name: Install MkDocs run: pip install -r mkdocs/requirements.txt - name: Build docs run: mkdocs build -f mkdocs/mkdocs.yml --strict ``` -------------------------------- ### Start Local PostgreSQL Instance Source: https://github.com/madesroches/micromegas/blob/main/doc/GETTING_STARTED.md Starts a local PostgreSQL database using Docker. This is required for both full local and hybrid setups. ```bash cd local_test_env/db ./run.py ``` -------------------------------- ### Python CI Setup and Execution Source: https://github.com/madesroches/micromegas/blob/main/tasks/completed/grafana_repo_merge/repository_merge_study.md Sets up the Python environment, installs Poetry for dependency management, and then installs project dependencies. It runs pytest for testing and checks code formatting with Black. ```yaml - uses: actions/checkout@v3 - uses: actions/setup-python@v4 with: python-version: '3.11' - name: Install Poetry run: curl -sSL https://install.python-poetry.org | python3 - - name: Install dependencies run: cd python/micromegas && poetry install - name: Run tests run: cd python/micromegas && poetry run pytest - name: Check formatting run: cd python/micromegas && poetry run black --check . ``` -------------------------------- ### Monorepo Unified Developer Setup Source: https://github.com/madesroches/micromegas/blob/main/tasks/completed/grafana_repo_merge/repository_merge_study.md Shows the streamlined setup process for the monorepo, involving a single clone and a setup script for dependencies and builds. ```bash # Single clone git clone https://github.com/madesroches/micromegas cd micromegas # One-time setup script ./scripts/setup-dev.sh # - Installs npm dependencies (npm install) # - Builds shared TypeScript packages # - Checks Rust toolchain (cargo --version) # - Checks Go toolchain (go version) # - Checks Python toolchain (poetry --version) # - Verifies Mage is installed # Work on Grafana plugin npm run dev:grafana # Hot reload for TypeScript # Mage rebuilds Go on file changes # docker compose up for local Grafana # Work on analytics web app npm run dev:web # Next.js dev server with hot reload # Work on Rust services cd rust && cargo build --workspace ``` -------------------------------- ### Clone Repository and Run Setup Script Source: https://github.com/madesroches/micromegas/blob/main/tasks/completed/grafana_repo_merge/repository_merge_study.md Initial setup for the Micromegas project. Clones the repository and executes a development setup script. ```bash git clone https://github.com/madesroches/micromegas cd micromegas ./scripts/setup-dev.sh ``` -------------------------------- ### Install and Serve MkDocs Locally Source: https://github.com/madesroches/micromegas/blob/main/tasks/completed/grafana_repo_merge/repository_merge_study.md Installs MkDocs and serves the documentation locally with auto-reloading for development. ```bash pip install -r mkdocs/requirements.txt mkdocs serve -f mkdocs/mkdocs.yml # Open browser to http://localhost:8000 ``` -------------------------------- ### Monorepo Development Setup Script Source: https://github.com/madesroches/micromegas/blob/main/tasks/completed/grafana_repo_merge/repository_merge_study.md The `setup-dev.sh` script automates the installation of prerequisites, dependencies, and builds for the monorepo development environment. ```bash #!/bin/bash set -e echo "🚀 Setting up Micromegas development environment..." # Check prerequisites command -v node >/dev/null 2>&1 || { echo "❌ Node.js not found. Install Node.js >= 16"; exit 1; } command -v cargo >/dev/null 2>&1 || { echo "❌ Rust not found. Install via rustup.rs"; exit 1; } command -v go >/dev/null 2>&1 || { echo "❌ Go not found. Install Go >= 1.22"; exit 1; } command -v poetry >/dev/null 2>&1 || { echo "⚠️ Poetry not found. Python development will be limited."; } # Install Mage if missing if ! command -v mage >/dev/null 2>&1; then echo "📦 Installing Mage..." go install github.com/magefile/mage@latest fi # Install npm dependencies echo "📦 Installing npm dependencies..." npm install # Build shared TypeScript packages echo "🔨 Building shared packages..." npm run build:shared # Check Rust workspace echo "🦀 Checking Rust workspace..." cd rust && cargo check --workspace && cd .. ``` -------------------------------- ### Build WASM Engine and Install wasm-bindgen CLI Source: https://github.com/madesroches/micromegas/blob/main/doc/GETTING_STARTED.md Installs the correct wasm-bindgen CLI version and builds the WASM binary. This is a prerequisite for the hybrid setup. ```bash rustup target add wasm32-unknown-unknown # Check the required wasm-bindgen version grep -A2 'name = "wasm-bindgen"' rust/datafusion-wasm/Cargo.lock | grep version # Install the matching version cargo install wasm-bindgen-cli --version # Build the WASM binary python3 rust/datafusion-wasm/build.py ``` -------------------------------- ### Rust CI Setup and Execution Source: https://github.com/madesroches/micromegas/blob/main/tasks/completed/grafana_repo_merge/repository_merge_study.md Configures the Rust CI environment, including toolchain installation, component setup (rustfmt, clippy), and caching for cargo registry, index, and build artifacts. It then executes the Rust CI script. ```yaml - uses: actions/checkout@v3 - uses: actions-rs/toolchain@v1 with: toolchain: stable components: rustfmt, clippy - name: Cache cargo registry uses: actions/cache@v3 with: path: ~/.cargo/registry key: ${{ runner.os }}-cargo-registry-${{ hashFiles('**/Cargo.lock') }} - name: Cache cargo index uses: actions/cache@v3 with: path: ~/.cargo/git key: ${{ runner.os }}-cargo-index-${{ hashFiles('**/Cargo.lock') }} - name: Cache cargo build uses: actions/cache@v3 with: path: rust/target key: ${{ runner.os }}-cargo-build-${{ hashFiles('**/Cargo.lock') }} - name: Run Rust CI run: cd rust && python3 ../build/rust_ci.py ``` -------------------------------- ### Verify micromegas-query setup Source: https://github.com/madesroches/micromegas/blob/main/claude-plugin/skills/micromegas-query/SKILL.md Run this command to verify that micromegas-query is installed and configured correctly. ```bash micromegas-query "SELECT 1" --begin 1h ``` -------------------------------- ### Install and Build Intro Micromegas Standalone Source: https://github.com/madesroches/micromegas/blob/main/tasks/completed/yarn4_migration_plan.md Install dependencies and build the standalone version of intro-micromegas. ```bash cd doc/intro-micromegas && yarn install && yarn build:standalone ``` -------------------------------- ### Install and Build Notebooks Standalone Source: https://github.com/madesroches/micromegas/blob/main/tasks/completed/yarn4_migration_plan.md Install dependencies and build the standalone version of notebooks. ```bash cd doc/notebooks && yarn install && yarn build:standalone ``` -------------------------------- ### Monorepo Structure and Quick Start Guide Source: https://github.com/madesroches/micromegas/blob/main/tasks/completed/grafana_repo_merge/repository_merge_study.md Provides an overview of the Micromegas monorepo structure, listing key directories and their associated technologies. Includes quick start commands for developing each component, detailing prerequisites like Node.js, Go, Rust, and Python versions. ```markdown ## Monorepo Structure This project uses a monorepo structure with multiple languages: - `grafana/` - Grafana datasource plugin (TypeScript + Go) - `typescript/` - Shared TypeScript packages and analytics web app - `rust/` - Rust services (FlightSQL server, ingestion, etc.) - `python/` - Python client library ## Quick Start by Component ### Grafana Plugin Prerequisites: Node.js 16+, Go 1.22+, Mage, Docker Commands: npm run dev:grafana docker compose up (in grafana/ directory) ### Analytics Web App Prerequisites: Node.js 16+ Commands: npm run dev:web ### Rust Services Prerequisites: Rust 1.70+ Commands: cd rust && cargo build --workspace ### Python Client Prerequisites: Python 3.8+, Poetry Commands: cd python/micromegas && poetry install ## Making Changes 1. Clone repository: `git clone https://github.com/madesroches/micromegas` 2. Run setup: `./scripts/setup-dev.sh` 3. Make changes in relevant directory 4. Test: `npm test` (TypeScript) or `cargo test` (Rust) 5. Format: `npm run lint` or `cargo fmt` 6. Submit PR ## Shared Packages When editing shared TypeScript types: 1. Edit in `typescript/types/src/` 2. Build: `npm run build --workspace=typescript/types` 3. Changes immediately available to grafana/ and analytics-web-app/ ``` -------------------------------- ### Current CLI Usage Example Source: https://github.com/madesroches/micromegas/blob/main/tasks/completed/sql_file_input_plan.md An example of how micromegas-query is used today with an inline SQL string. ```bash micromegas-query "SELECT * FROM log_entries LIMIT 10" --begin 1h ``` -------------------------------- ### Install and Build Unified Observability Standalone Source: https://github.com/madesroches/micromegas/blob/main/tasks/completed/yarn4_migration_plan.md Install dependencies and build the standalone version of unified-observability-for-games. ```bash cd doc/unified-observability-for-games && yarn install && yarn build:standalone ``` -------------------------------- ### Micromegas CLI: Initial Setup and Import Source: https://github.com/madesroches/micromegas/blob/main/tasks/completed/notebooks_as_code_plan.md Demonstrates the initial setup of screen tracking using the micromegas-screens CLI, including initializing the configuration and importing an existing notebook. ```bash # Initial setup — init creates the config file from git metadata mkdir screens && cd screens micromegas-screens init https://micromegas.example.com micromegas-screens import my-notebook performance-dashboard cd .. git add screens/ git commit -m "import screens" ``` -------------------------------- ### Replace npm install with Corepack setup Source: https://github.com/madesroches/micromegas/blob/main/tasks/completed/yarn4_migration_plan.md Replace the global npm installation of Yarn with a Corepack setup for system-wide consistency. ```shell corepack enable ``` -------------------------------- ### Implementation Steps for Presentation Setup Source: https://github.com/madesroches/micromegas/blob/main/tasks/completed/notebook_presentation_plan.md This list outlines the sequential steps required to implement the presentation setup. It covers scaffolding the project, writing content, capturing assets, testing, and building the final output. ```markdown 1. **Scaffold project**: Copy boilerplate files from `doc/unified-observability-for-games/` 2. **Write presentation.md**: The actual slide content following the outline above 3. **Write presentation-plan.md**: Speaker guide with demo script, key phrases, objection handling 4. **Capture screenshots**: Requires running analytics web app with real data — manual step 5. **Test**: `yarn dev` to preview, iterate on content 6. **Build**: `yarn build:standalone` for self-contained HTML ``` -------------------------------- ### Quick Start Development Server Source: https://github.com/madesroches/micromegas/blob/main/mkdocs/docs/admin/web-app.md Navigate to the web app directory and run the Python script to start the development server. The app will be accessible at http://localhost:3000. ```bash cd analytics-web-app python start_analytics_web.py ``` -------------------------------- ### Manual Jupyter Environment Setup - Install Micromegas Package Source: https://github.com/madesroches/micromegas/blob/main/python/notebooks/README.md Install the micromegas Python package in development mode. ```bash # Install micromegas package pip install -e ../micromegas ``` -------------------------------- ### Manual Jupyter Environment Setup - Install Dependencies Source: https://github.com/madesroches/micromegas/blob/main/python/notebooks/README.md Install the required Python packages for Jupyter and data analysis. ```bash # Install dependencies pip install jupyter jupyterlab pandas pyarrow numpy matplotlib seaborn plotly ``` -------------------------------- ### Example Migration from API Keys to OIDC Source: https://github.com/madesroches/micromegas/blob/main/mkdocs/docs/admin/authentication.md Demonstrates setting up OIDC configuration alongside existing API keys, and then removing API keys after migration. ```bash # Step 1: Add OIDC configuration (API keys still work) export MICROMEGAS_API_KEYS='[{"name": "service1", "key": "old-key"}]' export MICROMEGAS_OIDC_CONFIG='{ "issuers": [{ "issuer": "https://accounts.google.com", "audience": "new-client-id.apps.googleusercontent.com" }] }' # Step 2: Update clients to use OIDC # Test both authentication methods work # Step 3: Remove API keys when all clients migrated unset MICROMEGAS_API_KEYS # Only OIDC remains ``` -------------------------------- ### Polyrepo Developer Workflow: Publish and Install Types Source: https://github.com/madesroches/micromegas/blob/main/tasks/completed/grafana_repo_merge/repository_merge_study.md Steps to publish shared types and install them in another repository within a polyrepo setup. ```bash # 2. Publish types (or publish to npm verdaccio for testing) npm publish # 3. Switch to Grafana plugin repo cd ../grafana-micromegas-datasource npm install @micromegas/types@latest ``` -------------------------------- ### API Key Configuration Example Source: https://github.com/madesroches/micromegas/blob/main/tasks/completed/auth/analytics_auth_plan.md Example of how to configure API keys using an environment variable. This is a backward-compatible configuration method. ```bash # API Key Configuration (existing - backward compatible) MICROMEGAS_API_KEYS='[{"name": "service1", "key": "secret-key-123"}]' ``` -------------------------------- ### Install Specific wasm-bindgen-cli Version Source: https://github.com/madesroches/micromegas/blob/main/analytics-web-app/README.md Installs the exact version of wasm-bindgen-cli required by the project to ensure compatibility. This is crucial for the WASM engine setup. ```bash cargo install wasm-bindgen-cli --version 0.2.108 ``` -------------------------------- ### Start Analytics Web App with Remote Backend Source: https://github.com/madesroches/micromegas/blob/main/doc/GETTING_STARTED.md Starts the Rust backend for the analytics web app and the Vite dev server. This is used for the hybrid setup. ```bash cd analytics-web-app python3 start_analytics_web.py --remote-backend ``` -------------------------------- ### Polyrepo Version Matrix Example Source: https://github.com/madesroches/micromegas/blob/main/tasks/completed/grafana_repo_merge/repository_merge_study.md Demonstrates a version matrix showing plugin and shared type compatibility, highlighting the need for explicit documentation. ```text Plugin v0.1.0 → @micromegas/types@0.4.0 Plugin v0.1.1 → @micromegas/types@0.4.2 Plugin v0.2.0 → @micromegas/types@0.5.0 Plugin v0.2.1 → @micromegas/types@0.5.1 Q: Which type version does plugin v0.1.1 support? A: Need compatibility matrix documentation ``` -------------------------------- ### Monorepo Setup Script Source: https://github.com/madesroches/micromegas/blob/main/tasks/completed/grafana_repo_merge/repository_merge_study.md A bash script to automate the initial setup for developers contributing to a monorepo. It installs Node.js dependencies, builds shared packages, and checks the Rust environment. ```bash # scripts/setup.sh #!/bin/bash echo "Installing Node.js dependencies..." npm install echo "Building shared packages..." npm run build --workspace=grafana --workspace=typescript/* echo "Setup Rust environment..." cd rust && cargo check echo "Ready to develop!" ``` -------------------------------- ### Python Client Setup and Test Commands Source: https://github.com/madesroches/micromegas/blob/main/tasks/completed/grafana_repo_merge/repository_merge_study.md Commands for setting up, testing, and formatting the Python client using Poetry. ```bash cd python/micromegas # Install dependencies poetry install # Test poetry run pytest # Format poetry run black . ``` -------------------------------- ### GitHub Actions CI/CD deployment example Source: https://github.com/madesroches/micromegas/blob/main/mkdocs/docs/web-app/notebooks/screens-as-code.md Example GitHub Actions workflow to deploy micromegas screens. It checks out the code, installs micromegas, and applies the screen changes using environment variables for authentication. ```yaml # GitHub Actions example deploy-screens: runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 - run: pip install micromegas - run: | cd screens micromegas-screens apply --auto-approve env: MICROMEGAS_OIDC_ISSUER: ${{ secrets.OIDC_ISSUER }} MICROMEGAS_OIDC_CLIENT_ID: ${{ secrets.OIDC_CLIENT_ID }} MICROMEGAS_OIDC_CLIENT_SECRET: ${{ secrets.OIDC_CLIENT_SECRET }} ``` -------------------------------- ### Micromegas CLI: Adopting and Creating Screens Source: https://github.com/madesroches/micromegas/blob/main/tasks/completed/notebooks_as_code_plan.md Shows how to adopt a screen created in the web UI and how to create a brand new screen locally by defining its JSON configuration file. ```bash # Take ownership — first apply sets managed_by on the server micromegas-screens apply # Adopt a screen created in the web UI micromegas-screens import new-dashboard git add screens/new-dashboard.json git commit -m "track new-dashboard" # Create a brand new screen from scratch # Just create the .json file locally — plan/apply will create it on the server echo '{"name": "my-new-notebook", "screen_type": "notebook", "config": {...}}' > screens/my-new-notebook.json ``` -------------------------------- ### Quick Start Analytics Web App Source: https://github.com/madesroches/micromegas/blob/main/CLAUDE.md Starts both the backend and frontend for the Analytics Web App. Run this command from the project root. ```bash ./start_analytics_web.py ``` -------------------------------- ### Start Micromegas Daemon Source: https://github.com/madesroches/micromegas/blob/main/doc/GETTING_STARTED.md Runs the telemetry admin daemon locally. This is part of the full local stack setup. ```bash cd rust cargo run -p telemetry-admin -- crond ``` -------------------------------- ### Start Micromegas FlightSQL Server Source: https://github.com/madesroches/micromegas/blob/main/doc/GETTING_STARTED.md Runs the FlightSQL server locally. This is part of the full local stack setup. ```bash cd rust cargo run -p flight-sql-srv -- --disable-auth ``` -------------------------------- ### Listing Available Partitions Source: https://github.com/madesroches/micromegas/blob/main/doc/how_to_query/README.md Demonstrates how to use the 'list_partitions' function to retrieve a list of all available partitions in the data lake, including details like view set name, instance ID, and file path. ```sql SELECT * FROM list_partitions() ``` -------------------------------- ### Set Environment Variables for Development Setup Source: https://github.com/madesroches/micromegas/blob/main/mkdocs/docs/unreal/installation.md Define environment variables to specify the root directory of your Unreal Engine installation and the directory where your project's plugins are located. This is part of the development setup for using hard links. ```batch set MICROMEGAS_UNREAL_ROOT_DIR=C:\Program Files\Epic Games\UE_5.3 set MICROMEGAS_UNREAL_TELEMETRY_MODULE_DIR=C:\YourProject\Plugins ``` -------------------------------- ### Current Micromegas Repository Setup Source: https://github.com/madesroches/micromegas/blob/main/tasks/completed/grafana_repo_merge/repository_merge_study.md Illustrates the current setup for the Micromegas repository, including separate steps for Rust, Python, and the analytics web app. ```bash # Current workflow - separate clone git clone https://github.com/madesroches/micromegas cd micromegas # Rust development cd rust && cargo build # Python development cd python/micromegas && poetry install # Analytics web app cd analytics-web-app && npm install && npm run dev ``` -------------------------------- ### Get All Processes from Last Day Source: https://github.com/madesroches/micromegas/blob/main/mkdocs/docs/query-guide/schema-reference.md Retrieves process metadata including ID, executable name, computer, and start time for processes initiated within the last 24 hours. Results are ordered by start time in descending order. ```sql SELECT process_id, exe, computer, start_time FROM processes WHERE start_time >= NOW() - INTERVAL '1 day' ORDER BY start_time DESC; ``` -------------------------------- ### Initialize Screens Directory and Config Source: https://github.com/madesroches/micromegas/blob/main/tasks/completed/notebooks_as_code_plan.md Initializes the screens directory and creates a configuration file. Must be run inside a git repository and requires a server URL. ```bash cd screens micromegas-screens init https://micromegas.example.com ``` -------------------------------- ### Example: Partition Regrouping With Empty Partition Support Source: https://github.com/madesroches/micromegas/blob/main/tasks/completed/empty_lakehouse_partitions.md Demonstrates how explicitly marking empty partitions with zero rows and no file path resolves ambiguity, enabling safe merging into daily partitions. ```text 2024-01-15 00:00 → partition exists (100 rows) 2024-01-15 01:00 → partition exists (0 rows, file_path=None) ✅ Explicitly empty! 2024-01-15 02:00 → partition exists (50 rows) 2024-01-15 03:00 → partition exists (0 rows, file_path=None) ✅ Explicitly empty! ... 2024-01-15 23:00 → partition exists (200 rows) Result: Can safely merge all 24 hourly partitions into 1 daily partition! ``` -------------------------------- ### Start Micromegas Ingestion Server Source: https://github.com/madesroches/micromegas/blob/main/doc/GETTING_STARTED.md Runs the telemetry ingestion service locally. This is part of the full local stack setup. ```bash cd rust cargo run -p telemetry-ingestion-srv -- --listen-endpoint-http 127.0.0.1:9000 ``` -------------------------------- ### Flight SQL Server Builder Usage Example Source: https://github.com/madesroches/micromegas/blob/main/tasks/completed/flightsql_server_builder_plan.md Demonstrates how to use the FlightSqlServer builder in a Rust application to configure and start the server, including optional authentication. ```rust #[derive(Parser, Debug)] #[clap(name = "Micromegas FlightSQL server")] #[clap(about = "Micromegas FlightSQL server", version, author)] struct Cli { #[clap(long)] disable_auth: bool, } #[micromegas_main(interop_max_level = "info", max_level_override = "debug")] async fn main() -> Result<(), Box> { let args = Cli::parse(); let mut builder = FlightSqlServer::builder() .with_static_tables_env_var("MICROMEGAS_STATIC_TABLES_URL"); if !args.disable_auth { builder = builder.with_default_auth(); } builder.build_and_serve().await?; Ok(()) } ``` -------------------------------- ### Initialize screens directory Source: https://github.com/madesroches/micromegas/blob/main/mkdocs/docs/web-app/notebooks/screens-as-code.md Create a directory for screens and initialize it with the server URL. This command must be run inside a git repository. ```bash mkdir screens && cd screens micromegas-screens init https://micromegas.example.com ``` -------------------------------- ### Manual Jupyter Environment Setup - Activate Virtual Environment Source: https://github.com/madesroches/micromegas/blob/main/python/notebooks/README.md Activate the created virtual environment. Use the appropriate command for your operating system. ```bash # Activate it source jupyter_env/bin/activate # Linux/Mac # or jupyter_env\Scripts\activate # Windows ``` -------------------------------- ### Placeholder Message for No Selection Source: https://github.com/madesroches/micromegas/blob/main/tasks/completed/row_select/mockup_notebook_workflow.html This example shows a placeholder message displayed when no row is selected in the upstream 'processes' table. It guides the user on how to enable downstream cell content. ```markdown 👉 Select a row in **processes** to view logs This cell uses $processes.selected.process_id ``` -------------------------------- ### Quick Test Script for Auth0 Authentication Source: https://github.com/madesroches/micromegas/blob/main/tasks/completed/auth/AUTH0_TEST_GUIDE.md A bash script to automate the setup and testing of Auth0 authentication. It configures environment variables, starts services, and runs the client test script. ```bash #!/bin/bash # test_auth0.sh # Auth0 configuration export AUTH0_DOMAIN="yourname-dev.auth0.com" export AUTH0_CLIENT_ID="your-client-id" # Configure OIDC export OIDC_ISSUER="https://${AUTH0_DOMAIN}/" export OIDC_CLIENT_ID="${AUTH0_CLIENT_ID}" # Configure server export MICROMEGAS_OIDC_CONFIG='{ "issuers": [ { "issuer": "https://'${AUTH0_DOMAIN}'/", "audience": "'${AUTH0_CLIENT_ID}'" } ] }' # Start services cd /home/mad/micromegas python3 local_test_env/ai_scripts/start_services_with_oidc.py # Wait for services to start sleep 3 # Test authentication python3 local_test_env/ai_scripts/test_oidc_auth.py ``` -------------------------------- ### Update Documentation for Yarn Usage Source: https://github.com/madesroches/micromegas/blob/main/tasks/completed/yarn4_migration_plan.md Updates README files and contributing guides to reflect the use of Yarn 4 (Berry) installed via Corepack, replacing older npm-based instructions. ```markdown Yarn 4 (Berry) — installed via corepack enable ``` -------------------------------- ### Start Grafana Plugin Test Server Source: https://github.com/madesroches/micromegas/blob/main/CLAUDE.md Starts a local Grafana server with the plugin for testing. Run this command from the `grafana/` directory. ```bash yarn server ``` -------------------------------- ### TypeScript CI Setup and Execution Source: https://github.com/madesroches/micromegas/blob/main/tasks/completed/grafana_repo_merge/repository_merge_study.md Sets up the Node.js environment for TypeScript projects, including version configuration and npm caching. It then proceeds to install dependencies, build shared packages, typecheck, lint, and test all workspaces. ```yaml - uses: actions/checkout@v3 - uses: actions/setup-node@v3 with: node-version: '18' cache: 'npm' - name: Install dependencies run: npm ci - name: Build shared packages run: npm run build:shared - name: Typecheck all workspaces run: npm run typecheck --workspaces - name: Lint all workspaces run: npm run lint --workspaces - name: Test all workspaces run: npm test --workspaces --if-present ``` -------------------------------- ### Initialize screens directory configuration Source: https://github.com/madesroches/micromegas/blob/main/mkdocs/docs/web-app/notebooks/screens-as-code.md The `init` command creates a `micromegas-screens.json` file containing the server URL and a `managed_by` link derived from the git remote. ```json { "managed_by": "https://github.com/org/repo/tree/main/screens", "server": "https://micromegas.example.com" } ``` -------------------------------- ### Example URL with Time Range Parameters Source: https://github.com/madesroches/micromegas/blob/main/mkdocs/docs/web-app/index.md Demonstrates how to specify a time range using URL parameters. This allows for sharing specific views of the data. ```url /screen/my-dashboard?from=now-1h&to=now ``` -------------------------------- ### Rust Client with API Key End-to-End Test Setup Source: https://github.com/madesroches/micromegas/blob/main/tasks/completed/auth/ingestion_auth_plan.md Sets up environment variables and starts the ingestion server for end-to-end testing with a Rust client using ApiKeyRequestDecorator. This scenario requires updating test binaries to correctly use the decorator. ```bash # Set API key for Rust client export MICROMEGAS_INGESTION_API_KEY="secret123" export MICROMEGAS_API_KEYS='[{"name":"test","key":"secret123"}]' # Start ingestion server with auth telemetry-ingestion-srv & # Run test program that uses HttpEventSink with ApiKeyRequestDecorator # (requires updating telemetry-generator or similar test binary) cargo run --bin telemetry-generator # Verify telemetry is ingested successfully # Check server logs for authentication messages ``` -------------------------------- ### Get Process Lifetime with Micromegas Query Source: https://github.com/madesroches/micromegas/blob/main/claude-plugin/skills/micromegas-query/SKILL.md Use this command to retrieve the process ID, start time, and last update time from the 'processes' table for a specific process ID. The `--begin 1d` flag is a placeholder and should be adjusted based on expected process duration. ```bash micromegas-query "SELECT process_id, start_time, last_update_time FROM processes WHERE process_id = '' LIMIT 1" --begin 1d ``` -------------------------------- ### Nx nx.json configuration example Source: https://github.com/madesroches/micromegas/blob/main/tasks/completed/grafana_repo_merge/repository_merge_study.md Shows a basic nx.json configuration for Nx, defining task runner options and project tags for a monorepo. ```json // nx.json { "tasksRunnerOptions": { "default": { "runner": "@nrwl/workspace/tasks-runners/default", "options": { "cacheableOperations": ["build", "test", "lint"] } } }, "projects": { "grafana": { "tags": ["type:app", "scope:grafana"] }, "typescript-types": { "tags": ["type:lib", "scope:shared"] } } } ```