Skip to content
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

cost tracking for otel_tracing #1569

Merged
merged 32 commits into from
Nov 6, 2024
Merged

Conversation

sfc-gh-pmardziel
Copy link
Contributor

@sfc-gh-pmardziel sfc-gh-pmardziel commented Oct 17, 2024

Description

OTEL cost tracing

Adding cost tracking to the experimental otel-based tracing for these providers:

  • Huggingface
  • DummyHuggingface
  • Dummy

Part of the code for the other endpoints is included but rest needs to be brought in from #1168 :

  • OpenAI partially brought in but needs testing.
  • Other endpoints not brought in.

Wrapper class refinement

Updated the classes used to wrap instrumented functions being used for both cost tracking and record information. The classes that store various handlers now have type variables indicating what they expect on the handler signatures.

Experimental feature optional modules

Added template for dealing with optional modules required for experimental features. Initial demonstration is for otel_tracing in trulens.experimental.otel_tracing._feature.py which is hooked into the feature disable/enable system so that:

from trulens.core.session import TruSession
session = TruSession()
session.experimental_enable_feature("otel_tracing")

Will print out the following if the packages needed for this feature are not installed:

ModuleNotFoundError: These packages are required for otel_tracing experimental feature:

    opentelemetry-api,opentelemetry-sdk

You should be able to install them with pip:

    ```bash
    pip install "opentelemetry-api>=1.0.0" "opentelemetry-sdk>=1.0.0"
    ```

Smaller things

  • Fixed handling of OptionalImport if fromlist is used.
  • Added more testing to dummy_example.ipynb. Included now are parallel invocations of apps using both threads and async.
  • Fixed some deadlock issues with App.wait_for_feedback_results.
  • Added some logic to Endpoint methods that retry request to not retry them for particular types of errors like those indicating misconfiguration (bad authentication, etc.).
  • Added async versions of pacing methods in Endpoint as implemented by Pace.
  • Split off http post request part of Endpoint into a mixin called WithPost. Modified the post method to have identical signature to requests.post.
  • Added more documentation to Cost class fields to better indicate their interpretation.
  • Made Record.experimental_otel_spans be properly serializable and deserializable meaning it is now available for deferred feedback.
  • Added methods for singletons/ref tracking classes to replicate resetting functionality that was recently removed.
  • Added env flag to test_endpoints.py that enables the otel_tracing experimental feature when running the tests.

Other details good to know for developers

Please include any other details of this change useful for TruLens developers.

Type of change

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to
    not work as expected)
  • New Tests
  • This change includes re-generated golden test results
  • This change requires a documentation update

Important

Add cost tracking for OTEL-based tracing in Huggingface, DummyHuggingface, and Dummy providers, with refinements to wrapper classes and experimental feature support.

  • Behavior:
    • Add cost tracking to OTEL-based tracing for Huggingface, DummyHuggingface, and Dummy providers.
    • Implement _WrapperEndpointCallback in core/feedback/endpoint.py for cost tracking.
    • Update LiveSpanCallWithCost in core/trace.py to include cost tracking.
  • Experimental Features:
    • Add template for optional modules in feature.py for experimental features like otel_tracing.
    • Enable experimental OTEL tracing feature in test_endpoints.py.
  • Refinements:
    • Refine wrapper classes for instrumented functions in core/_utils/wrap.py.
    • Improve handling of optional imports in core/utils/imports.py.
  • Miscellaneous:
    • Update docstrings in core/schema/base.py, core/schema/record.py, core/schema/select.py, and core/session.py to reflect EXPERIMENTAL(otel_tracing).
    • Minor formatting and logging changes in core/app.py and core/instruments.py.
    • Fix typo in README.md.

This description was created by Ellipsis for c07ec92. It will automatically update as commits are pushed.

@dosubot dosubot bot added the size:L This PR changes 100-499 lines, ignoring generated files. label Oct 17, 2024
Copy link

Check out this pull request on  ReviewNB

See visual diffs & provide feedback on Jupyter Notebooks.


Powered by ReviewNB

