Skip to content

Conversation

ishleenk17
Copy link
Member

@ishleenk17 ishleenk17 commented Sep 4, 2025

Proposed commit message

Add a new metricset to support prompt and response logging for GCP VertexAI Logging by querying the BigQuery Table

Checklist

  • My code follows the style guidelines of this project
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • I have made corresponding change to the default configuration files
  • I have added tests that prove my fix is effective or that my feature works
  • I have added an entry in CHANGELOG.next.asciidoc or CHANGELOG-developer.next.asciidoc.

Issue

Screenshots

Screenshot 2025-09-04 at 7 05 20 PM

TODO:

  • 1. Update README
  • 2. Check if performance can be improved for data fetch from the BigQuery table.
  • 3. Update the data.json
  • 4. Check deduplication works with GenerateEventID()
  • 5. Finalize the default fetch period
  • 6. Add tests

@ishleenk17 ishleenk17 self-assigned this Sep 4, 2025
@botelastic botelastic bot added the needs_team Indicates that the issue/PR needs a Team:* label label Sep 4, 2025
Copy link
Contributor

github-actions bot commented Sep 4, 2025

🤖 GitHub comments

Expand to view the GitHub comments

Just comment with:

  • run docs-build : Re-trigger the docs validation. (use unformatted text in the comment!)

Copy link
Contributor

mergify bot commented Sep 4, 2025

This pull request does not have a backport label.
If this is a bug or security fix, could you label this PR @ishleenk17? 🙏.
For such, you'll need to label your PR with:

  • The upcoming major version of the Elastic Stack
  • The upcoming minor version of the Elastic Stack (if you're not pushing a breaking change)

To fixup this pull request, you need to add the backport labels for the needed
branches, such as:

  • backport-8./d is the label to automatically backport to the 8./d branch. /d is the digit
  • backport-active-all is the label that automatically backports to all active branches.
  • backport-active-8 is the label that automatically backports to all active minor branches for the 8 major.
  • backport-active-9 is the label that automatically backports to all active minor branches for the 9 major.

Copy link
Contributor

github-actions bot commented Sep 4, 2025

Copy link
Contributor

@colleenmcginnis colleenmcginnis left a comment

Choose a reason for hiding this comment

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

@ishleenk17 all these changes are expected in the generated docs based on your changes in x-pack/metricbeat/module/gcp/vertexai_logs/_meta/docs.md and x-pack/metricbeat/module/gcp/vertexai_logs/_meta/fields.yml. Some notes below.

@ishleenk17 ishleenk17 marked this pull request as ready for review September 9, 2025 04:58
@ishleenk17 ishleenk17 requested review from a team as code owners September 9, 2025 04:58
Copy link
Contributor

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR introduces a new metricset called vertexai_logs for the GCP module in Metricbeat to collect Vertex AI prompt-response logs from BigQuery. The metricset enables monitoring and analysis of AI model usage by querying BigQuery tables that contain exported Vertex AI interaction logs.

Key changes include:

  • New vertexai_logs metricset implementation with BigQuery integration
  • Configuration support for BigQuery table access and credentials
  • Comprehensive test coverage and documentation

Reviewed Changes

Copilot reviewed 18 out of 18 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
x-pack/metricbeat/module/gcp/vertexai_logs/vertexai_logs.go Core metricset implementation with BigQuery client and data fetching logic
x-pack/metricbeat/module/gcp/vertexai_logs/data.go Data structures and event creation logic for Vertex AI log rows
x-pack/metricbeat/module/gcp/vertexai_logs/vertexai_logs_test.go Comprehensive test suite covering query generation, event creation, and data mapping
x-pack/metricbeat/module/gcp/vertexai_logs/_meta/fields.yml Field definitions for the vertexai_logs metricset
x-pack/metricbeat/module/gcp/vertexai_logs/_meta/docs.md Documentation explaining the metricset functionality and configuration
x-pack/metricbeat/module/gcp/vertexai_logs/_meta/data.json Sample event data for the metricset
Configuration and reference files Updates to enable and document the new metricset

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

@ishleenk17 ishleenk17 enabled auto-merge (squash) September 16, 2025 19:13
@ishleenk17 ishleenk17 merged commit e3c6cce into elastic:main Sep 16, 2025
37 checks passed
@ishleenk17 ishleenk17 added the backport-9.1 Automated backport to the 9.1 branch label Sep 16, 2025
mergify bot pushed a commit that referenced this pull request Sep 16, 2025
* VertexAI Initial draft- prompt response logging

* Add changelog

* make update

* Add test file

* Add documentation

* Update docs

* Update documentaion and make update

* Resolve lint errors

* Updated test file

* Remove test file

* Add test file

* update test file

* Update x-pack/metricbeat/module/gcp/vertexai_logs/_meta/docs.md

Co-authored-by: Copilot <[email protected]>

* Update the partiotin logic in BigQuery

* Add support of logging time filtering

* reshuffle imports in vertexai_logs_test.go

* Add string datatype for request id

* Address comments

* Remove the otel_log field

* Update vertexai_logs.go

* Update vertexai_logs_test.go

* Replace run with read

* Linter error

* linter fix

* LINTER ERROR

* rerun make update

---------

Co-authored-by: Copilot <[email protected]>
Co-authored-by: Mykola Kmet <[email protected]>
Co-authored-by: Colleen McGinnis <[email protected]>
(cherry picked from commit e3c6cce)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport-9.1 Automated backport to the 9.1 branch Team:Elastic-Agent-Data-Plane Label for the Agent Data Plane team Team:obs-ds-hosted-services Label for the Observability Hosted Services team Team:Obs-InfraObs Label for the Observability Infrastructure Monitoring team
Projects
None yet
Development

Successfully merging this pull request may close these issues.

9 participants