Mito
Mito for Streamlit
  • Mito Documentation
  • Getting Started
    • Installing Mito
      • Fixing Common Install Errors
      • Installing Mito in a Docker Container
      • Installing Mito for Streamlit
      • Installing Mito for Dash
      • Installing Mito in a Jupyter Notebook Directly
      • Installing Mito in Vertex AI
      • Setting Up a Virtual Environment
  • Data Copilot
    • Data Copilot Core Concepts
    • Agent
    • Chat
    • Autocomplete
    • Smart Debugging
    • Configuration Options
    • Database Connectors
    • AI Data Usage FAQ
  • Apps (Beta)
    • Mito Apps
  • Mito Spreadsheet
    • Core Concepts
    • Creating a Mitosheet
      • Open Existing Virtual Environments
    • Importing Data
      • Importing CSV Files
      • Importing from Excel Files
      • Importing Dataframes
      • Importing from a remote drive
      • Import: Generated UI from any Python Function
      • Importing from other sources
    • Graphing
      • Graph Creation
      • Graph Styling
      • Graph Export
    • Pivoting/Group By
    • Filter
      • Filter By Condition
      • Filter By Value
    • Mito AI
    • Summary Statistics
    • Type Changes
    • Spreadsheet Formulas
      • Custom Spreadsheet Functions
      • Formula Reference
      • Using VLOOKUP
    • Editing Individual Cells
    • Combining Dataframes
      • Merge (horizontal)
      • Concatenate (horizontal)
      • Anti-merge (unique)
    • Sort Data
    • Split Text to Columns
    • Deleting Columns
    • Deleting Rows
    • Column Headers
      • Editing Column Headers
      • Promote Row to Header
    • Deduplicate
    • Fill NaN Values
    • Transpose
    • Reset Index
    • Unpivot a Dataframe (Melt)
    • Formatting
      • Column Formatting
      • Dataframe Colors
      • Conditional Formatting
    • Exporting Data
      • Download as CSV
      • Download as Excel
      • Generate code to create Excel and CSV reports
    • Using the Generated Code
      • Turn generated code into functions
    • Changing Imported Data
    • Code Snippets
    • Custom Editors: Autogenerate UI from Any Function
    • Find and Replace
    • Bulk column header edits
    • Code Options
    • Scheduling your Automation
    • Keyboard Shortcuts
    • Upgrading Mito
    • Enterprise Logging
  • Mito for Streamlit
    • Getting Started with Mito for Streamlit
    • Streamlit Overview
    • Create a Mito for Streamlit App
    • API Reference
      • Understanding import_folder
      • RunnableAnalysis class
      • Column Definitions
    • Streamlit App Gallery
    • Experienced Streamlit Users
    • Common Design Patterns
      • Deploying Mito for Streamlit in a Docker Image
      • Using Mito for Final Mile Data Cleaning
  • Mito for Dash
    • Getting Started
    • Dash Overview
    • Your First Dash App with Mito
    • Mito vs. Other Dash Components
    • API Reference
      • Understanding import_folder
    • Dash App Gallery
    • Common Design Patterns
      • Refresh Sheet Data Periodically
      • Change Sheet Data from a Select
      • Filter Other Elements to Data Selected in Mito
      • Graph New Data after Edits to Mito
      • Set Mito Spreadsheet Theme
  • Tutorials
    • Pass a dataframe into Mito
    • Create a line chart of time series data
    • Delete Columns with Missing Values
    • Split a column on delimiter
    • Rerun analysis on new data
    • Calculate the difference between rows
    • Calculate each cell's percent total of column
    • Import multiple tables from one Excel sheet
    • Share Mito Spreadsheets Across Users
  • Misc
    • Release Notes
      • May 28 - Just a Query Away
      • April 15 - Now Streaming (0.1.18)
      • March 21 - Smarter, Faster, Stronger Agents
      • February 25 - Agent Mode QoL Improvements
      • February 18 - Mito Agents
      • January 2nd - Inline Completions Arrive
      • December 6th - Smarter Workflow
      • November 27th - @ Mentions, Mito AI Server
      • November 4th, 2024 - Hello Mito AI
      • October 8, 2024 - JupyterLab 4
      • Aug 29th, 2024
      • June 12, 2024
      • March 19, 2024
      • March 13th, 2024
      • February 12th, 2024: Graphing Improvements
      • January 25th, 2024
      • January 5th, 2023: Keyboard Shortcuts
      • December 6, 2023: New Context Menu
      • November 28, 2023: Mito's New Toolbar
      • November 7, 2023: Multiplayer Dash
      • October 23, 2023: RunnableAnalysis class
      • October 16, 2023: Mito for Dash, Custom Editors
      • September 29, 2023: VLOOKUP and Find and Replace!
      • September 7, 2023
      • August 2, 2023: Mito for Streamlit!
      • July 10, 2023
      • May 31, 2023: Mito AI Recon
      • May 19, 2023: Mito AI Chat!
      • April 27, 2023: Generate Functions, Performance improvements, bulk column header transformations
      • April 18, 2023: Cell Editor Improvements, BYO Large Language Model, and more
      • April 10, 2023: AI Access, Excel-like Cell Editor, Performance Improvements
      • April 5, 2023: Range formulas, Pandas 2.0, Snowflake Views
      • March 29, 2023: Excel Range Import Improvements
      • March 14, 2023: Mito AI, Public Interface Versioning
      • February 28, 2023: In-place Pivot Errors
      • February 7, 2023: Excel-like Formulas, Snowflake Import
      • January 23, 2023: Excel range importing
      • January 8, 2023: Custom Code snippets
      • December 26, 2022: Code snippets and bug fixes
      • December 12, 2022: Group Dates in Pivot Tables, Reduced Dependencies
      • November 15, 2022: Filter in Pivot
      • November 9, 2022: Import and Enterprise Config
      • October 31, 2022: Replay Analysis Improvements
      • Old Release Notes
      • August 10, 2023: Export Formatting to Excel
    • Mito Enterprise Features
    • FAQ
    • Terms of Service
    • Privacy Policy
  • Mito
