-
Notifications
You must be signed in to change notification settings - Fork 678
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix(instrumentation): replace api base url hardcoded value from watsonx #2173
fix(instrumentation): replace api base url hardcoded value from watsonx #2173
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @rajmanna-dev! Left a small comment. Can you sign the CLA?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@rajmanna-dev note that CI is failing - I think it's related to the import you added
@@ -14,6 +14,7 @@ | |||
from opentelemetry.trace.status import Status, StatusCode | |||
from opentelemetry.metrics import get_meter | |||
from opentelemetry.metrics import Counter, Histogram | |||
from sample-app.sample_app.watsonx-langchain import watsonx_llm_init |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
remove?
@@ -101,10 +102,15 @@ def _set_span_attribute(span, name, value): | |||
|
|||
|
|||
def _set_api_attributes(span): | |||
watsonx_llm = watsonx_llm_init() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why do you need this?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How can i extract url
directly from WatsonxLLM objcet.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
See the comment here I shared an example of how we've done it elsewhere - #2165 (review)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should i check the attribute 'url' of the instance and then set that to api_base_url variable.
Like:
if hasattr(instance, "url"):
api_base_url = instance.url
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Have you checked that the instance can actually have this attribute? I'd run one of the sample apps and see
Fixed #2163
I am a beginner in learning python, I don't know how to make or add test for this changes. I need guidence.
feat(instrumentation): ...
orfix(instrumentation): ...
.