Skip to content

Configuration

Configure Shield360 SDK for AI monitoring and model performance tracking using flexible instrumentation methods. Choose from Manual instrumentation or Zero-code instrumentation for complete LLM observability:

import shield360
shield360.init(
service_name="my-ai-app",
environment="production",
otlp_endpoint="https://otel-endpoint.com"
)
Terminal window
export OTEL_SERVICE_NAME=my-ai-app
export OTEL_DEPLOYMENT_ENVIRONMENT=production
shield360-instrument python your_app.py

Customize Shield360 SDK behavior for your specific instrumentation needs:

ParameterCLI ArgumentEnvironment VariableDescriptionDefaultRequired
environment--environmentOTEL_DEPLOYMENT_ENVIRONMENTDeployment environment"default"No
service_name--service_nameOTEL_SERVICE_NAMEService name for tracing"default"No
otlp_endpoint--otlp_endpointOTEL_EXPORTER_OTLP_ENDPOINTOpenTelemetry endpoint for LLM monitoring data export. Leave unset to send to Shield360: with SHIELD360_URL and SHIELD360_API_KEY set, telemetry goes to the platform’s ingest route with the key as the bearer token.NoneNo
otlp_headers--otlp_headersOTEL_EXPORTER_OTLP_HEADERSAuthentication headers for enterprise monitoring backends. Not needed when sending to Shield360.NoneNo
disable_batch--disable_batchSHIELD360_DISABLE_BATCHDisable batch span processingFalseNo
capture_message_content--capture_message_contentOTEL_INSTRUMENTATION_GENAI_CAPTURE_MESSAGE_CONTENTEnable LLM prompt and response content tracing for debuggingTrueNo
disabled_instrumentors--disabled_instrumentorsSHIELD360_DISABLED_INSTRUMENTORSDisable specific AI service instrumentations (comma-separated)NoneNo
disable_metrics--disable_metricsSHIELD360_DISABLE_METRICSDisable cost tracking and performance metrics collectionFalseNo
max_content_length--max_content_lengthSHIELD360_MAX_CONTENT_LENGTHMaximum character length for captured prompt/completion content. None (default) means no truncation. Set to a positive integer to truncate content exceeding that length. 0 or -1 also disable truncation.NoneNo
pricing_json--pricing_jsonSHIELD360_PRICING_JSONCustom pricing configuration for accurate LLM cost trackingNoneNo
disable_events--disable_eventsSHIELD360_DISABLE_EVENTSDisable OTel Logger event emissionFalseNo
collect_system_metrics--collect_system_metricsSHIELD360_COLLECT_SYSTEM_METRICSComprehensive system monitoring (CPU, memory, disk, network, GPU) for AI workloadsFalseNo
custom_metrics_attributesN/AN/ACustom key-value attributes applied to every metric recording. Useful for grouping metrics by custom tags (e.g., client ID, team, project). Reserved keys like service.name cannot be overwritten.NoneNo

These options apply to database instrumentations like PostgreSQL (psycopg3):

ParameterCLI ArgumentEnvironment VariableDescriptionDefaultRequired
capture_db_parameters--capture_db_parametersSHIELD360_CAPTURE_DB_PARAMETERSCapture database query parameters in OTel per-key format (db.query.parameter.<key>)FalseNo

Configure how evaluation results are exported:

ParameterCLI ArgumentEnvironment VariableDescriptionDefaultRequired
application_name--application_nameOTEL_SERVICE_NAMEApplication name for tracing (deprecated, use service_name)"default"No
collect_gpu_stats--collect_gpu_statsSHIELD360_COLLECT_GPU_STATSEnable GPU statistics collection (deprecated, use collect_system_metrics)FalseNo

Additional resource attributes can be controlled using standard OpenTelemetry environment variables for enhanced metadata and observability context:

Environment VariableDescriptionExample
OTEL_RESOURCE_ATTRIBUTESKey-value pairs for resource attributesservice.version=1.0.0,deployment.environment=production
OTEL_SERVICE_VERSIONVersion of the service1.2.3
OTEL_RESOURCE_ATTRIBUTES_POD_NAMEKubernetes pod name (if applicable)my-ai-app-pod-xyz
OTEL_RESOURCE_ATTRIBUTES_NODE_NAMEKubernetes node name (if applicable)node-123

Example:

Terminal window
# Set resource attributes for better trace organization
export OTEL_RESOURCE_ATTRIBUTES="service.version=2.1.0,team=ai-platform,cost.center=engineering"
export OTEL_SERVICE_VERSION=2.1.0
# Run with enhanced metadata
shield360-instrument python your_ai_app.py

These attributes enhance trace metadata for better filtering, grouping, and analysis in your observability platform.

Advanced prompt management and version control for production LLM applications. Configure Shield360 Prompt Hub for centralized prompt governance and tracking:

ParameterDescription
urlSets the Shield360 URL. Defaults to the SHIELD360_URL environment variable.
api_keySets the Shield360 API Key. Can also be provided via the SHIELD360_API_KEY environment variable.
nameUnique prompt identifier for retrieval. Use with prompt_id for specific prompt versioning
prompt_idNumeric ID for direct prompt access. Enables precise prompt version control. Optional
versionSpecific prompt version retrieval for consistent AI behavior across deployments. Optional
shouldCompileEnable dynamic prompt compilation with variables for personalized LLM interactions. Optional
variablesDynamic variables for prompt template compilation and customization. Optional
meta_propertiesTracking metadata for prompt usage analytics and audit trails in production. Optional

Enterprise-grade secret management for AI applications. Configure Shield360 Vault for secure API key and credential handling in production LLM deployments:

ParameterDescription
urlSets the Shield360 URL. Defaults to the SHIELD360_URL environment variable.
api_keySets the Shield360 API Key. Can also be provided via the SHIELD360_API_KEY environment variable.
keySpecific secret key retrieval for individual credential access. Optional
should_set_envAutomatically set retrieved secrets as environment variables for seamless application integration. Optional
tagsTag-based secret filtering for organized credential management across different AI services. Optional