Powered by GitBook

© Mito

On this page
  • Why is Mito Enterprise Logging Useful?
  • Collecting Mito Enterprise Logs
  • Setting up your log server
  • Connecting Mito to your log server
  • Logs Generated by Mito Enterprise
  • Mito Usage Events
  • Mito Analysis Events
  • Errors
  • Error Severity Codes
  • Example Logs
  • Debugging your logging configuration

Was this helpful?

  1. Mito Spreadsheet

Enterprise Logging

Connect Mito to your internal logging servers so you can track Python retention at your firm.

PreviousUpgrading MitoNextGetting Started with Mito for Streamlit

Last updated 10 months ago

Was this helpful?

Collecting Mito Enterprise Logs requires a .

Why is Mito Enterprise Logging Useful?

Python adoption is often a black box at large enterprises. You might know who has access to Python or even how often they log in to a Python environment like JupyterHub, but you probably don't know for which users their Python code is delivering business value.

Mito Enterprise Logging is designed to help you gain visibility into Python retention at your firm. The logs are designed to help you calculate metrics like:

  • Monthly Active Users of Mito

  • The top 100 most active Mito power users at your firm

  • The teams that have not yet adopted Python and require additional support

  • The most commonly used Mito features at your firm

  • The top 10 most common errors that users were blocked by

Metrics like these open the black box of Python adoption at your firm and make it easy to evaluate and communicate the success of Python automations.

Collecting Mito Enterprise Logs

Collecting Mito Enterprise Logs requires a .

Setting up your log server

Mito is agnostic to the logging infrastructure that you use. Common log monitoring platforms include , , and .

To get the most out of the logs that Mito generates, it may be useful to supplement the logs Mito generates with additional information about each user. For example: username, operating system, browser, environment, etc.

Connecting Mito to your log server

To collect logs, you must set the following environment variables in your user's Python environment:

MITO_CONFIG_VERSION='2'
MITO_CONFIG_LOG_SERVER_URL='https://url/of/log/server'
MITO_CONFIG_LOG_SERVER_BATCH_INTERVAL='<number of seconds between log uploads>'

