Skip to content
This repository was archived by the owner on Feb 14, 2026. It is now read-only.

Add OpenTelemetry to the Strings worker#7

Merged
hacktobeer merged 8 commits intoopenrelik:mainfrom
rgayon:ot2
Aug 20, 2025
Merged

Add OpenTelemetry to the Strings worker#7
hacktobeer merged 8 commits intoopenrelik:mainfrom
rgayon:ot2

Conversation

@rgayon
Copy link
Copy Markdown
Contributor

@rgayon rgayon commented Jul 23, 2025

I suppose this shouldn't be merged until openrelik/openrelik-common#1 is

And then pyproject.toml should be updated.

While testing I was using: openrelik-common = { git = "https://github.com/rgayon/openrelik-common.git", branch="otel-init2"} un pyproject.toml to pull the required dependancy

@hacktobeer hacktobeer self-requested a review July 28, 2025 15:29
@hacktobeer
Copy link
Copy Markdown
Contributor

He @rgayon

  1. libary openrelik-common is merged and lib is released
  2. can you refactor all opentelemetry code into the library as much as possible? This to make sure we only need to change in 1 location (telemtry.py in openrelik-common instead of across all workers in the future....

@rgayon rgayon marked this pull request as ready for review July 29, 2025 09:07
@rgayon
Copy link
Copy Markdown
Contributor Author

rgayon commented Jul 29, 2025

  1. can you refactor all opentelemetry code into the library as much as possible?

Not sure how much more I can remove from here to put back in openrelik-common:

I need to call trace.get_current_span() in the context of the worker to get the span object to which I then add the specifics of this worker's config, and other info that could be useful to log.

Let me try whether I can provide a more common "telemetry.add_attribute()" that will call trace.get_current_span() and make sure it's valid

@rgayon
Copy link
Copy Markdown
Contributor Author

rgayon commented Jul 29, 2025

@hacktobeer PTAL, as well as relevant commit in openrelik_common : openrelik/openrelik-common#5

@codecov
Copy link
Copy Markdown

codecov bot commented Jul 30, 2025

Codecov Report

❌ Patch coverage is 0% with 7 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
src/tasks.py 0.00% 4 Missing ⚠️
src/app.py 0.00% 3 Missing ⚠️
Files with missing lines Coverage Δ
src/app.py 0.00% <0.00%> (ø)
src/tasks.py 0.00% <0.00%> (ø)
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Copy link
Copy Markdown
Contributor

@hacktobeer hacktobeer left a comment

Choose a reason for hiding this comment

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

Tested this with the new openrelik-common refactored code: the current implementation would ONLY work if people have some OTEL backend setup. The worker(s) also need to work when people do not have OTEL setup. See the logging implementation in openrelik-common for a fail safe example.

@rgayon
Copy link
Copy Markdown
Contributor Author

rgayon commented Aug 5, 2025

Tested this with the new openrelik-common refactored code: the current implementation would ONLY work if people have some OTEL backend setup. The worker(s) also need to work when people do not have OTEL setup. See the logging implementation in openrelik-common for a fail safe example.

This should now be addressed in openrelik/openrelik-common#8

@rgayon
Copy link
Copy Markdown
Contributor Author

rgayon commented Aug 5, 2025

Still unsure what's the best way to write down the required openrelik-common version in pyproject.toml

@rgayon rgayon requested a review from hacktobeer August 13, 2025 22:05
@rgayon
Copy link
Copy Markdown
Contributor Author

rgayon commented Aug 13, 2025

woops forgot to re-request review

@hacktobeer hacktobeer merged commit 3812b93 into openrelik:main Aug 20, 2025
3 checks passed
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants