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:
Manual instrumentation (SDK)
Section titled “Manual instrumentation (SDK)”import shield360
shield360.init( service_name="my-ai-app", environment="production", otlp_endpoint="https://otel-endpoint.com")Zero-code instrumentation (CLI)
Section titled “Zero-code instrumentation (CLI)”export OTEL_SERVICE_NAME=my-ai-appexport OTEL_DEPLOYMENT_ENVIRONMENT=productionshield360-instrument python your_app.pyConfiguration parameters
Section titled “Configuration parameters”Customize Shield360 SDK behavior for your specific instrumentation needs:
| Parameter | CLI Argument | Environment Variable | Description | Default | Required |
|---|---|---|---|---|---|
environment | --environment | OTEL_DEPLOYMENT_ENVIRONMENT | Deployment environment | "default" | No |
service_name | --service_name | OTEL_SERVICE_NAME | Service name for tracing | "default" | No |
otlp_endpoint | --otlp_endpoint | OTEL_EXPORTER_OTLP_ENDPOINT | OpenTelemetry 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. | None | No |
otlp_headers | --otlp_headers | OTEL_EXPORTER_OTLP_HEADERS | Authentication headers for enterprise monitoring backends. Not needed when sending to Shield360. | None | No |
disable_batch | --disable_batch | SHIELD360_DISABLE_BATCH | Disable batch span processing | False | No |
capture_message_content | --capture_message_content | OTEL_INSTRUMENTATION_GENAI_CAPTURE_MESSAGE_CONTENT | Enable LLM prompt and response content tracing for debugging | True | No |
disabled_instrumentors | --disabled_instrumentors | SHIELD360_DISABLED_INSTRUMENTORS | Disable specific AI service instrumentations (comma-separated) | None | No |
disable_metrics | --disable_metrics | SHIELD360_DISABLE_METRICS | Disable cost tracking and performance metrics collection | False | No |
max_content_length | --max_content_length | SHIELD360_MAX_CONTENT_LENGTH | Maximum 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. | None | No |
pricing_json | --pricing_json | SHIELD360_PRICING_JSON | Custom pricing configuration for accurate LLM cost tracking | None | No |
disable_events | --disable_events | SHIELD360_DISABLE_EVENTS | Disable OTel Logger event emission | False | No |
collect_system_metrics | --collect_system_metrics | SHIELD360_COLLECT_SYSTEM_METRICS | Comprehensive system monitoring (CPU, memory, disk, network, GPU) for AI workloads | False | No |
custom_metrics_attributes | N/A | N/A | Custom 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. | None | No |
Database instrumentation options
Section titled “Database instrumentation options”These options apply to database instrumentations like PostgreSQL (psycopg3):
| Parameter | CLI Argument | Environment Variable | Description | Default | Required |
|---|---|---|---|---|---|
capture_db_parameters | --capture_db_parameters | SHIELD360_CAPTURE_DB_PARAMETERS | Capture database query parameters in OTel per-key format (db.query.parameter.<key>) | False | No |
Evaluation export options
Section titled “Evaluation export options”Configure how evaluation results are exported:
Deprecated parameters
Section titled “Deprecated parameters”| Parameter | CLI Argument | Environment Variable | Description | Default | Required |
|---|---|---|---|---|---|
application_name | --application_name | OTEL_SERVICE_NAME | Application name for tracing (deprecated, use service_name) | "default" | No |
collect_gpu_stats | --collect_gpu_stats | SHIELD360_COLLECT_GPU_STATS | Enable GPU statistics collection (deprecated, use collect_system_metrics) | False | No |
Resource attributes
Section titled “Resource attributes”Additional resource attributes can be controlled using standard OpenTelemetry environment variables for enhanced metadata and observability context:
| Environment Variable | Description | Example |
|---|---|---|
OTEL_RESOURCE_ATTRIBUTES | Key-value pairs for resource attributes | service.version=1.0.0,deployment.environment=production |
OTEL_SERVICE_VERSION | Version of the service | 1.2.3 |
OTEL_RESOURCE_ATTRIBUTES_POD_NAME | Kubernetes pod name (if applicable) | my-ai-app-pod-xyz |
OTEL_RESOURCE_ATTRIBUTES_NODE_NAME | Kubernetes node name (if applicable) | node-123 |
Example:
# Set resource attributes for better trace organizationexport OTEL_RESOURCE_ATTRIBUTES="service.version=2.1.0,team=ai-platform,cost.center=engineering"export OTEL_SERVICE_VERSION=2.1.0
# Run with enhanced metadatashield360-instrument python your_ai_app.pyThese attributes enhance trace metadata for better filtering, grouping, and analysis in your observability platform.
Prompt Hub - shield360.get_prompt()
Section titled “Prompt Hub - shield360.get_prompt()”Advanced prompt management and version control for production LLM applications. Configure Shield360 Prompt Hub for centralized prompt governance and tracking:
| Parameter | Description |
|---|---|
url | Sets the Shield360 URL. Defaults to the SHIELD360_URL environment variable. |
api_key | Sets the Shield360 API Key. Can also be provided via the SHIELD360_API_KEY environment variable. |
name | Unique prompt identifier for retrieval. Use with prompt_id for specific prompt versioning |
prompt_id | Numeric ID for direct prompt access. Enables precise prompt version control. Optional |
version | Specific prompt version retrieval for consistent AI behavior across deployments. Optional |
shouldCompile | Enable dynamic prompt compilation with variables for personalized LLM interactions. Optional |
variables | Dynamic variables for prompt template compilation and customization. Optional |
meta_properties | Tracking metadata for prompt usage analytics and audit trails in production. Optional |
Vault - shield360.get_secrets()
Section titled “Vault - shield360.get_secrets()”Enterprise-grade secret management for AI applications. Configure Shield360 Vault for secure API key and credential handling in production LLM deployments:
| Parameter | Description |
|---|---|
url | Sets the Shield360 URL. Defaults to the SHIELD360_URL environment variable. |
api_key | Sets the Shield360 API Key. Can also be provided via the SHIELD360_API_KEY environment variable. |
key | Specific secret key retrieval for individual credential access. Optional |
should_set_env | Automatically set retrieved secrets as environment variables for seamless application integration. Optional |
tags | Tag-based secret filtering for organized credential management across different AI services. Optional |
Configuration parameters
Section titled “Configuration parameters”Customize Shield360 SDK behavior for your specific instrumentation needs:
| Argument | Description | Default Value | Required |
|---|---|---|---|
environment | The deployment environment of the application. | "default" | No |
applicationName | Identifies the name of your application. | "default" | No |
tracer | An instance of OpenTelemetry Tracer for tracing operations. | undefined | No |
otlpEndpoint | OpenTelemetry endpoint for LLM monitoring data transmission to enterprise backends. 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. | undefined | No |
otlpHeaders | Authentication headers for secure integration with monitoring platforms like Datadog, Grafana. Not needed when sending to Shield360. | undefined | No |
disableBatch | A flag to disable batch span processing, favoring immediate dispatch. | true | No |
traceContent | Enable LLM prompt and response content capture for comprehensive debugging. | true | No |
disabledInstrumentations | Disable specific AI service instrumentations for customized monitoring scope. | undefined | No |
instrumentations | Object of instrumentation modules for manual patching | undefined | No |
pricing_json | Custom pricing configuration URL for accurate LLM cost tracking and optimization. | Built into the SDK | No |
Resource attributes
Section titled “Resource attributes”Additional resource attributes can be controlled using standard OpenTelemetry environment variables for enhanced metadata and observability context:
| Environment Variable | Description | Example |
|---|---|---|
OTEL_RESOURCE_ATTRIBUTES | Key-value pairs for resource attributes | service.version=1.0.0,deployment.environment=production |
OTEL_SERVICE_VERSION | Version of the service | 1.2.3 |
OTEL_RESOURCE_ATTRIBUTES_POD_NAME | Kubernetes pod name (if applicable) | my-ai-app-pod-xyz |
OTEL_RESOURCE_ATTRIBUTES_NODE_NAME | Kubernetes node name (if applicable) | node-123 |
These attributes enhance trace metadata for better filtering, grouping, and analysis in your observability platform.
Prompt Hub - Shield360.getPrompt()
Section titled “Prompt Hub - Shield360.getPrompt()”Advanced prompt management for Node.js AI applications. Configure centralized prompt governance and version control for production LLM deployments:
| Parameter | Description |
|---|---|
url | Sets the Shield360 URL. Defaults to the SHIELD360_URL environment variable or http://127.0.0.1:3000 if not set. |
apiKey | Sets the Shield360 API Key. Can also be provided via the SHIELD360_API_KEY environment variable. |
name | Unique prompt identifier for consistent retrieval across deployments. |
promptId | Numeric prompt ID for direct access and version control. Optional |
version | Specific prompt version for consistent AI behavior in production. Optional |
shouldCompile | Enable dynamic prompt compilation with variables for personalized interactions. Optional |
variables | Dynamic template variables for prompt customization and personalization. Optional |
metaProperties | Usage tracking metadata for prompt analytics and audit trails. Optional |
Vault - Shield360.getSecrets()
Section titled “Vault - Shield360.getSecrets()”Enterprise-grade secret management for Node.js AI applications. Configure secure credential handling for production LLM deployments:
| Parameter | Description |
|---|---|
url | Sets the Shield360 URL. Defaults to the SHIELD360_URL environment variable or http://127.0.0.1:3000 if not set. |
apiKey | Sets the Shield360 API Key. Can also be provided via the SHIELD360_API_KEY environment variable. |
key | Specific secret key for individual credential retrieval. Optional |
tags | Tag-based secret filtering for organized credential management across AI services. Optional |
shouldSetEnv | Automatically set secrets as environment variables for seamless application integration. Optional |