@sfc-gh-pmardziel sfc-gh-pmardziel changed the title cost tracking for otel_tracing [DRAFT] cost tracking for otel_tracing Oct 17, 2024
@sfc-gh-pmardziel sfc-gh-pmardziel marked this pull request as draft October 17, 2024 22:01
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.

👍 Looks good to me! Reviewed everything up to 6e400c8 in 30 seconds

More details
  • Looked at 267 lines of code in 7 files
  • Skipped 2 files when reviewing.
  • Skipped posting 3 drafted comments based on config settings.
1. src/core/trulens/experimental/otel_tracing/core/app.py:20
  • Draft comment:
    Remove the TODO comment as it is not necessary and does not add value to the code.
  • Reason this comment was not posted:
    Confidence changes required: 10%
    The comment is not necessary as the code is self-explanatory. The comment is also not consistent with the rest of the codebase where such comments are not used.
2. src/core/trulens/experimental/otel_tracing/core/app.py:139
  • Draft comment:
    Remove the comment as it is not necessary and does not add value to the code.
  • Reason this comment was not posted:
    Confidence changes required: 10%
    The comment is not necessary as the code is self-explanatory. The comment is also not consistent with the rest of the codebase where such comments are not used.
3. src/core/trulens/experimental/otel_tracing/core/app.py:165
  • Draft comment:
    Remove the comment as it is not necessary and does not add value to the code.
  • Reason this comment was not posted:
    Confidence changes required: 10%
    The comment is not necessary as the code is self-explanatory. The comment is also not consistent with the rest of the codebase where such comments are not used.

Workflow ID: wflow_UnvBrRMeILGV5iei


You can customize Ellipsis with 👍 / 👎 feedback, review rules, user-specific overrides, quiet mode, and more.

@sfc-gh-pmardziel sfc-gh-pmardziel marked this pull request as ready for review October 25, 2024 02:36
@dosubot dosubot bot added size:XXL This PR changes 1000+ lines, ignoring generated files. and removed size:L This PR changes 100-499 lines, ignoring generated files. labels Oct 25, 2024
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.

👍 Looks good to me! Reviewed everything up to e491efe in 55 seconds

More details
  • Looked at 4241 lines of code in 31 files
  • Skipped 3 files when reviewing.
  • Skipped posting 3 drafted comments based on config settings.
1. src/providers/bedrock/trulens/providers/bedrock/endpoint.py:158
  • Draft comment:
    Ensure body is not a str before iterating, as str is a Sequence but not iterable in the intended way. This could lead to unexpected behavior if body is a string.
  • Reason this comment was not posted:
    Comment did not seem useful.
2. src/providers/huggingface/trulens/providers/huggingface/endpoint.py:61
  • Draft comment:
    Consider normalizing the URL or using a more flexible check to ensure all valid Huggingface API calls are tracked, even if they have trailing slashes or different subdomains.
  • Reason this comment was not posted:
    Confidence changes required: 50%
    In src/providers/huggingface/trulens/providers/huggingface/endpoint.py, the on_callable_call method in _WrapperHuggingfaceEndpointCallback class checks if the URL starts with https://api-inference.huggingface.co. However, it does not handle cases where the URL might have trailing slashes or different subdomains. This could lead to missed tracking for valid Huggingface API calls.
3. src/providers/litellm/trulens/providers/litellm/endpoint.py:84
  • Draft comment:
    Ensure the usage field exists in the response before accessing it to prevent potential errors.
  • Reason this comment was not posted:
    Comment did not seem useful.

Workflow ID: wflow_wnVNXYRCiUCiqCtN


You can customize Ellipsis with 👍 / 👎 feedback, review rules, user-specific overrides, quiet mode, and more.

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.

👍 Looks good to me! Incremental review on 5fcc28c in 46 seconds

More details
  • Looked at 432 lines of code in 20 files
  • Skipped 1 files when reviewing.
  • Skipped posting 8 drafted comments based on config settings.
1. tests/e2e/test_context_variables.py:21
  • Draft comment:
    Ensure that the environment variables for Snowflake connection are set before running the tests to avoid connection issues.
  • Reason this comment was not posted:
    Confidence changes required: 50%
    The test case is using an environment variable for the Snowflake account, which might not be set during test execution. This could lead to test failures if the environment is not properly configured.
