Skip to content

fix(tracing): add vendor reporting for OTEL tracing#64

Merged
doronkopit5 merged 6 commits intomainfrom
dk/otel-vendor-report
Aug 12, 2025
Merged

fix(tracing): add vendor reporting for OTEL tracing#64
doronkopit5 merged 6 commits intomainfrom
dk/otel-vendor-report

Conversation

@doronkopit5
Copy link
Member

@doronkopit5 doronkopit5 commented Aug 9, 2025

Important

Adds vendor reporting for OTEL tracing and refactors provider types to use a strongly typed enum for improved trace clarity and type safety.

  • Behavior:
    • Adds vendor information to tracing for chat, completion, and embedding operations in otel.rs and pipeline.rs.
    • Improves mapping of provider types to standardized vendor names in provider.rs.
  • Refactor:
    • Updates provider types from strings to a strongly typed enum ProviderType in types/mod.rs.
  • Tests:
    • Adds tests in otel.rs and pipeline.rs to verify vendor name mapping and integration with provider types.
    • Updates existing tests to use the new ProviderType enum.

This description was created by Ellipsis for 2d0a06b. You can customize this summary. It will automatically update as commits are pushed.


Summary by CodeRabbit

  • New Features

    • Vendor information is now included in tracing for chat, completion, and embedding operations, improving trace clarity for different AI providers.
  • Bug Fixes

    • Improved mapping of provider types to standardized vendor names for more accurate reporting in tracing.
  • Tests

    • Added new tests to verify vendor name mapping and integration with provider types.
  • Refactor

    • Provider types updated from strings to a strongly typed enum across the system for improved type safety and consistency.

- Introduced `set_vendor` method in `OtelTracer` to set vendor attributes.
- Integrated vendor name retrieval in chat, completion, and embedding functions based on the model provider type.
@coderabbitai
Copy link
Contributor

coderabbitai bot commented Aug 9, 2025

Note

Other AI code review bot(s) detected

CodeRabbit has detected other AI code review bot(s) in this pull request and will avoid duplicating their findings in the review comments. This may lead to a less comprehensive review.

Walkthrough

A new method to set vendor information was added to the OpenTelemetry tracer, with logic to map provider types to standardized vendor names. This mapping is now used in tracing calls within pipeline functions. The Provider trait was updated to use a strongly typed ProviderType enum instead of strings. Additional unit tests and test providers were introduced to verify correct vendor mapping and integration. Various tests and provider implementations were updated to use the ProviderType enum.

Changes

