Skip to content

Conversation

Copy link
Contributor

Copilot AI commented Jul 24, 2025

This PR adds configurable file name prefix support to blob and file exporters, bringing them in line with the existing S3 exporter functionality. It also renames the S3 environment variable for consistency while maintaining backward compatibility.

Changes Made

1. S3 Exporter Updates

  • New: MONOCLE_S3_FILE_PREFIX environment variable (preferred)
  • Backward Compatible: Still supports legacy MONOCLE_S3_KEY_PREFIX
  • Precedence: New variable takes priority when both are set

2. Azure Blob Exporter Updates

  • New: MONOCLE_BLOB_FILE_PREFIX environment variable support
  • Fixed: Missing export queue initialization bug

3. File Exporter Updates

  • New: MONOCLE_FILE_PREFIX environment variable support
  • Behavior: Constructor parameter still takes precedence over environment variable

Environment Variables

Exporter Environment Variable Default Notes
S3 MONOCLE_S3_FILE_PREFIX monocle_trace_ Preferred over legacy MONOCLE_S3_KEY_PREFIX
Blob MONOCLE_BLOB_FILE_PREFIX monocle_trace_ New functionality
File MONOCLE_FILE_PREFIX monocle_trace_ Constructor param takes precedence

Usage Examples

# S3 Exporter - new preferred way
os.environ['MONOCLE_S3_FILE_PREFIX'] = 'my_app_traces_'

# Azure Blob Exporter - now configurable  
os.environ['MONOCLE_BLOB_FILE_PREFIX'] = 'azure_traces_'

# File Exporter - now configurable
os.environ['MONOCLE_FILE_PREFIX'] = 'local_traces_'

Testing

Added comprehensive test coverage:

  • S3 exporter backward compatibility validation
  • Blob exporter prefix configuration tests
  • File exporter prefix configuration tests
  • Environment variable precedence testing

Backward Compatibility

Fully backward compatible - existing code using MONOCLE_S3_KEY_PREFIX continues to work unchanged.

Fixes #149.


💬 Share your feedback on Copilot coding agent for the chance to win a $200 gift card! Click here to start the survey.

Co-authored-by: kshitiz-okahu <152476347+kshitiz-okahu@users.noreply.github.com>
Copilot AI changed the title [WIP] Support configurable file name prefix for blob exporter Support configurable file name prefix for blob and file exporters Jul 24, 2025
Copilot AI requested a review from kshitiz-okahu July 24, 2025 06:07
@oi-raanne oi-raanne changed the title Support configurable file name prefix for blob and file exporters [draft]Support configurable file name prefix for blob and file exporters Aug 8, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Support configurable file name prefix for blob exporter

2 participants