Skip to content

Conversation

cdoern
Copy link
Contributor

@cdoern cdoern commented Oct 15, 2025

What does this PR do?

remove telemetry as a providable API from the codebase. This includes removing it from generated distributions but also the provider registry, the router, etc

since setup_logger is tied pretty strictly to Api.telemetry being in impls we still need an "instantiated provider" in our implementations. However it should not be auto-routed or provided. So in validate_and_prepare_providers (called from resolve_impls) I made it so that if run_config.telemetry.enabled, we set up the meta-reference "provider" internally to be used so that log_event will work when called.

This is the neatest way I think we can remove telemetry from the provider configs but also not need to rip apart the whole "telemetry is a provider" logic just yet, but we can do it internally later without disrupting users.

so telemetry is removed from the registry such that if a user puts telemetry: as an API in their build/run config it will err out, but can still be used by us internally as we go through this transition.

relates to #3806

@meta-cla meta-cla bot added the CLA Signed This label is managed by the Meta Open Source bot. label Oct 15, 2025
@cdoern cdoern changed the title chore: remove telemetry API usage chore!: remove telemetry API usage Oct 15, 2025
Copy link
Contributor

@ehhuang ehhuang left a comment

Choose a reason for hiding this comment

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

I think still needed internally to keep the otel logging

@cdoern cdoern force-pushed the remove-telem branch 2 times, most recently from e3ab49c to 9d244b4 Compare October 15, 2025 20:12
Comment on lines 247 to 248
"opentelemetry-sdk",
"opentelemetry-exporter-otlp-proto-http",
Copy link
Contributor

Choose a reason for hiding this comment

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

we should add these deps to pyproject.toml?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

good idea! let me do that instead

Copy link
Contributor Author

Choose a reason for hiding this comment

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

looks like they're already in SERVER_DEPENDENCIES. I think that is good enough since those are included in every build?

@cdoern cdoern force-pushed the remove-telem branch 3 times, most recently from 2ba8570 to e9c7784 Compare October 16, 2025 14:32
@cdoern cdoern requested a review from ehhuang October 16, 2025 14:32
remove telemetry as a providable API from the codebase. This includes removing it from generated distributions but also the provider registry, the router, etc

relates to llamastack#3806

Signed-off-by: Charlie Doern <cdoern@redhat.com>
service_name: "${env.OTEL_SERVICE_NAME:=\u200B}"
sinks: ${env.TELEMETRY_SINKS:=}
otel_exporter_otlp_endpoint: ${env.OTEL_EXPORTER_OTLP_ENDPOINT:=}
post_training:
Copy link
Contributor

Choose a reason for hiding this comment

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

we should add telemetry.enabled: true in these configs so the behavior remains unchanged.

@ehhuang ehhuang merged commit f22aaef into llamastack:main Oct 16, 2025
45 checks passed
ehhuang added a commit that referenced this pull request Oct 16, 2025
# What does this PR do?
old telemetry config was removed in #3815

## Test Plan

❯ OTEL_SERVICE_NAME=aloha OTEL_EXPORTER_OTLP_ENDPOINT=http://localhost:4318 uv run llama stack run starter
ehhuang added a commit that referenced this pull request Oct 16, 2025
# What does this PR do?
old telemetry config was removed in #3815

## Test Plan

❯ OTEL_SERVICE_NAME=aloha OTEL_EXPORTER_OTLP_ENDPOINT=http://localhost:4318 uv run llama stack run starter
ehhuang added a commit that referenced this pull request Oct 16, 2025
# What does this PR do?
leftover from #3815

## Test Plan
CI


---
[//]: # (BEGIN SAPLING FOOTER)
Stack created with [Sapling](https://sapling-scm.com). Best reviewed
with
[ReviewStack](https://reviewstack.dev/llamastack/llama-stack/pull/3828).
* #3830
* __->__ #3828
ehhuang added a commit that referenced this pull request Oct 16, 2025
# What does this PR do?
old telemetry config was removed in #3815

## Test Plan

❯ OTEL_SERVICE_NAME=aloha OTEL_EXPORTER_OTLP_ENDPOINT=http://localhost:4318 uv run llama stack run starter
ehhuang added a commit that referenced this pull request Oct 16, 2025
# What does this PR do?
old telemetry config was removed in #3815

## Test Plan

❯ OTEL_SERVICE_NAME=aloha
OTEL_EXPORTER_OTLP_ENDPOINT=http://localhost:4318 uv run llama stack run
starter
<img width="1888" height="605" alt="image"
src="https://github.com/user-attachments/assets/dd5cc9f0-213a-4dc6-9385-f61a3a13b4c3"
/>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CLA Signed This label is managed by the Meta Open Source bot.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants