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

Build instrumentation-genai/README.md #3400

Merged
merged 5 commits into from
Apr 2, 2025

Conversation

xrmx
Copy link
Contributor

@xrmx xrmx commented Apr 1, 2025

Description

Build instrumentation-genai/README.md as we do for common instrumentations

Type of change

Please delete options that are not relevant.

  • 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)
  • This change requires a documentation update

How Has This Been Tested?

Please describe the tests that you ran to verify your changes. Provide instructions so we can reproduce. Please also list any relevant details for your test configuration

  • tox -e generate

Does This PR Require a Core Repo Change?

  • Yes. - Link to PR:
  • No.

Checklist:

See contributing.md for styleguide, changelog guidelines, and more.

  • Followed the style guidelines of this project
  • Changelogs have been updated
  • Unit tests have been added
  • Documentation has been updated

@xrmx xrmx requested a review from a team as a code owner April 1, 2025 09:41
@xrmx xrmx added the Skip Changelog PRs that do not require a CHANGELOG.md entry label Apr 1, 2025
@xrmx xrmx requested a review from michaelsafyan April 1, 2025 09:41
@xrmx xrmx enabled auto-merge (squash) April 2, 2025 09:39
@xrmx xrmx merged commit ff18e7c into open-telemetry:main Apr 2, 2025
720 checks passed
@@ -0,0 +1,6 @@

| Instrumentation | Supported Packages | Metrics support | Semconv status |
Copy link
Contributor

Choose a reason for hiding this comment

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

I'm curious why only one signal type "Metrics" is listed there. Would it make sense to list all of the signal types?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This is the same format as the other instrumentations, no idea what the original intent but here we are just running the same thing on another dir.


| Instrumentation | Supported Packages | Metrics support | Semconv status |
| --------------- | ------------------ | --------------- | -------------- |
| [opentelemetry-instrumentation-google-genai](./opentelemetry-instrumentation-google-genai) | google-genai >= 1.0.0 | No | development
Copy link
Contributor

Choose a reason for hiding this comment

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

It's not correct that the google-genai instrumentation does not include metrics. That code emits client metrics for Gen AI. See:

Copy link
Contributor Author

@xrmx xrmx Apr 3, 2025

Choose a reason for hiding this comment

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

Sorry, care to update package.py like I did for openai ? It would be faster to have me approve and merge :)

# See the License for the specific language governing permissions and
# limitations under the License.

_instruments = ("google-genai >= 1.0.0",)
Copy link
Contributor

Choose a reason for hiding this comment

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

There now appear to be multiple places where this information exists:

Is there a way to have a single source of truth for this information?

For example, can instrumentor.py be updated to load the value from package.py? Can the optional dependency in pyproject.toml somehow dynamically reference this value? Or is there some other way to keep these in sync?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

There is probably a way in hatch so use a dynamic value, maybe https://hatch.pypa.io/1.13/how-to/config/dynamic-metadata/

root_path = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
base_instrumentation_path = os.path.join(root_path, "instrumentation")

def main(base_instrumentation_path):
Copy link
Contributor

Choose a reason for hiding this comment

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

Do the package.py files exist solely for the purpose of supporting this?

If so, I'm wondering if it might sense to use some other data format (e.g. metadata.yaml or something else) that will make it more obvious that it is not part of the instrumentation package and just information about the instrumentation package that is used for this kind of purpose.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It's used by most of the Instrumentor classes to implement instrumentation_dependencies and so used to catch dependency conflicts.

Copy link
Member

Choose a reason for hiding this comment

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

@michaelsafyan also used by instrumentors.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Skip Changelog PRs that do not require a CHANGELOG.md entry
Projects
None yet
Development

Successfully merging this pull request may close these issues.