2. tests/e2e/test_context_variables.py:22
  • Draft comment:
    Ensure that the environment variables for Snowflake connection are set before running the tests to avoid connection issues.
  • Reason this comment was not posted:
    Confidence changes required: 50%
    The test case is using an environment variable for the Snowflake user, which might not be set during test execution. This could lead to test failures if the environment is not properly configured.
3. tests/e2e/test_context_variables.py:23
  • Draft comment:
    Ensure that the environment variables for Snowflake connection are set before running the tests to avoid connection issues.
  • Reason this comment was not posted:
    Confidence changes required: 50%
    The test case is using an environment variable for the Snowflake user password, which might not be set during test execution. This could lead to test failures if the environment is not properly configured.
4. tests/e2e/test_context_variables.py:24
  • Draft comment:
    Ensure that the environment variables for Snowflake connection are set before running the tests to avoid connection issues.
  • Reason this comment was not posted:
    Confidence changes required: 50%
    The test case is using an environment variable for the Snowflake database, which might not be set during test execution. This could lead to test failures if the environment is not properly configured.
5. tests/e2e/test_context_variables.py:25
  • Draft comment:
    Ensure that the environment variables for Snowflake connection are set before running the tests to avoid connection issues.
  • Reason this comment was not posted:
    Confidence changes required: 50%
    The test case is using an environment variable for the Snowflake role, which might not be set during test execution. This could lead to test failures if the environment is not properly configured.
6. tests/e2e/test_context_variables.py:26
  • Draft comment:
    Ensure that the environment variables for Snowflake connection are set before running the tests to avoid connection issues.
  • Reason this comment was not posted:
    Confidence changes required: 50%
    The test case is using an environment variable for the Snowflake warehouse, which might not be set during test execution. This could lead to test failures if the environment is not properly configured.
7. tests/e2e/test_context_variables.py:27
  • Draft comment:
    Ensure that the environment variables for Snowflake connection are set before running the tests to avoid connection issues.
  • Reason this comment was not posted:
    Confidence changes required: 50%
    The test case is using an environment variable for the Snowflake schema, which might not be set during test execution. This could lead to test failures if the environment is not properly configured.
8. tests/e2e/test_context_variables.py:73
  • Draft comment:
    Consider implementing a more reliable method to verify if the context variable is cleaned up properly after test execution.
  • Reason this comment was not posted:
    Confidence changes required: 50%
    The test case uses a TODO comment to indicate that a better way to check if the context variable is cleaned should be found. This indicates that the current method might not be reliable or optimal.

Workflow ID: wflow_emxz1Hm0H4mDnFrN


You can customize Ellipsis with 👍 / 👎 feedback, review rules, user-specific overrides, quiet mode, and more.

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.

👍 Looks good to me! Incremental review on 24f31e4 in 41 seconds

More details
  • Looked at 391 lines of code in 2 files
  • Skipped 0 files when reviewing.
  • Skipped posting 0 drafted comments based on config settings.

Workflow ID: wflow_VcrVsgwzwS3UrZz0


You can customize Ellipsis with 👍 / 👎 feedback, review rules, user-specific overrides, quiet mode, and more.

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.

👍 Looks good to me! Incremental review on 356bb2b in 33 seconds

More details
  • Looked at 145 lines of code in 3 files
  • Skipped 0 files when reviewing.
  • Skipped posting 1 drafted comments based on config settings.
1. src/feedback/trulens/feedback/dummy/endpoint.py:615
  • Draft comment:
    The comment is misleading. The code handles responses from the huggingface API and dummy completion API, not OpenAI completion.
  • Reason this comment was not posted:
    Decided after close inspection that this draft comment was likely wrong and/or not actionable:
    The comment points out that the docstring was updated to reflect that the code handles responses from huggingface and a dummy completion API, not OpenAI. This aligns with the change made in the diff, which removed the mention of OpenAI and replaced it with a dummy completion API. The comment seems to be reinforcing the change made in the diff, which is valid.
    I might be overthinking the necessity of the comment since the change in the docstring already clarifies the intended functionality. The comment might be redundant.
    The comment serves as a confirmation that the change in the docstring aligns with the actual functionality of the code, which can be useful for clarity.
    Keep the comment as it confirms the accuracy of the updated docstring, which aligns with the change made in the diff.