Once configured, Mito will upload logs to the server:

  1. In a batched manner. This reduces the burden on your log server.

  2. The logs will upload at fixed time intervals, specified by MITO_CONFIG_LOG_SERVER_BATCH_INTERVAL. If no batch interval is provided, logs will be uploaded every 10 seconds by default.

  3. From a separate thread than the main Mito processing thread. This ensures that log collection has a minimal effect on your users' experience.

  4. If log upload fails:

    1. No logs will be lost. Logs will be saved and tried again on the next upload attempt.

    2. An exponential backoff strategy is used, so upload will be retried with double the batch interval. This exponential backoff strategy avoids overburdening the server.

Together, the above mean that logs may sometimes be dropped, especially if the Python process Mito is running in is terminated unexpectedly.

Logs Generated by Mito Enterprise

Mito Usage Events

Log Event
Description

mitosheet_rendered

A new or existing Mito spreadsheet was created

Mito Analysis Events

Data Import and Export Events

Log Event
Description

excel_import_edit

At least one sheet from an Excel workbook was imported

excel_range_import_edit

A range from an Excel worksheet was imported using either dynamic or static range detection

simple_import_edit

A CSV file was imported

dataframe_import_edit

A dataframe that was defined in the Jupyter notebook was imported using the Import Dataframe Taskpane

export_to_file_edit

Data in Mito was exported to a CSV or Excel file

Data Transformation Events

Log Event
Description

pivot_edit

A pivot table was created or updated

filter_column_edit

A column filter was applied or updated

sort_edit

The dataframe was sorted by a column

change_column_dtype_edit

A column's data type was changed

merge_edit

Two dataframes were merged together or an existing merge was updated

concat_edit

Dataframes were vertically concatonated on top of eachother to creatre a new dataframe

delete_column_edit

A column(s) were deleted

rename_column_edit

A column was renamed

add_column_edit

A column was added to the dataframe

set_column_formula_edit

A formula was created or updated

reorder_column_edit

A column's order in the dataframe was changed

fill_na_edit

NaN values were filled using the FillNaN Taskpane

delete_row_edit

A row(s) were deleted

drop_duplicates_edit

Duplicate values were removed from the dataframe using the Drop Duplicates Taskpane

split_text_to_columns_edit

A column was split on a delimiter into multiple columns using the Split Text to Columns Taskpane

promote_row_to_header_edit

A row was promoted to the header row

melt_edit

A dataframe was melted (unpivoted)

reset_index_edit

The dataframe's indexes were reset to the standard 0, 1, ... N

transpose_edit

A dataframe was transposed

dataframe_delete_edit

A dataframe was deleted

dataframe_duplicate_edit

A dataframes was duplicated

dataframe_rename_edit

A dataframe was renamed

Formatting Events

Log Event
Description

change_column_format_edit

A column had its format changed. Ie: From plain text to accounting format

set_dataframe_format_edit

A conditional formatting or dataframe color scheme was updated.

Graphing Events

Log Event
Description

graph_edit

A graph was created or an existing graph had it's configuration updated. For example, a bar chart was changed to a line chart.

graph_delete_edit

A graph was deleted

graph_rename_edit

A graph was renamed

Errors

Log Event
Description

error

All errors in Mito generate an error log event that contains useful information like the error traceback needed to identify and correct a bug. Use the log param params_failed_log_event to identify which event caused the error. For easy triaging, errors are tagged with an error_severity_code.

frontend_render_failed

The Mito Spreadsheet has completely crashed. This is the most severe error.

Error Severity Codes

Error Category
Error Severity Code

Likely just a warning

0

Likely user error

10

Likely inconsequential error

11

Likely Mito Bug

20

Unable to import Data

21

Unable to replay analysis

22

Mito Crashed

50

Misc. (unexpected errors)

-1

Example Logs

To help you understand the logs that Mito generates, below is a video of a short Mito session accompanied with the logs generated by that session. In this session the user:

  1. Renders a Mito spreadsheet

  2. Adds a column to the end of the dataframe

  3. Renames the new column to New Column

  4. Writes a spreadsheet formula, =LEFT(Last Name0, 2) to get the first two letters from the Last Name column

  5. Generates an error by attempting to create a duplicate column header

