Skip to content

feat: add OTLP logging export#635

Merged
ajbozarth merged 2 commits intogenerative-computing:mainfrom
ajbozarth:feat/otlp-logging-export-mvp
Mar 13, 2026
Merged

feat: add OTLP logging export#635
ajbozarth merged 2 commits intogenerative-computing:mainfrom
ajbozarth:feat/otlp-logging-export-mvp

Conversation

@ajbozarth
Copy link
Contributor

@ajbozarth ajbozarth commented Mar 12, 2026

Misc PR

Type of PR

  • Bug Fix
  • New Feature
  • Documentation
  • Other

Description

MVP implementation of OTLP log export for Mellea's telemetry stack. This is the first phase of #460 — focused on getting logs into an observability backend. Enhanced handlers (file rotation, webhook, trace context injection) are deferred to Phase 2 (blocked in part by #458 and #459).

What's included:

  • New mellea/telemetry/logging.py module with get_otlp_handler()
  • FancyLogger integration — attaches OTLP handler when enabled
  • Graceful degradation when OpenTelemetry is not installed
  • Supports OTEL_EXPORTER_OTLP_LOGS_ENDPOINT with fallback to OTEL_EXPORTER_OTLP_ENDPOINT
  • Developer docs with configuration, collector setup example, and troubleshooting

Testing

  • Tests added to the respective file if code was changed
  • New code has 100% coverage if code as added
  • Ensure existing tests and github automation passes (a maintainer will kick off the github automation when the rest of the PR is populated)

Adds OTLP logging handler that exports logs to OpenTelemetry collectors.
Configured via MELLEA_LOGS_OTLP and OTEL_EXPORTER_OTLP_LOGS_ENDPOINT
environment variables. Integrates with existing FancyLogger infrastructure.

Signed-off-by: Alex Bozarth <ajbozart@us.ibm.com>
@ajbozarth ajbozarth self-assigned this Mar 12, 2026
@ajbozarth ajbozarth requested review from a team, jakelorocco and nrfulton as code owners March 12, 2026 19:37
@github-actions
Copy link
Contributor

The PR description has been updated. Please fill out the template for your PR to be reviewed.

@mergify
Copy link

mergify bot commented Mar 12, 2026

Merge Protections

Your pull request matches the following merge protections and will not be merged until they are valid.

🟢 Enforce conventional commit

Wonderful, this rule succeeded.

Make sure that we follow https://www.conventionalcommits.org/en/v1.0.0/

  • title ~= ^(fix|feat|docs|style|refactor|perf|test|build|ci|chore|revert|release)(?:\(.+\))?:

Copy link
Contributor

@jakelorocco jakelorocco left a comment

Choose a reason for hiding this comment

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

two small changes but looks good overall; thank you

Renamed function for clarity to indicate it's specifically for log handling.
Updated all references in telemetry module, core utils, and tests.

Signed-off-by: Alex Bozarth <ajbozart@us.ibm.com>
Copy link
Contributor

@jakelorocco jakelorocco left a comment

Choose a reason for hiding this comment

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

code lgtm; I don't have otel setup right now so I'm trusting the tests work

Copy link
Member

Choose a reason for hiding this comment

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

These docs probably need to make their way into the published docs website at some point right?

Copy link
Contributor Author

@ajbozarth ajbozarth Mar 13, 2026

Choose a reason for hiding this comment

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

do they not? I've just been making updates to the docs where they already existed.

Copy link
Member

Choose a reason for hiding this comment

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

no, only things in docs/docs are added to the website proper
API docs will get picked up, but not the docs/dev/telemetry.md file

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I'll take a look and see if it's a quick fix, otherwise I'll open an issue

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I opened #648 and will tackle it once I finish #608

@AngeloDanducci
Copy link
Contributor

code lgtm; I don't have otel setup right now so I'm trusting the tests work

Ran all the tests locally, all passing, LGTM.

@ajbozarth ajbozarth added this pull request to the merge queue Mar 13, 2026
Merged via the queue into generative-computing:main with commit c4cb59f Mar 13, 2026
5 checks passed
@ajbozarth ajbozarth deleted the feat/otlp-logging-export-mvp branch March 13, 2026 17:18
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.

4 participants