Workflow ID: wflow_jmO8NB7nz8wB3YcU


You can customize Ellipsis with 👍 / 👎 feedback, review rules, user-specific overrides, quiet mode, and more.

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.

👍 Looks good to me! Incremental review on 0ac6f5a in 33 seconds

More details
  • Looked at 2331 lines of code in 54 files
  • Skipped 23 files when reviewing.
  • Skipped posting 1 drafted comments based on config settings.
1. src/providers/huggingface/trulens/providers/huggingface/provider.py:360
  • Draft comment:
    The _tci decorator does not handle None values for string inputs. Consider adding a check for None before checking if the string is non-empty to avoid potential errors.
  • Reason this comment was not posted:
    Confidence changes required: 50%
    The code in src/providers/huggingface/trulens/providers/huggingface/provider.py has a potential issue with the _tci decorator. The decorator checks for non-empty strings but does not handle cases where the input might be None. This could lead to unexpected errors if None is passed as an argument. The decorator should be updated to handle None values appropriately.

Workflow ID: wflow_lt3BfNw4YXprsmtA


You can customize Ellipsis with 👍 / 👎 feedback, review rules, user-specific overrides, quiet mode, and more.

Copy link
Contributor

@sfc-gh-dhuang sfc-gh-dhuang left a comment

Choose a reason for hiding this comment

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

Finished first round of reviewing. (note to self) I haven't looked in details the files wrap.py, otel.py, trace.py, and the different provider / endpoint classes

records.append(record)

return records
yield record
Copy link
Contributor

Choose a reason for hiding this comment

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

so I assume this is to avoid waiting on long blocking feedback computation. just curious what are some of the actual deadlock scenarios you've seen?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I have seen deadlocks deeper in wait_for_feedback_results which I couldn't fully explain. This change is to make things a bit more robust but wouldn't really fully address deadlocks if they are still there.

