Use metadata effectively to organize, filter, and analyze your monitoring data
Metadata is additional structured data you can attach to each job run. It helps you:
from seerpy import SEER
seer = SEER(api_key="your_api_key")
try:
# Process data
data = load_data("customers.csv")
results = process_data(data)
# Send success with metadata
seer.success(
metadata={
"records_processed": len(data),
"records_output": len(results),
"source_file": "customers.csv",
"environment": "production",
"data_date": "2024-01-15",
"processing_time_seconds": 45.2
}
)
except Exception as e:
# Include metadata on errors too
seer.error(
error_message=str(e),
metadata={
"source_file": "customers.csv",
"environment": "production",
"partial_records": len(data) if 'data' in locals() else 0
}
)records_processed - Number of records handledsource_file - Input file name or pathdata_date - Date of data being processedfile_size_mb - Size of input fileprocessing_time - Duration in secondsenvironment - production, staging, developmentregion - us-east-1, eu-west-1, etc.server - Hostname or server identifierversion - Application or script versioncustomer_id - Customer or tenant identifierdepartment - Finance, Marketing, Operationspriority - high, medium, lowcost_usd - Processing cost for billing