Skip to content

feat: OTel#200

Merged
kuraisle merged 12 commits into
mainfrom
feature/OTel
Jun 24, 2026
Merged

feat: OTel#200
kuraisle merged 12 commits into
mainfrom
feature/OTel

Conversation

@kuraisle

@kuraisle kuraisle commented Jun 9, 2026

Copy link
Copy Markdown
Member
✨ Feature
🛠️ Repo maintenance

PR Description

We need to keep an eye on our vegetables, so here's some OTel monitoring.
The OTel instrumentation has defaults for FastAPI, so the app is now attached to an Instrumentor.

The azure app service default is to use an environment variable APPLICATIONINSIGHTS_CONNECTION_STRING to attach the collector, so if this is in the environment the azure monitor is configured.

I've put it as an extra dependency (as people should have the option not to load the dependency), and updated the container to load the extra.

UPDATE: I had to change some tests and dependencies. I didn't need the specific opentelemetry-instrumentation-fastapi dependency locally (mysterious) and the malformed auth test has started returning 401, which seems right to me anyway. The CI/CD tests still test the local weights features, but I've flagged them to skip if llama-cpp-python isn't installed.

Related Issues or other material

Related #184
Closes #184

"/search/text-search/coughing",
)

assert response.status_code in [401, 403]

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Just checking you intended to leave this as either 403 OR 401. The other test now asserts a specific code, so thought that this would follow the same pattern.

Comment thread lettuce/tests/unit/test_models.py Outdated
from options.pipeline_options import LLMModel
from options.base_options import InferenceType
get_local_weights = pytest.importorskip("components.models.get_local_weights")
download_model_from_huggingface = pytest.importorskip("components.models.get_local_weights")

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

I think importorskip is for whole modules, not functions.

Also, the second importorskip line here is the same as the first - I suspect a copypasta error

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

This was way harder to solve than I thought!

@kuraisle kuraisle merged commit 9b964bc into main Jun 24, 2026
7 checks passed
@kuraisle kuraisle deleted the feature/OTel branch June 24, 2026 11:09
@github-actions

Copy link
Copy Markdown

🎉 This PR is included in version 1.1.0 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Open Telemetry

2 participants