@@ -50,6 +56,15 @@
https://www.trulens.org/component_guides/other/no_context_warning for more information.
"""

_RE_NO_RETRY = re.compile(
"("
+ ("|".join(["authentication", "unauthorized", "expired", "quota"]))
Copy link
Contributor

Choose a reason for hiding this comment

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

does this cover invalid (400 error code) type of errors (or are those not relevant / not available as Exception here) ?

Copy link
Contributor Author

@sfc-gh-pmardziel sfc-gh-pmardziel Nov 6, 2024

Choose a reason for hiding this comment

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

I'm unsure what error codes are associated with the text checks I did. Error codes might be a more robust approach than looking at the text as is implemented now. Can we make that a todo?

session = core_session.TruSession()

if session.experimental_feature(
core_experimental.Feature.OTEL_TRACING, lock=True
Copy link
Contributor

Choose a reason for hiding this comment

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

nit on semantics: can we rename the parameter lock to something like locked, to reflect it being a boolean?

when I read lock=True I would think of the lock primitive for synchronization, instead of locking the feature / making the feature immutable.

Open to suggestions other than "locked", and not meant to be a blocking comment.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Renamed to "freeze" and "frozen".

) -> Dict:
"""Wraps `post` with json()[0]."""

return self.post(url=url, json=json, timeout=timeout).json()[0]
Copy link
Contributor

Choose a reason for hiding this comment

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

can the response returned by requests.post be empty list / not a list and result in indexing error at json()[0]?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

added checks for this

) -> Dict:
"""Wraps `apost` with json()[0]."""

return (await self.apost(url=url, json=json, timeout=timeout)).json()[0]
Copy link
Contributor

Choose a reason for hiding this comment

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

same as above, could we handle the potential index error for json()[0] (or verify if this won't ever happen)?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

same

src/core/trulens/core/schema/record.py Show resolved Hide resolved

else:
# Acquire was used with blocking=False and the lock would have
# blocked.
Copy link
Contributor

Choose a reason for hiding this comment

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

shouldn't this read sth like
Acquire was used with blocking=False and should return immediately if the lock is not yet released?

or maybe I'm misunderstanding the comment here

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I think we are both saying the same thing. Added some more text to maybe unify.

"mode": "completion",
"model": model,
"prompt": prompt,
"temperature": temperature,
"args": args, # include extra args to see them in post span
},
)
).json()[0]
Copy link
Contributor

Choose a reason for hiding this comment

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

same concern as in other instances of using json()[0] - could we verify if indexing error is not going to happen here?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

_fake_completion and _fake_classification are the only status 200 returns in DummyAPI so here we can be sure of [0] existing. Added a check for status code just in case post returns without raising error on non-200 statuses.

"mode": "classification",
"model": model,
"inputs": text,
"args": args, # include extra args to see them in post span
},
)
).json()[0]
Copy link
Contributor

Choose a reason for hiding this comment

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

see above comments regarding json()[0]

Copy link
Contributor Author

Choose a reason for hiding this comment

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

same fix

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.

👍 Looks good to me! Incremental review on 5c73258 in 51 seconds

More details
  • Looked at 278 lines of code in 5 files
  • Skipped 1 files when reviewing.
  • Skipped posting 3 drafted comments based on config settings.
1. tests/e2e/test_snowflake_notebooks.py:36
  • Draft comment:
    Consider using a context manager for tempfile.TemporaryDirectory() to ensure the temporary directory is always cleaned up, even if an exception occurs.
with tempfile.TemporaryDirectory() as tmp_directory:
  • Reason this comment was not posted:
    Confidence changes required: 50%
    The code in test_snowflake_notebooks.py uses tempfile.TemporaryDirectory() but does not handle the case where the directory might not be cleaned up if an exception occurs before the finally block. Using a context manager would ensure that the directory is always cleaned up.
2. src/connectors/snowflake/trulens/connectors/snowflake/utils/server_side_evaluation_artifacts.py:23
  • Draft comment:
    Consider automating the retrieval of package versions for _TRULENS_PACKAGES_DEPENDENCIES to ensure they are always up-to-date.
  • Reason this comment was not posted:
    Confidence changes required: 50%
    In server_side_evaluation_artifacts.py, the _TRULENS_PACKAGES_DEPENDENCIES list is hardcoded. It would be better to automate the retrieval of these package versions to ensure they are always up-to-date.
3. src/core/trulens/core/database/sqlalchemy.py:548
  • Draft comment:
    The workaround for handling None values in Snowflake should be documented more clearly, and consider seeking a more robust solution if possible.
  • Reason this comment was not posted:
    Confidence changes required: 50%
    In sqlalchemy.py, the insert_feedback method uses a hack for Snowflake to handle None values. This workaround should be documented more clearly, and ideally, a more robust solution should be sought.

Workflow ID: wflow_GxZ8F2JVeTccI0O1


You can customize Ellipsis with 👍 / 👎 feedback, review rules, user-specific overrides, quiet mode, and more.

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.

👍 Looks good to me! Incremental review on c9e2c13 in 1 minute and 13 seconds

More details
  • Looked at 701 lines of code in 9 files
  • Skipped 0 files when reviewing.
  • Skipped posting 6 drafted comments based on config settings.
1. src/core/trulens/core/experimental/__init__.py:143
  • Draft comment:
    The term 'lock' has been consistently replaced with 'freeze' throughout this file. This change aligns the terminology with the intended functionality of preventing further changes to a setting once it is set. Ensure that this semantic change is communicated to all relevant stakeholders to avoid confusion.
  • Reason this comment was not posted:
    Confidence changes required: 10%
    The change from 'lock' to 'freeze' is consistent and aligns with the intended functionality of preventing further changes to a setting once it is set. This is a semantic change that should be communicated to all relevant stakeholders to avoid confusion.
2. src/core/trulens/core/feedback/endpoint.py:572
  • Draft comment:
    The term 'lock' has been replaced with 'freeze' to better reflect the functionality of preventing further changes to a setting once it is set. This change is consistent with the rest of the codebase.
  • Reason this comment was not posted:
    Confidence changes required: 10%
    The change from 'lock' to 'freeze' is consistent and aligns with the intended functionality of preventing further changes to a setting once it is set. This is a semantic change that should be communicated to all relevant stakeholders to avoid confusion.
3. src/core/trulens/core/instruments.py:573
  • Draft comment:
    The term 'lock' has been replaced with 'freeze' to better reflect the functionality of preventing further changes to a setting once it is set. This change is consistent with the rest of the codebase.
  • Reason this comment was not posted:
    Confidence changes required: 10%
    The change from 'lock' to 'freeze' is consistent and aligns with the intended functionality of preventing further changes to a setting once it is set. This is a semantic change that should be communicated to all relevant stakeholders to avoid confusion.
4. src/core/trulens/experimental/otel_tracing/core/session.py:27
  • Draft comment:
    The term 'lock' has been replaced with 'freeze' to better reflect the functionality of preventing further changes to a setting once it is set. This change is consistent with the rest of the codebase.
  • Reason this comment was not posted:
    Confidence changes required: 10%
    The change from 'lock' to 'freeze' is consistent and aligns with the intended functionality of preventing further changes to a setting once it is set. This is a semantic change that should be communicated to all relevant stakeholders to avoid confusion.
5. src/core/trulens/experimental/otel_tracing/core/trace.py:433
  • Draft comment:
    The term 'lock' has been replaced with 'freeze' to better reflect the functionality of preventing further changes to a setting once it is set. This change is consistent with the rest of the codebase.
  • Reason this comment was not posted:
    Confidence changes required: 10%
    The change from 'lock' to 'freeze' is consistent and aligns with the intended functionality of preventing further changes to a setting once it is set. This is a semantic change that should be communicated to all relevant stakeholders to avoid confusion.
6. src/feedback/trulens/feedback/dummy/endpoint.py:406
  • Draft comment:
    The change to check the response status code and raise an error if it's not 200 is a good addition for error handling. This ensures that unexpected responses are caught early.
  • Reason this comment was not posted:
    Confidence changes required: 10%
    The change from 'lock' to 'freeze' is consistent and aligns with the intended functionality of preventing further changes to a setting once it is set. This is a semantic change that should be communicated to all relevant stakeholders to avoid confusion.

Workflow ID: wflow_qC2dfXGy8F7eCPTC


You can customize Ellipsis with 👍 / 👎 feedback, review rules, user-specific overrides, quiet mode, and more.

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.

❌ Changes requested. Incremental review on c07ec92 in 53 seconds

More details
  • Looked at 13 lines of code in 1 files
  • Skipped 1 files when reviewing.
  • Skipped posting 0 drafted comments based on config settings.

Workflow ID: wflow_8xhz56k3NCOVX6OV


Want Ellipsis to fix these issues? Tag @ellipsis-dev in a comment. You can customize Ellipsis with 👍 / 👎 feedback, review rules, user-specific overrides, quiet mode, and more.

@@ -182,6 +180,8 @@ def experimental_otel_exporter(
def experimental_otel_exporter(
self, value: Optional[Any]
): # Any = otel_export_sdk.SpanExporter
otel_tracing_feature._FeatureSetup.assert_optionals_installed()
Copy link
Contributor

Choose a reason for hiding this comment

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

Accessing a private method _FeatureSetup.assert_optionals_installed() is not recommended as it can lead to maintenance issues. Consider using a public interface instead.

Copy link
Contributor

@sfc-gh-dhuang sfc-gh-dhuang left a comment

Choose a reason for hiding this comment

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

@sfc-gh-pmardziel Could you document the progress of implementing each Endpoint class in the PR description (i.e. Huggingface is done vs OpenAI is WIP vs Cortex is not started), so that we could pick it up and finish them in the following week?

@dosubot dosubot bot added the lgtm This PR has been approved by a maintainer label Nov 6, 2024
@sfc-gh-pmardziel
Copy link
Contributor Author

@sfc-gh-pmardziel Could you document the progress of implementing each Endpoint class in the PR description (i.e. Huggingface is done vs OpenAI is WIP vs Cortex is not started), so that we could pick it up and finish them in the following week?

Did this.

@sfc-gh-pmardziel sfc-gh-pmardziel merged commit b98f42a into main Nov 6, 2024
8 checks passed
@sfc-gh-pmardziel sfc-gh-pmardziel deleted the piotrm/otel-cost-tracking branch November 6, 2024 23:01
sfc-gh-chu added a commit that referenced this pull request Nov 19, 2024
* Bump version to 1.2.6. (#1635)

* Bump version to 1.2.6.

* Update `meta.yaml` files for conda packages.

* cost tracking for otel_tracing (#1569)

* cleaning up old PR

* adding cost tracking to dummy endpoint

* finishing dummy and starting bedrock

* finish up

* replacement for track_all_costs_tally

* docs

* fixing up dummy api

* added huggingface cost tracking for otel

* working on awaitables

* docs

* debugging async issue

* work

* async parallel fixes

* nit

* fix optional imports handling with fromlist

* remove print

* remove another print

* doc format

* put snowflake env var check back in test_endpoints

* remove context.run

* make feature private

* making more things private

* add type args

* nits

* addressing PR comments

* typo

* example: context filters with different speeds (models) (#1633)

* context filters with different speeds

* drop dup cell

* titling

* add all deps

---------

Co-authored-by: Josh Reini <[email protected]>

* fix docs typo about aggregate (#1640)

* Add Datec logo to homepage (#1643)

* datec logo

* update link

---------

Co-authored-by: Josh Reini <[email protected]>

* Backport TruLens to Python 3.8.1 (#1644)

* backport some packages to 3.8

* add to testing matrix

* fix optional test condition

* drop everything to 3.8 and resolve versioning issues

* use importlib-resources for 3.8 compatibility

* unpin langchain versions

* clean

* add future annotations

* more test fixes

* fix required test annotations

* one more

* fix install issues

* handle missing functools.cache in 3.8

* don't skip optional tests on 3.8

* support llama-index/tiktoken dep in 3.13

* disable 3.13 tests

* fix test: nemoguardrails supported in 3.12

* add restricted langchain versions

* If the Snowflake connector supplied to us has a "pyformat" paramstyle, fail fast and give helpful advice to fix it. (#1637)

* Remove all but root `poetry.lock` file. (#1653)

* fix missing description (#1645)

* change instrumentation arg `self` -> `_self` (#1656)

* change self -> _self

* note update

* Make Dashboard fully Streamlit 1.35.0 Native (SiS Compatible) (#1648)

* add optional flag for disabling non-native streamlit dependencies

* use feature flag and dependency update

* fix flag

* hide record_viewer on compat mode enabled

* update pills

* use streamlit pills if available

* wrap dashboard page entrypoints in fn

* hide record viewer here

* add compat utils for >=1.35 compatibility

* container compatibility

* fix st.code and pills code

* add dashboard to zip-wheels

* stage on sf and stuff

* fix ipywidgets compatible version for streamlit conflicts

* safe checks for query param key

* cleanup leaderboard

* cleanup artifact upload

* update golden api

* cleanup old recipe

* update comment

* fix langchain build issue

* update locks

* fix environment.yml creation

* update meta.yaml for other packages

* pr fixes

* cant use different database/schema from pkg stage

* revert examples change

* fmt

* fix server-side eval tests

* DRY sis dashboard code

* fix run_query typing

* default to native streamlit if packages not installed

* stage utils

* parameterize streamlit app name

* add sis_utils for sis dashboard

* add module string

* sis from snowflake connector init

* dataframe column filtering

* arg order

* display record and app json in place of record viewer

* wrap import in optional import

* wrap trulens.connectors.snowflake

* use native dataframe if st_aggrid is not installed

* api

* version bump

* ignore locks

---------

Co-authored-by: David Kurokawa <[email protected]>
Co-authored-by: Piotr Mardziel <[email protected]>
Co-authored-by: Josh Reini <[email protected]>
Co-authored-by: Josh Reini <[email protected]>
Co-authored-by: Daniel Huang <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
lgtm This PR has been approved by a maintainer size:XXL This PR changes 1000+ lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants