Skip to content

refactor: improve handling of project and logstream attributes in Gal…#483

Draft
AnkushMalaker wants to merge 1 commit intomainfrom
fix/otel-init
Draft

refactor: improve handling of project and logstream attributes in Gal…#483
AnkushMalaker wants to merge 1 commit intomainfrom
fix/otel-init

Conversation

@AnkushMalaker
Copy link
Contributor

@AnkushMalaker AnkushMalaker commented Feb 22, 2026

User description

…ileoOTLPExporter and GalileoSpanProcessor

  • Updated the exporter to conditionally set headers only if project and logstream attributes are present.
  • Enhanced the span processor to fallback to environment variables for project and logstream if not provided in context.
  • Adjusted tests to verify the new behavior, ensuring that None values are skipped and environment variables are utilized correctly.

Shortcut:

Description:

Tests:

  • Unit Tests Added
  • E2E Test Added (if it's a user-facing feature, or fixing a bug)

Generated description

Below is a concise technical summary of the changes proposed in this PR:
Refines the handling of project and logstream attributes by introducing environment variable fallbacks and preventing null header overwrites. These changes ensure that GalileoSpanProcessor and GalileoOTLPExporter maintain consistent metadata across different execution environments.

TopicDetails
Attribute Handling Implement environment variable fallbacks for GALILEO_PROJECT and GALILEO_LOG_STREAM in GalileoSpanProcessor and update GalileoOTLPExporter to conditionally update headers only when attributes are present.
Modified files (1)
  • src/galileo/otel.py
Latest Contributors(2)
UserCommitDate
Focadecombatefeat-get-data-from-con...January 12, 2026
jimbobbennett@mac.comfix-Adding-support-for...November 13, 2025
Testing & Validation Add unit tests to verify that environment variables are correctly utilized as fallbacks and that exporter headers are preserved when span attributes are missing.
Modified files (1)
  • tests/test_otel.py
Latest Contributors(1)
UserCommitDate
Focadecombatefeat-get-data-from-con...January 12, 2026
This pull request is reviewed by Baz. Review like a pro on (Baz).

…ileoOTLPExporter and GalileoSpanProcessor

- Updated the exporter to conditionally set headers only if project and logstream attributes are present.
- Enhanced the span processor to fallback to environment variables for project and logstream if not provided in context.
- Adjusted tests to verify the new behavior, ensuring that None values are skipped and environment variables are utilized correctly.
@codecov
Copy link

codecov bot commented Feb 22, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 81.87%. Comparing base (545073a) to head (2a5613e).
⚠️ Report is 3 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #483      +/-   ##
==========================================
- Coverage   82.63%   81.87%   -0.77%     
==========================================
  Files          96       96              
  Lines        9157     9173      +16     
==========================================
- Hits         7567     7510      -57     
- Misses       1590     1663      +73     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

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.

1 participant