Skip to content

NA: Use push metrics, trace and logs ON Python Backend via Otel #2821

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 17 commits into
base: main
Choose a base branch
from

Conversation

thiagohora
Copy link
Contributor

@thiagohora thiagohora commented Jul 24, 2025

Details

  • Now we are exporting all telemetry data to a collector, which forwards it to New Relic and Grafana
Screenshot 2025-08-07 at 16 33 18

Copy link
Contributor

github-actions bot commented Jul 24, 2025

Python Backend Tests Results

41 tests   39 ✅  1m 56s ⏱️
 1 suites   2 💤
 1 files     0 ❌

Results for commit b127085.

♻️ This comment has been updated with latest results.

@thiagohora thiagohora force-pushed the thiagohora/NA_use_push_metrics_on_python_metrics branch from 515a779 to 69950ac Compare August 6, 2025 17:07
@thiagohora thiagohora force-pushed the thiagohora/NA_use_push_metrics_on_python_metrics branch from f538fb3 to c682721 Compare August 6, 2025 17:32
@thiagohora thiagohora force-pushed the thiagohora/NA_use_push_metrics_on_python_metrics branch from c682721 to a5c6a73 Compare August 6, 2025 17:37
@thiagohora thiagohora force-pushed the thiagohora/NA_use_push_metrics_on_python_metrics branch from bfc8d25 to eaaf068 Compare August 7, 2025 12:27
@thiagohora thiagohora force-pushed the thiagohora/NA_use_push_metrics_on_python_metrics branch from eaaf068 to 2e22a91 Compare August 7, 2025 12:57
- Extract telemetry setup into clean, focused methods:
  - setup_otel_metrics(): Configure metrics export
  - setup_otel_traces(): Configure traces export
  - setup_otel_logs(): Configure logs export + handler
  - setup_console_logging(): Configure console verbosity
  - setup_otel_instrumentation(): Auto-instrumentation with checks

- Fix double instrumentation warnings by adding proper checks
- Add OPIK_CONSOLE_LOG_LEVEL environment variable for console control
- Improve code maintainability and testability
- Preserve all existing telemetry functionality

Benefits:
- Each method has single responsibility
- Better organization and readability
- Fixed double instrumentation bug
- Independent console and OTEL log level control
- Easier to test and modify individual components
@thiagohora thiagohora changed the title NA: Use push metrics on python backend NA: Use push metrics, trace and logs ON Python Backend via Otel Aug 7, 2025
@thiagohora thiagohora marked this pull request as ready for review August 7, 2025 14:35
@thiagohora thiagohora requested a review from a team as a code owner August 7, 2025 14:35
@thiagohora thiagohora requested a review from andrescrz August 7, 2025 14:35
@thiagohora thiagohora force-pushed the thiagohora/NA_use_push_metrics_on_python_metrics branch from 4f3c1a4 to e98dc31 Compare August 8, 2025 09:50
@thiagohora thiagohora requested a review from andrescrz August 8, 2025 09:53
andrescrz
andrescrz previously approved these changes Aug 8, 2025
Copy link
Member

@andrescrz andrescrz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM.

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.

2 participants