[
    {
        "event": "mitosheet_rendered",
        "params_user_agent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/17.2.1 Safari/605.1.15", 
        "version_python": "3.9.6", 
        "version_pandas": "2.1.2", 
        "version_mito": "0.3.131", 
        "timestamp_gmt": "2024-01-25T23:07:59Z"
    }, 
    {
        "event": "add_column_edit",
        "params_sheet_index": 0, 
        "params_column_header": "childworldfall", 
        "params_column_header_index": 5, 
        "params_public_interface_version": 3, 
        "version_python": "3.9.6", 
        "version_pandas": "2.1.2", 
        "version_mito": "0.3.131", 
        "timestamp_gmt": "2024-01-25T23:08:03Z" 
    }, 
    {
        "event": "rename_column_edit",
        "params_sheet_index": 0, 
        "params_column_id": "childworldfall", 
        "params_new_column_header": "personpersonhat", 
        "params_public_interface_version": 3, 
        "version_python": "3.9.6", 
        "version_pandas": "2.1.2", 
        "version_mito": "0.3.131", 
        "timestamp_gmt": "2024-01-25T23:08:07Z", 
    }, 
    {
        "event": "set_column_formula_edit",
        "params_sheet_index": 0, 
        "params_column_id": "childworldfall", 
        "params_formula_label": "workfallpoint", 
        "params_new_formula": "=LEFT(companypartcaseI[workfallpoint], 2)", 
        "params_index_labels_formula_is_applied_to": {"type": "timepartcase"}, 
        "params_cell_editor_location": "cell", 
        "params_public_interface_version": 3, 
        "version_python": "3.9.6", 
        "version_pandas": "2.1.2", 
        "version_mito": "0.3.131", 
        "timestamp_gmt": "2024-01-25T23:08:14Z"
    }, 
    {
        "event": "error"
        "error_severity_code": "10",
        "params_failed_log_event": "rename_column_edit_failed",
        "params_sheet_index": 0, 
        "params_column_id": "womancasepoint", 
        "params_new_column_header": "timedogcase", 
        "params_public_interface_version": 3, 
        "error_traceback": [
            "Traceback (most recent call last):", "  File 'mito_backend.py', line 253, in receive_message", 
            "    self.handle_edit_event(event)", 
            "    File 'mito_backend.py', line 178, in handle_edit_event", 
            "    self.steps_manager.handle_edit_event(event)", 
            "    File 'steps_manager.py', line 523, in handle_edit_event", 
            "    self.execute_and_update_steps(new_steps)", 
            "    File 'steps_manager.py', line 745, in execute_and_update_steps", 
            "    final_steps = execute_step_list_from_index(", "  File 'steps_manager.py', line 101, in execute_step_list_from_index", 
            "    new_step.set_prev_state_and_execute(last_valid_step.final_defined_state, non_skipped_steps)", 
            "    File 'step.py', line 154, in set_prev_state_and_execute", 
            "    post_state_and_execution_data = self.step_performer.execute(new_prev_state, params)", 
            "    File 'rename_column.py', line 42, in execute", 
            "    raise make_column_exists_error(new_column_header)", 
            "    mitosheet.errors.MitoError: (column_exists_error, Column Already Exists, Sorry, a column already exists with the name application sign date. Try picking a different name!)"
        ], 
        "error_traceback_last_line": "mitosheet.errors.MitoError: (column_exists_error, Column Already Exists, Sorry, a column already exists with the name application sign date. Try picking a different name!\)", 
        "version_python": "3.9.6", 
        "version_pandas": "2.1.2", 
        "version_mito": "0.3.131", 
        "timestamp_gmt": "2024-01-25T23:08:20Z", 
    }
]

Debugging your logging configuration

If Mito is unable to upload logs, it will generate useful errors.

To see the logs in JupyterLab, click on View > Show Log Console , and inside of the log console, change the Log Level from Warning to Debug.

For example, with the following invalid enterprise logging configuration, you should see the following error messages:

import os 
os.environ['MITO_CONFIG_VERSION'] = '2'
os.environ['MITO_CONFIG_LOG_SERVER_URL'] = 'https://invalid-url'
Mito Enterprise License
Mito Enterprise License
Datadog
Mixpanel
Amplitude