From 27a27152cd13008c2e376e18d78b353e1ae97c06 Mon Sep 17 00:00:00 2001 From: Adrian Cole <64215+codefromthecrypt@users.noreply.github.com> Date: Sat, 7 Dec 2024 02:16:42 +0800 Subject: [PATCH] Renames otel config from jaeger to otel (#569) # What does this PR do? #525 introduced a telemetry configuration named jaeger, but what it really is pointing to is an OTLP HTTP endpoint which is supported by most servers in the ecosystem, including raw opentelemetry collectors, several APMs, and even https://github.com/ymtdzzz/otel-tui I chose to rename this to "otel" as it will bring in more people to the ecosystem vs feeling it only works with jaeger. Later, we can use the [standard ENV](https://opentelemetry.io/docs/specs/otel/protocol/exporter/) to configure this if we like so that you can override things with variables people might expect. Note: I also added to the README that you have to install conda. Depending on experience level of the user, and especially with miniforge vs other ways, I felt this helps. ## Test Plan I would like to test this, but actually got a little lost. The previous PRs referenced yaml which doesn't seem published anywhere. It would be nice to have a pre-canned setup that uses ollama and turns on otel, but would also appreciate a hand on instructions meanwhile. ## Sources https://github.com/meta-llama/llama-stack/pull/525 ## Before submitting - [ ] This PR fixes a typo or improves the docs (you can dismiss the other checks if that's the case). - [x] Ran pre-commit to handle lint / formatting issues. - [x] Read the [contributor guideline](https://github.com/meta-llama/llama-stack/blob/main/CONTRIBUTING.md), Pull Request section? - [ ] Updated relevant documentation. - [ ] Wrote necessary unit or integration tests. --------- Signed-off-by: Adrian Cole --- README.md | 3 ++- .../providers/inline/telemetry/meta_reference/config.py | 4 ++-- .../providers/inline/telemetry/meta_reference/telemetry.py | 2 +- 3 files changed, 5 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 0dfb1306d..2e7585583 100644 --- a/README.md +++ b/README.md @@ -113,7 +113,8 @@ You have two ways to install this repository: ``` 2. **Install from source**: - If you prefer to install from the source code, follow these steps: + If you prefer to install from the source code, make sure you have [conda installed](https://docs.conda.io/projects/conda/en/stable). + Then, follow these steps: ```bash mkdir -p ~/local cd ~/local diff --git a/llama_stack/providers/inline/telemetry/meta_reference/config.py b/llama_stack/providers/inline/telemetry/meta_reference/config.py index 0230d24d2..4aaa368d1 100644 --- a/llama_stack/providers/inline/telemetry/meta_reference/config.py +++ b/llama_stack/providers/inline/telemetry/meta_reference/config.py @@ -13,7 +13,7 @@ from llama_stack.distribution.utils.config_dirs import RUNTIME_BASE_DIR class TelemetrySink(str, Enum): - JAEGER = "jaeger" + OTEL = "otel" SQLITE = "sqlite" CONSOLE = "console" @@ -29,7 +29,7 @@ class TelemetryConfig(BaseModel): ) sinks: List[TelemetrySink] = Field( default=[TelemetrySink.CONSOLE, TelemetrySink.SQLITE], - description="List of telemetry sinks to enable (possible values: jaeger, sqlite, console)", + description="List of telemetry sinks to enable (possible values: otel, sqlite, console)", ) sqlite_db_path: str = Field( default=(RUNTIME_BASE_DIR / "trace_store.db").as_posix(), diff --git a/llama_stack/providers/inline/telemetry/meta_reference/telemetry.py b/llama_stack/providers/inline/telemetry/meta_reference/telemetry.py index 0bcc48afb..095591f9a 100644 --- a/llama_stack/providers/inline/telemetry/meta_reference/telemetry.py +++ b/llama_stack/providers/inline/telemetry/meta_reference/telemetry.py @@ -72,7 +72,7 @@ class TelemetryAdapter(TelemetryDatasetMixin, Telemetry): provider = TracerProvider(resource=resource) trace.set_tracer_provider(provider) - if TelemetrySink.JAEGER in self.config.sinks: + if TelemetrySink.OTEL in self.config.sinks: otlp_exporter = OTLPSpanExporter( endpoint=self.config.otel_endpoint, )