Cohort / File(s) Change Summary
OtelTracer Vendor Setter & Tests
src/pipelines/otel.rs
Added set_vendor method to OtelTracer for setting the GEN_AI_SYSTEM span attribute. Introduced tests for vendor mapping and method existence.
Pipeline Vendor Tracing & Test Providers
src/pipelines/pipeline.rs
Inserted calls to set_vendor in main async functions to record vendor info in tracing. Added test provider implementations and tests for provider-to-vendor mapping and integration.
Provider Trait & Vendor Mapping
src/providers/provider.rs
Changed Provider::type method return type from String to ProviderType enum. Added get_vendor_name function mapping ProviderType variants to vendor strings.
Provider Implementations Updated to Use Enum
src/providers/anthropic/provider.rs, src/providers/azure/provider.rs, src/providers/bedrock/provider.rs, src/providers/openai/provider.rs, src/providers/vertexai/provider.rs
Updated r#type method implementations to return ProviderType enum variants instead of strings.
Provider Registry Matching Update
src/providers/registry.rs
Changed provider type matching from string literals to ProviderType enum variants in provider construction logic. Removed wildcard match arm.
ProviderType Enum Definition & Usage
src/types/mod.rs, src/management/dto.rs
Added ProviderType enum with variants and Display/FromStr implementations. Changed Provider struct's r#type field from String to ProviderType. Removed local ProviderType enum in dto.rs and re-exported from types.
Test Code Updates to Use ProviderType Enum
tests/*, src/providers/bedrock/test.rs, src/providers/vertexai/tests.rs, src/config/validation.rs
Replaced all string literal provider type usages with ProviderType enum variants in test setups and assertions. Added imports for ProviderType.
Config Provider Service Update
src/management/services/config_provider_service.rs
Changed assignment of r#type field to use ProviderType enum directly instead of converting to string.

Sequence Diagram(s)

sequenceDiagram
    participant Client
    participant Pipeline
    participant Model
    participant Provider
    participant OtelTracer

    Client->>Pipeline: chat_completions/completions/embeddings()
    Pipeline->>Model: select model
    Model->>Provider: get provider type
    Pipeline->>Provider: provider.r#type()
    Pipeline->>OtelTracer: set_vendor(get_vendor_name(provider_type))
    Pipeline->>Provider: call provider method
    Provider-->>Pipeline: response
    Pipeline-->>Client: response
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Poem

A vendor name, a tracing hop,
From enum types the data pops.
OpenAI, Azure, Anthropic's cheer,
Mapped and set with code sincere.
Tests confirm the paths are right,
This rabbit hops with pure delight!
🐇🌿✨

Note

🔌 MCP (Model Context Protocol) integration is now available in Early Access!

Pro users can now connect to remote MCP servers under the Integrations page to get reviews and chat conversations that understand additional development context.


📜 Recent review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 2d0a06b and 2f5dd21.

📒 Files selected for processing (6)
  • src/providers/anthropic/provider.rs (2 hunks)
  • src/providers/azure/provider.rs (2 hunks)
  • src/providers/bedrock/test.rs (4 hunks)
  • src/providers/openai/provider.rs (2 hunks)
  • src/providers/vertexai/provider.rs (2 hunks)
  • src/providers/vertexai/tests.rs (7 hunks)
🚧 Files skipped from review as they are similar to previous changes (6)
  • src/providers/azure/provider.rs
  • src/providers/bedrock/test.rs
  • src/providers/vertexai/provider.rs
  • src/providers/anthropic/provider.rs
  • src/providers/vertexai/tests.rs
  • src/providers/openai/provider.rs
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
  • GitHub Check: build
✨ Finishing Touches
  • 📝 Generate Docstrings
🧪 Generate unit tests
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch dk/otel-vendor-report

🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Explain this complex logic.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai explain this code block.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and explain its main purpose.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.

Support

Need help? Create a ticket on our support page for assistance with any issues or questions.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR.
  • @coderabbitai generate sequence diagram to generate a sequence diagram of the changes in this PR.
  • @coderabbitai generate unit tests to generate unit tests for this PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

@doronkopit5 doronkopit5 marked this pull request as ready for review August 9, 2025 19:43
Copy link
Contributor

@ellipsis-dev ellipsis-dev bot left a comment

Choose a reason for hiding this comment

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

Caution

Changes requested ❌

Reviewed everything up to 748f0f7 in 1 minute and 5 seconds. Click for details.
  • Reviewed 301 lines of code in 3 files
  • Skipped 0 files when reviewing.
  • Skipped posting 2 draft comments. View those below.
  • Modify your settings and rules to customize what types of comments Ellipsis leaves. And don't forget to react with 👍 or 👎 to teach Ellipsis.
1. src/pipelines/otel.rs:176
  • Draft comment:
    Ensure GEN_AI_SYSTEM is defined and imported correctly. Document the purpose of set_vendor() since it affects trace attributes.
  • Reason this comment was not posted:
    Comment did not seem useful. Confidence is useful = 50% <= threshold 50% The comment is asking to ensure that GEN_AI_SYSTEM is defined and imported correctly, which is not allowed as it falls under the category of asking the author to ensure something. However, the second part of the comment is asking to document the purpose of a function, which is a valid request for clarity and documentation purposes.
2. src/pipelines/pipeline.rs:115
  • Draft comment:
    Consider centralizing the vendor setting logic as it's repeated in each endpoint. If future changes are needed, using a helper function might reduce duplication.
  • Reason this comment was not posted:
    Confidence changes required: 50% <= threshold 50% None

Workflow ID: wflow_HpMCzVpheRkYDNZV

You can customize Ellipsis by changing your verbosity settings, reacting with 👍 or 👎, replying to comments, or adding code review rules.

Copy link
Contributor

@ellipsis-dev ellipsis-dev bot left a comment

Choose a reason for hiding this comment

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

Important

Looks good to me! 👍

Reviewed 60f8047 in 32 seconds. Click for details.
  • Reviewed 38 lines of code in 1 files
  • Skipped 0 files when reviewing.
  • Skipped posting 3 draft comments. View those below.
  • Modify your settings and rules to customize what types of comments Ellipsis leaves. And don't forget to react with 👍 or 👎 to teach Ellipsis.
1. src/pipelines/otel.rs:176
  • Draft comment:
    Formatting change: Chained call in set_vendor is more readable. Ensure consistency with other similar chained calls.
  • Reason this comment was not posted:
    Confidence changes required: 0% <= threshold 50% None
2. src/pipelines/otel.rs:404
  • Draft comment:
    Minor whitespace removal after asserting vendor name mapping; no change in logic.
  • Reason this comment was not posted:
    Confidence changes required: 0% <= threshold 50% None
3. src/pipelines/otel.rs:421
  • Draft comment:
    Test set_vendor method: Consider verifying that the span attribute is actually set rather than only asserting true.
  • Reason this comment was not posted:
    Confidence changes required: 33% <= threshold 50% None

Workflow ID: wflow_YMjeh2rNy64munNA

You can customize Ellipsis by changing your verbosity settings, reacting with 👍 or 👎, replying to comments, or adding code review rules.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 2

🧹 Nitpick comments (2)
src/pipelines/otel.rs (2)

176-178: LGTM: vendor attribute is set on the span

Setting GEN_AI_SYSTEM with the vendor string is correct and keeps concerns encapsulated in OtelTracer. If you adopt Cow<'static, str> for get_vendor_name, you can call with vendor.as_ref() here to stay allocation-free for known mappings.


411-427: Strengthen test: current smoke test doesn’t assert behavior

test_set_vendor_method_exists only asserts true. Prefer a test that verifies the attribute was actually set (e.g., initialize a testing TracerProvider/exporter and assert the span contains GEN_AI_SYSTEM with the expected value).

I can sketch an in-memory exporter setup with opentelemetry_sdk to assert span attributes if helpful.

📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 7af3a85 and 748f0f7.

📒 Files selected for processing (3)
  • src/pipelines/otel.rs (2 hunks)
  • src/pipelines/pipeline.rs (5 hunks)
  • src/providers/provider.rs (1 hunks)
🧰 Additional context used
🪛 GitHub Actions: build
src/pipelines/otel.rs

[error] 174-174: cargo fmt check failed due to formatting differences. Please run 'cargo fmt' to fix code style issues.


[error] 403-403: cargo fmt check failed due to formatting differences. Please run 'cargo fmt' to fix code style issues.


[error] 416-416: cargo fmt check failed due to formatting differences. Please run 'cargo fmt' to fix code style issues.


[error] 423-423: cargo fmt check failed due to formatting differences. Please run 'cargo fmt' to fix code style issues.

🔇 Additional comments (1)
src/pipelines/pipeline.rs (1)

114-116: Ignore outdated vendor‐mapping suggestion

I couldn’t find any Provider trait implementations, r#type() methods, or a get_vendor_name function in the current codebase. It looks like the original comments about normalizing provider types and adjusting the call to tracer.set_vendor(...) no longer apply.

Please disregard that part of the review, or reintroduce/rename those functions if you still intend to support provider-based vendor mapping.

Likely an incorrect or invalid review comment.

Copy link
Contributor

@ellipsis-dev ellipsis-dev bot left a comment

Choose a reason for hiding this comment

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

Important

Looks good to me! 👍

Reviewed c67f237 in 1 minute and 40 seconds. Click for details.
  • Reviewed 879 lines of code in 20 files
  • Skipped 0 files when reviewing.
  • Skipped posting 5 draft comments. View those below.
  • Modify your settings and rules to customize what types of comments Ellipsis leaves. And don't forget to react with 👍 or 👎 to teach Ellipsis.
1. src/types/mod.rs:20
  • Draft comment:
    Good refactor of the provider type: replacing raw strings with a typed enum improves type safety. Consider whether the mapping in Display (which yields lowercase values) should be harmonized with the vendor names returned by get_vendor_name (which mix cases) for consistency.
  • Reason this comment was not posted:
    Decided after close inspection that this draft comment was likely wrong and/or not actionable: usefulness confidence = 20% vs. threshold = 50% The comment has two parts: praising the enum refactor (which isn't actionable) and pointing out case inconsistency. The case inconsistency appears to be intentional - Display is used for serialization (hence lowercase) while get_vendor_name is used for display/branding (hence proper case). These serve different purposes, so the inconsistency is likely by design. I might be wrong about the intended purposes of these two methods. There could be places in the code where the inconsistency causes real problems. Without evidence that the case inconsistency causes actual issues, this appears to be a speculative comment about potential problems rather than a clear issue that needs fixing. The comment should be deleted as it combines non-actionable praise with a speculative suggestion about case consistency that appears to be intentionally different for valid reasons.
2. src/providers/provider.rs:38
  • Draft comment:
    Since the vendor mapping always returns a freshly allocated String, consider returning a &'static str instead to avoid unnecessary allocation if the mapping is static.
  • Reason this comment was not posted:
    Confidence changes required: 30% <= threshold 50% None
3. src/providers/vertexai/provider.rs:56
  • Draft comment:
    The get_auth_token implementation uses an expect to require credentials; ensure that in production scenarios this panics is acceptable or consider graceful error handling.
  • Reason this comment was not posted:
    Comment was not on a location in the diff, so it can't be submitted as a review comment.
4. tests/config_hash_tests.rs:10
  • Draft comment:
    Hash implementations sort keys to ensure order independence; this is a solid approach.
  • Reason this comment was not posted:
    Confidence changes required: 10% <= threshold 50% None
5. General:0
  • Draft comment:
    Overall, the PR consistently updates provider type usage across modules and tests. The changes bring enhanced type safety and more robust vendor reporting in tracing. Great work on updating tests across the board!
  • Reason this comment was not posted:
    Confidence changes required: 0% <= threshold 50% None

Workflow ID: wflow_Iw6gjXqevWObHmyR

You can customize Ellipsis by changing your verbosity settings, reacting with 👍 or 👎, replying to comments, or adding code review rules.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

♻️ Duplicate comments (1)
src/providers/provider.rs (1)

37-46: Fix OTEL vendor/system mapping: mixed casing and non-standard values

The current values are inconsistent and likely non-compliant with OTEL GenAI conventions. For OpenTelemetry, attribute values such as gen_ai.system are expected to be lowercase, underscore-delimited identifiers (e.g., "openai", "anthropic", "azure_openai", "aws_bedrock", "vertex_ai"). Returning "Azure"/"Anthropic"/"AWS"/"Google" mixes casing and semantics (vendor vs system).

If set_vendor feeds the OTEL gen_ai.system (or a similar standardized attribute), switch to the enumerated, lowercase values. Minimal fix (keeping String):

 pub fn get_vendor_name(provider_type: &ProviderType) -> String {
     match provider_type {
-        ProviderType::OpenAI => "openai".to_string(),
-        ProviderType::Azure => "Azure".to_string(),
-        ProviderType::Anthropic => "Anthropic".to_string(),
-        ProviderType::Bedrock => "AWS".to_string(),
-        ProviderType::VertexAI => "Google".to_string(),
+        ProviderType::OpenAI => "openai".to_string(),
+        ProviderType::Azure => "azure_openai".to_string(),
+        ProviderType::Anthropic => "anthropic".to_string(),
+        ProviderType::Bedrock => "aws_bedrock".to_string(),
+        ProviderType::VertexAI => "vertex_ai".to_string(),
     }
 }

Optionally, avoid allocations by returning &'static str or Cow<'static, str>.

Please confirm which OTEL attribute set_vendor writes. If it’s intended as a human-readable “vendor” label instead of gen_ai.system, then normalize consistently (e.g., "OpenAI", "Azure", "Anthropic", "AWS", "Google") and keep casing uniform across all branches.

To verify where the value is used and the expected attribute key, run:

#!/bin/bash
# Inspect usage of set_vendor and related OTEL attributes
rg -n "set_vendor\(" -A 3
rg -n "gen_ai\.system|llm\.vendor|vendor" -A 3
🧹 Nitpick comments (7)
src/types/mod.rs (1)

47-60: Minor: prefer to_ascii_lowercase for ASCII-only matching

Using s.to_lowercase() allocates and applies Unicode case folding. For ASCII tokens, to_ascii_lowercase() is cheaper and avoids locale surprises.

-        match s.to_lowercase().as_str() {
+        match s.to_ascii_lowercase().as_str() {
src/pipelines/pipeline.rs (6)

7-7: Importing vendor-mapping here is OK; consider reducing cross-module coupling

Using get_vendor_name in the pipeline is fine, but you could push the mapping concern into the tracer to avoid pipelines depending on providers::provider. For example, add set_vendor_from_provider(ProviderType) on OtelTracer and keep pipelines unaware of mapping details.

Possible follow-up in tracer (outside this file):

impl OtelTracer {
    pub fn set_vendor_from_provider(&mut self, p: ProviderType) {
        self.set_vendor(get_vendor_name(&p));
    }
}

Then update call sites in this file (see comments below).


114-116: Set vendor timing is correct; optional: let tracer handle mapping

Good placement (right after model match, before invoking provider). To reduce repetition and keep mapping centralized, consider:

-            // Set vendor now that we know which model/provider we're using
-            tracer.set_vendor(&get_vendor_name(&model.provider.r#type()));
+            // Set vendor now that we know which model/provider we're using
+            tracer.set_vendor_from_provider(model.provider.r#type());

Note: requires adding set_vendor_from_provider to OtelTracer as shown above.


153-155: Duplicate vendor-setting logic across endpoints

Same feedback as chat: this is correct, but consider delegating mapping to the tracer to DRY the code.

-            tracer.set_vendor(&get_vendor_name(&model.provider.r#type()));
+            tracer.set_vendor_from_provider(model.provider.r#type());

180-182: Duplicate vendor-setting logic (embeddings)

Also correct here. Same optional refactor applies.

-            tracer.set_vendor(&get_vendor_name(&model.provider.r#type()));
+            tracer.set_vendor_from_provider(model.provider.r#type());

430-577: Reduce duplication across test providers

TestProviderOpenAI, TestProviderAnthropic, and TestProviderAzure are nearly identical aside from r#type() and the dummy response’s model string. Consider a single parametric test provider holding a ProviderType (and maybe a key), to simplify maintenance and addition of new providers.

Example:

#[derive(Clone)]
struct TestProvider {
    key: String,
    kind: ProviderType,
    model_name: String,
}
impl Provider for TestProvider {
    fn new(_config: &ProviderConfig) -> Self { unimplemented!() }
    fn key(&self) -> String { self.key.clone() }
    fn r#type(&self) -> ProviderType { self.kind }
    // chat_completions returns NonStream with model_name; others NOT_IMPLEMENTED
}

Then instantiate it with different ProviderType values in tests.


590-606: Provider type methods tests: good coverage; consider adding a tracer integration check

These assertions validate the provider types and mapping. If feasible, add a small integration test around OtelTracer to assert the span’s vendor attribute is set (using a test tracer or exposing span attributes in a test build). I can help scaffold a test double for OtelTracer if you want to exercise the set_vendor call through the pipeline path.

📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 60f8047 and c67f237.

📒 Files selected for processing (20)
  • src/config/validation.rs (3 hunks)
  • src/management/dto.rs (1 hunks)
  • src/management/services/config_provider_service.rs (1 hunks)
  • src/pipelines/otel.rs (2 hunks)
  • src/pipelines/pipeline.rs (9 hunks)
  • src/providers/anthropic/provider.rs (2 hunks)
  • src/providers/azure/provider.rs (2 hunks)
  • src/providers/bedrock/provider.rs (2 hunks)
  • src/providers/bedrock/test.rs (4 hunks)
  • src/providers/openai/provider.rs (2 hunks)
  • src/providers/provider.rs (2 hunks)
  • src/providers/registry.rs (2 hunks)
  • src/providers/vertexai/provider.rs (2 hunks)
  • src/providers/vertexai/tests.rs (7 hunks)
  • src/types/mod.rs (2 hunks)
  • tests/config_hash_tests.rs (6 hunks)
  • tests/pipeline_header_routing_test.rs (1 hunks)
  • tests/router_cache_tests.rs (8 hunks)
  • tests/router_integration_test.rs (6 hunks)
  • tests/unified_openapi_test.rs (2 hunks)
✅ Files skipped from review due to trivial changes (8)
  • tests/router_integration_test.rs
  • tests/config_hash_tests.rs
  • src/config/validation.rs
  • src/providers/bedrock/test.rs
  • src/providers/vertexai/tests.rs
  • src/providers/openai/provider.rs
  • tests/router_cache_tests.rs
  • src/providers/anthropic/provider.rs
🚧 Files skipped from review as they are similar to previous changes (1)
  • src/pipelines/otel.rs
🧰 Additional context used
🧬 Code Graph Analysis (6)
tests/unified_openapi_test.rs (2)
src/providers/provider.rs (1)
  • r#type (16-16)
src/providers/openai/provider.rs (1)
  • r#type (43-45)
src/providers/bedrock/provider.rs (5)
src/providers/anthropic/provider.rs (1)
  • r#type (33-35)
src/providers/azure/provider.rs (1)
  • r#type (50-52)
src/providers/provider.rs (1)
  • r#type (16-16)
src/providers/openai/provider.rs (1)
  • r#type (43-45)
src/providers/vertexai/provider.rs (1)
  • r#type (132-134)
src/providers/vertexai/provider.rs (6)
src/providers/anthropic/provider.rs (1)
  • r#type (33-35)
src/providers/bedrock/provider.rs (1)
  • r#type (132-134)
src/providers/azure/provider.rs (1)
  • r#type (50-52)
src/pipelines/pipeline.rs (4)
  • r#type (235-237)
  • r#type (446-448)
  • r#type (493-495)
  • r#type (540-542)
src/providers/provider.rs (1)
  • r#type (16-16)
src/providers/openai/provider.rs (1)
  • r#type (43-45)
src/providers/azure/provider.rs (6)
src/providers/anthropic/provider.rs (1)
  • r#type (33-35)
src/providers/bedrock/provider.rs (1)
  • r#type (132-134)
src/pipelines/pipeline.rs (4)
  • r#type (235-237)
  • r#type (446-448)
  • r#type (493-495)
  • r#type (540-542)
src/providers/provider.rs (1)
  • r#type (16-16)
src/providers/openai/provider.rs (1)
  • r#type (43-45)
src/providers/vertexai/provider.rs (1)
  • r#type (132-134)
src/providers/provider.rs (6)
src/providers/anthropic/provider.rs (3)
  • new (21-27)
  • key (29-31)
  • r#type (33-35)
src/providers/bedrock/provider.rs (3)
  • new (122-126)
  • key (128-130)
  • r#type (132-134)
src/providers/azure/provider.rs (3)
  • new (39-44)
  • key (46-48)
  • r#type (50-52)
src/providers/registry.rs (1)
  • new (17-32)
src/providers/openai/provider.rs (3)
  • new (32-37)
  • key (39-41)
  • r#type (43-45)
src/providers/vertexai/provider.rs (3)
  • new (105-126)
  • key (128-130)
  • r#type (132-134)
src/types/mod.rs (1)
src/management/dto.rs (2)
  • fmt (434-440)
  • from_str (446-453)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
  • GitHub Check: build
🔇 Additional comments (19)
tests/pipeline_header_routing_test.rs (2)

2-4: Enum import migration looks good

Using ProviderType in tests aligns with the refactor and keeps type-safety.


10-10: Provider r#type switched to enum variant — LGTM

ProviderType::OpenAI correctly replaces the previous string literal.

src/management/services/config_provider_service.rs (1)

187-188: Type-safety improvement acknowledged — verify external serialization compatibility

Assigning dto.provider_type directly (enum) improves type safety. Ensure:

  • Provider and ProviderResponse use the same enum type.
  • Serde derives on ProviderType keep wire format stable (e.g., lowercased strings) for OpenAPI/DB boundaries.

If external JSON previously used string values, confirm the enum uses serde rename or tag to preserve those values.

tests/unified_openapi_test.rs (2)

3-5: Importing ProviderType is consistent with the refactor

Matches the trait method r#type() returning ProviderType across providers.


130-130: Provider r#type updated to enum — looks correct

ProviderType::OpenAI is the right variant here; no further adjustments needed in this test.

src/providers/bedrock/provider.rs (2)

12-12: Imports updated to bring ProviderType into scope — OK

Keeps the implementation aligned with the trait signature.


132-134: Return ProviderType::Bedrock — aligned with trait changes

This matches other providers and enables centralized vendor mapping.

If get_vendor_name is used for OTEL attributes, confirm the chosen label for Bedrock (e.g., "aws" vs "bedrock") matches your observability conventions to avoid inconsistent dashboards.

src/providers/vertexai/provider.rs (2)

11-11: Imports updated for ProviderType — good

Consistent with the codebase-wide enum migration.


132-134: Return ProviderType::VertexAI — LGTM

Consistent with other provider implementations and supports vendor mapping.

Double-check vendor naming used by get_vendor_name for Vertex AI (e.g., "google" vs "vertexai") to ensure consistent OTEL reporting across vendors.

src/management/dto.rs (1)

6-7: Centralizing ProviderType is correct and improves cohesion

Re-exporting ProviderType from crate::types removes duplication and aligns DTOs with the core type. LGTM.

src/providers/azure/provider.rs (1)

50-52: Return strongly-typed ProviderType

Switching r#type to return ProviderType::Azure matches the trait change and the registry’s enum-based dispatch. Looks good.

src/providers/registry.rs (1)

21-27: Enum-based provider dispatch is safer and exhaustive

Matching on ProviderType variants removes stringly-typed bugs and makes the match exhaustive (future variants will be compile-time enforced). Good change.

src/providers/provider.rs (1)

16-16: Trait now returns ProviderType — correct migration

The Provider trait’s r#type signature matches the new enum-based approach. This is consistent across implementations.

src/types/mod.rs (2)

62-72: Provider.r#type moved to enum — good change

Using ProviderType in the Provider struct strengthens type-safety and simplifies matching in the registry.


35-46: Display implementation aligns with serde-renamed values

The Display impl for ProviderType returns the exact strings defined by your serde renames (azure, openai, anthropic, bedrock, vertexai), so no updates are necessary.

src/pipelines/pipeline.rs (4)

235-237: ProviderType enum adoption in MockProvider looks good

Returning ProviderType::OpenAI aligns with the trait change and keeps tests simple.


269-269: Tests updated to use ProviderType in ProviderConfig

Solid update; keeps tests aligned with the strongly-typed provider identification.


343-350: Multiple provider test configs: enum usage is consistent

Both providers updated to ProviderType::OpenAI. Looks consistent for the test scenario.


579-588: Standardize vendor attribute values and verify intended mapping

The expected values mix cases (“openai” vs “Anthropic”, “Azure”) and map cloud providers as “AWS”/“Google” (vs “bedrock”/“vertexai” as described in the PR objectives). For OTEL attributes, consistent, low-cardinality, normalized strings are preferable. Please confirm intended values across the project and dashboards, then standardize.

Suggestions:

  • Option A (normalized slugs): "openai", "anthropic", "azure", "aws", "google"
  • Option B (proper names): "OpenAI", "Anthropic", "Azure", "AWS", "Google"

If you choose A, adjust get_vendor_name and these assertions accordingly.

Likely an incorrect or invalid review comment.

Copy link
Contributor

@ellipsis-dev ellipsis-dev bot left a comment

Choose a reason for hiding this comment

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

Important

Looks good to me! 👍

Reviewed 2d0a06b in 49 seconds. Click for details.
  • Reviewed 30 lines of code in 1 files
  • Skipped 0 files when reviewing.
  • Skipped posting 2 draft comments. View those below.
  • Modify your settings and rules to customize what types of comments Ellipsis leaves. And don't forget to react with 👍 or 👎 to teach Ellipsis.
1. src/providers/provider.rs:39
  • Draft comment:
    Suggestion: Since all vendor names are static string literals, consider returning &'static str instead of Cow<'static, str> to simplify the API, unless dynamic allocation is anticipated in the future.
  • Reason this comment was not posted:
    Confidence changes required: 33% <= threshold 50% None
2. src/providers/provider.rs:41
  • Draft comment:
    Note: Verify consistency in vendor name capitalization (e.g., 'openai' is lowercase while others are not) to ensure it matches OTEL reporting standards.
  • Reason this comment was not posted:
    Confidence changes required: 33% <= threshold 50% None

Workflow ID: wflow_6FjmNNyICsJ1Zgfl

You can customize Ellipsis by changing your verbosity settings, reacting with 👍 or 👎, replying to comments, or adding code review rules.

@doronkopit5 doronkopit5 merged commit 04e460c into main Aug 12, 2025
3 checks passed
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.

2 participants