Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
31 commits
Select commit Hold shift + click to select a range
629c206
VertexAI Initial draft- prompt response logging
ishleenk17 Sep 4, 2025
53f0461
Add changelog
ishleenk17 Sep 4, 2025
21366f7
make update
ishleenk17 Sep 4, 2025
0e8f5c8
Add test file
ishleenk17 Sep 4, 2025
ff778fd
Add documentation
ishleenk17 Sep 4, 2025
124e284
Update docs
ishleenk17 Sep 4, 2025
e7a3c9a
Update documentaion and make update
ishleenk17 Sep 5, 2025
cf6b361
Resolve lint errors
ishleenk17 Sep 5, 2025
62e8541
Merge branch 'main' into ish_gcp_vertexai_prompt_response
ishleenk17 Sep 5, 2025
11c9010
Updated test file
ishleenk17 Sep 5, 2025
c06a75d
Remove test file
ishleenk17 Sep 5, 2025
6f3d5d0
Add test file
ishleenk17 Sep 6, 2025
09bc676
update test file
ishleenk17 Sep 6, 2025
d050a1f
Update x-pack/metricbeat/module/gcp/vertexai_logs/_meta/docs.md
ishleenk17 Sep 9, 2025
162acd4
Merge branch 'main' into ish_gcp_vertexai_prompt_response
ishleenk17 Sep 9, 2025
f005382
Update the partiotin logic in BigQuery
ishleenk17 Sep 10, 2025
d72b583
Add support of logging time filtering
ishleenk17 Sep 11, 2025
475cf89
reshuffle imports in vertexai_logs_test.go
mykola-elastic Sep 11, 2025
44a151a
Add string datatype for request id
ishleenk17 Sep 11, 2025
27aea86
Merge branch 'main' into ish_gcp_vertexai_prompt_response
ishleenk17 Sep 11, 2025
1fcbea2
Merge branch 'main' into ish_gcp_vertexai_prompt_response
ishleenk17 Sep 15, 2025
f9b152b
Address comments
ishleenk17 Sep 16, 2025
336920e
Remove the otel_log field
ishleenk17 Sep 16, 2025
cecdb66
Update vertexai_logs.go
ishleenk17 Sep 16, 2025
02537e9
Update vertexai_logs_test.go
ishleenk17 Sep 16, 2025
c3bd7a9
Replace run with read
ishleenk17 Sep 16, 2025
9adad7b
Linter error
ishleenk17 Sep 16, 2025
7f51005
linter fix
ishleenk17 Sep 16, 2025
ee38195
LINTER ERROR
ishleenk17 Sep 16, 2025
dcd078f
Merge branch 'main' into ish_gcp_vertexai_prompt_response
colleenmcginnis Sep 16, 2025
14f1834
rerun make update
colleenmcginnis Sep 16, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .github/CODEOWNERS
Original file line number Diff line number Diff line change
Expand Up @@ -236,6 +236,7 @@ CHANGELOG*
/x-pack/metricbeat/module/coredns @elastic/obs-infraobs-integrations
/x-pack/metricbeat/module/enterprisesearch @elastic/app-search-team
/x-pack/metricbeat/module/gcp @elastic/obs-ds-hosted-services @elastic/obs-infraobs-integrations
/x-pack/metricbeat/module/gcp/vertexai_logs @elastic/obs-infraobs-integrations
/x-pack/metricbeat/module/gcp/billing @elastic/obs-infraobs-integrations
/x-pack/metricbeat/module/gcp/cloudrun_metrics @elastic/obs-infraobs-integrations
/x-pack/metricbeat/module/gcp/cloudsql_mysql @elastic/obs-infraobs-integrations
Expand Down
1 change: 1 addition & 0 deletions CHANGELOG.next.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -619,6 +619,7 @@ otherwise no tag is added. {issue}42208[42208] {pull}42403[42403]
- Add SSL support for sql module: drivers mysql, postgres, and mssql. {pull}44748[44748]
- Add support for Kafka 4.0 in the Kafka module. {pull}44723[44723]
- Add NTP response validation for system/ntp module. {pull}46184[46184]
- Add vertexai_logs metricset to GCP for prompt response collection from VertexAI service. {pull}46383[46383]

*Metricbeat*

Expand Down
84 changes: 84 additions & 0 deletions docs/reference/metricbeat/exported-fields-gcp.md
Original file line number Diff line number Diff line change
Expand Up @@ -1201,3 +1201,87 @@ Google Cloud Storage metrics
type: long


## vertexai_logs [_vertexai_logs]

```{applies_to}
stack: beta 9.2.0
```

Google Cloud Vertex AI Prompt Response Logs metrics

**`gcp.vertexai_logs.endpoint`**
: The Vertex AI API endpoint URL used for the request.

type: keyword


**`gcp.vertexai_logs.deployed_model_id`**
: The ID of the deployed model that processed the request.

type: keyword


**`gcp.vertexai_logs.logging_time`**
: Timestamp when the AI interaction was logged.

type: date


**`gcp.vertexai_logs.request_id`**
: Unique identifier for the AI request.

type: double


**`gcp.vertexai_logs.request_payload`**
: Array of request payload strings containing user prompts and inputs.

type: text

Field is not indexed.


**`gcp.vertexai_logs.response_payload`**
: Array of response payload strings containing AI model outputs.

type: text

Field is not indexed.


**`gcp.vertexai_logs.model`**
: Name of the AI model used (e.g., gemini-2.5-pro).

type: keyword


**`gcp.vertexai_logs.model_version`**
: Version of the AI model used.

type: keyword


**`gcp.vertexai_logs.api_method`**
: The API method called (e.g., generateContent, predict).

type: keyword


**`gcp.vertexai_logs.full_request`**
: Complete request object containing all request details in JSON format.

type: object


**`gcp.vertexai_logs.full_response`**
: Complete response object containing all response details in JSON format.

type: object


**`gcp.vertexai_logs.metadata`**
: Additional metadata associated with the AI interaction in JSON format.

type: object


184 changes: 184 additions & 0 deletions docs/reference/metricbeat/metricbeat-metricset-gcp-vertexai_logs.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,184 @@
---
mapped_pages:
- https://www.elastic.co/guide/en/beats/metricbeat/current/metricbeat-metricset-gcp-vertexai_logs.html
applies_to:
stack: beta 9.2.0
---

% This file is generated! See scripts/docs_collector.py

# Google Cloud Platform vertexai_logs metricset [metricbeat-metricset-gcp-vertexai_logs]

The `vertexai_logs` metricset is designed to collect Vertex AI prompt-response logs from GCP BigQuery. BigQuery is a fully-managed, serverless data warehouse that stores detailed logs of interactions with Vertex AI models.

Vertex AI logs export to BigQuery enables you to export detailed Google Cloud Vertex AI interaction data (such as prompts, responses, model usage, and metadata) automatically to a BigQuery dataset that you specify. Then you can access your Vertex AI logs from BigQuery for detailed analysis and monitoring using Metricbeat. This enables comprehensive tracking of AI model usage, performance monitoring, and cost analysis.

The logs include detailed information about:
- API endpoints and deployed models
- Request and response payloads
- Model versions and API methods used
- Request metadata and timing information


## Metricset-specific configuration notes [_metricset_specific_configuration_notes_14]

* **table_id**: (Required) Full table identifier in the format `project_id.dataset_id.table_name` that contains the Vertex AI logs data. You can copy this from the "Details" tab when viewing your table in the BigQuery web console, under the "Table ID" field.


## Configuration example [_configuration_example_22]

```yaml
- module: gcp
metricsets:
- vertexai_logs
period: 10m
project_id: "your project id"
credentials_file_path: "your JSON credentials file path"
table_id: "your_project.your_dataset.your_vertex_ai_logs_table"
```

## Sample Event

Here is a sample event for `vertexai_logs`:

```json
{
"@timestamp": "2023-12-01T10:30:45.000Z",
"cloud": {
"provider": "gcp",
"project": {
"id": "my-gcp-project"
}
},
"gcp": {
"vertexai_logs": {
"endpoint": "https://us-central1-aiplatform.googleapis.com",
"deployed_model_id": "1234567890123456789",
"logging_time": "2023-12-01T10:30:45.000Z",
"request_id": 98765432101234567,
"request_payload": ["What is machine learning?"],
"response_payload": ["Machine learning is a subset of artificial intelligence..."],
"model": "gemini-2.5-pro",
"model_version": "1.0",
"api_method": "generateContent",
"full_request": {
"inputs": ["What is machine learning?"],
"parameters": {
"temperature": 0.7
}
},
"full_response": {
"outputs": ["Machine learning is a subset of artificial intelligence..."],
"usage": {
"input_tokens": 5,
"output_tokens": 50
}
},
"metadata": {
"user_id": "user123",
"session_id": "session456"
}
}
}
}
```

## Fields [_fields]

For a description of each field in the metricset, see the [exported fields](/reference/metricbeat/exported-fields-gcp.md) section.

Here is an example document generated by this metricset:

```json
{
"@timestamp": "2025-09-02T10:14:50.313Z",
"agent": {
"hostname": "metricbeat-host",
"name": "metricbeat-host"
},
"cloud": {
"account": {
"id": "elastic-beats"
},
"provider": "gcp",
"project": {
"id": "elastic-beats"
}
},
"event": {
"dataset": "gcp.vertexai_logs",
"duration": 123456789,
"module": "gcp"
},
"gcp": {
"vertexai_logs": {
"endpoint": "https://us-central1-aiplatform.googleapis.com/v1/projects/elastic-beats/locations/us-central1/endpoints/123456789",
"deployed_model_id": "model-deployment-123",
"logging_time": "2025-09-02T10:14:50.313Z",
"request_id": 98765432101234567,
"model": "gemini-2.5-pro",
"model_version": "001",
"api_method": "generateContent",
"request_payload": [
"What is the weather like today?"
],
"response_payload": [
"I don't have access to real-time weather information. Please check a weather service or app for current conditions."
],
"full_request": {
"contents": [
{
"parts": [
{
"text": "What is the weather like today?"
}
],
"role": "user"
}
],
"generationConfig": {
"temperature": 0.7,
"maxOutputTokens": 1024
}
},
"full_response": {
"candidates": [
{
"content": {
"parts": [
{
"text": "I don't have access to real-time weather information. Please check a weather service or app for current conditions."
}
],
"role": "model"
},
"finishReason": "STOP",
"safetyRatings": [
{
"category": "HARM_CATEGORY_SEXUALLY_EXPLICIT",
"probability": "NEGLIGIBLE"
}
]
}
],
"usageMetadata": {
"promptTokenCount": 8,
"candidatesTokenCount": 24,
"totalTokenCount": 32
}
},
"metadata": {
"region": "us-central1",
"zone": "us-central1-a"
}
}
},
"metricset": {
"name": "vertexai_logs",
"period": 300000
},
"service": {
"type": "gcp"
}
}
```
11 changes: 11 additions & 0 deletions docs/reference/metricbeat/metricbeat-module-gcp.md
Original file line number Diff line number Diff line change
Expand Up @@ -363,6 +363,16 @@ metricbeat.modules:
exclude_labels: false
period: 1m
collect_dataproc_user_labels: true

- module: gcp
metricsets:
- vertexai_logs
period: 300s # 5 minutes
project_id: "your-project-id"
table_id: "your-project-id.dataset.id.table_name"
credentials_file_path: "/path/to/service-account.json"
# credentials_json: '{"type": "service_account", ...}'
time_lookback_hours: 1 # How many hours back to look for initial data fetch
```


Expand All @@ -380,3 +390,4 @@ The following metricsets are available:
* [metrics](/reference/metricbeat/metricbeat-metricset-gcp-metrics.md)
* [pubsub](/reference/metricbeat/metricbeat-metricset-gcp-pubsub.md)
* [storage](/reference/metricbeat/metricbeat-metricset-gcp-storage.md)
* [vertexai_logs](/reference/metricbeat/metricbeat-metricset-gcp-vertexai_logs.md) {applies_to}`stack: beta 9.2.0`
2 changes: 1 addition & 1 deletion docs/reference/metricbeat/metricbeat-modules.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ This section contains detailed information about the metric collecting modules c
| [Elasticsearch](/reference/metricbeat/metricbeat-module-elasticsearch.md) | ![No prebuilt dashboards](images/icon-no.png "") | [ccr](/reference/metricbeat/metricbeat-metricset-elasticsearch-ccr.md)<br>[cluster_stats](/reference/metricbeat/metricbeat-metricset-elasticsearch-cluster_stats.md)<br>[enrich](/reference/metricbeat/metricbeat-metricset-elasticsearch-enrich.md)<br>[index](/reference/metricbeat/metricbeat-metricset-elasticsearch-index.md)<br>[index_recovery](/reference/metricbeat/metricbeat-metricset-elasticsearch-index_recovery.md)<br>[index_summary](/reference/metricbeat/metricbeat-metricset-elasticsearch-index_summary.md)<br>[ingest_pipeline](/reference/metricbeat/metricbeat-metricset-elasticsearch-ingest_pipeline.md) {applies_to}`stack: beta`<br>[ml_job](/reference/metricbeat/metricbeat-metricset-elasticsearch-ml_job.md)<br>[node](/reference/metricbeat/metricbeat-metricset-elasticsearch-node.md)<br>[node_stats](/reference/metricbeat/metricbeat-metricset-elasticsearch-node_stats.md)<br>[pending_tasks](/reference/metricbeat/metricbeat-metricset-elasticsearch-pending_tasks.md)<br>[shard](/reference/metricbeat/metricbeat-metricset-elasticsearch-shard.md) |
| [Envoyproxy](/reference/metricbeat/metricbeat-module-envoyproxy.md) | ![No prebuilt dashboards](images/icon-no.png "") | [server](/reference/metricbeat/metricbeat-metricset-envoyproxy-server.md) |
| [Etcd](/reference/metricbeat/metricbeat-module-etcd.md) | ![No prebuilt dashboards](images/icon-no.png "") | [leader](/reference/metricbeat/metricbeat-metricset-etcd-leader.md)<br>[metrics](/reference/metricbeat/metricbeat-metricset-etcd-metrics.md) {applies_to}`stack: beta`<br>[self](/reference/metricbeat/metricbeat-metricset-etcd-self.md)<br>[store](/reference/metricbeat/metricbeat-metricset-etcd-store.md) |
| [Google Cloud Platform](/reference/metricbeat/metricbeat-module-gcp.md) | ![Prebuilt dashboards are available](images/icon-yes.png "") | [billing](/reference/metricbeat/metricbeat-metricset-gcp-billing.md)<br>[carbon](/reference/metricbeat/metricbeat-metricset-gcp-carbon.md) {applies_to}`stack: beta`<br>[compute](/reference/metricbeat/metricbeat-metricset-gcp-compute.md)<br>[dataproc](/reference/metricbeat/metricbeat-metricset-gcp-dataproc.md)<br>[firestore](/reference/metricbeat/metricbeat-metricset-gcp-firestore.md)<br>[gke](/reference/metricbeat/metricbeat-metricset-gcp-gke.md)<br>[loadbalancing](/reference/metricbeat/metricbeat-metricset-gcp-loadbalancing.md)<br>[metrics](/reference/metricbeat/metricbeat-metricset-gcp-metrics.md)<br>[pubsub](/reference/metricbeat/metricbeat-metricset-gcp-pubsub.md)<br>[storage](/reference/metricbeat/metricbeat-metricset-gcp-storage.md) |
| [Google Cloud Platform](/reference/metricbeat/metricbeat-module-gcp.md) | ![Prebuilt dashboards are available](images/icon-yes.png "") | [billing](/reference/metricbeat/metricbeat-metricset-gcp-billing.md)<br>[carbon](/reference/metricbeat/metricbeat-metricset-gcp-carbon.md) {applies_to}`stack: beta`<br>[compute](/reference/metricbeat/metricbeat-metricset-gcp-compute.md)<br>[dataproc](/reference/metricbeat/metricbeat-metricset-gcp-dataproc.md)<br>[firestore](/reference/metricbeat/metricbeat-metricset-gcp-firestore.md)<br>[gke](/reference/metricbeat/metricbeat-metricset-gcp-gke.md)<br>[loadbalancing](/reference/metricbeat/metricbeat-metricset-gcp-loadbalancing.md)<br>[metrics](/reference/metricbeat/metricbeat-metricset-gcp-metrics.md)<br>[pubsub](/reference/metricbeat/metricbeat-metricset-gcp-pubsub.md)<br>[storage](/reference/metricbeat/metricbeat-metricset-gcp-storage.md)<br>[vertexai_logs](/reference/metricbeat/metricbeat-metricset-gcp-vertexai_logs.md) {applies_to}`stack: beta 9.2.0` |
| [Golang](/reference/metricbeat/metricbeat-module-golang.md) | ![Prebuilt dashboards are available](images/icon-yes.png "") | [expvar](/reference/metricbeat/metricbeat-metricset-golang-expvar.md)<br>[heap](/reference/metricbeat/metricbeat-metricset-golang-heap.md) |
| [Graphite](/reference/metricbeat/metricbeat-module-graphite.md) | ![No prebuilt dashboards](images/icon-no.png "") | [server](/reference/metricbeat/metricbeat-metricset-graphite-server.md) |
| [HAProxy](/reference/metricbeat/metricbeat-module-haproxy.md) | ![Prebuilt dashboards are available](images/icon-yes.png "") | [info](/reference/metricbeat/metricbeat-metricset-haproxy-info.md)<br>[stat](/reference/metricbeat/metricbeat-metricset-haproxy-stat.md) |
Expand Down
1 change: 1 addition & 0 deletions docs/reference/toc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -955,6 +955,7 @@ toc:
- file: metricbeat/metricbeat-metricset-gcp-metrics.md
- file: metricbeat/metricbeat-metricset-gcp-pubsub.md
- file: metricbeat/metricbeat-metricset-gcp-storage.md
- file: metricbeat/metricbeat-metricset-gcp-vertexai_logs.md
- file: metricbeat/metricbeat-module-golang.md
children:
- file: metricbeat/metricbeat-metricset-golang-expvar.md
Expand Down
1 change: 1 addition & 0 deletions x-pack/metricbeat/include/list.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

12 changes: 12 additions & 0 deletions x-pack/metricbeat/metricbeat.reference.yml
Original file line number Diff line number Diff line change
Expand Up @@ -697,6 +697,18 @@ metricbeat.modules:
period: 1m
collect_dataproc_user_labels: true

- module: gcp
metricsets:
- vertexai_logs
period: 300s # 5 minutes
project_id: "your-project-id"
table_id: "your-project-id.dataset.id.table_name"
credentials_file_path: "/path/to/service-account.json"
# credentials_json: '{"type": "service_account", ...}'
time_lookback_hours: 1 # How many hours back to look for initial data fetch



#-------------------------------- Golang Module --------------------------------
- module: golang
#metricsets:
Expand Down
12 changes: 12 additions & 0 deletions x-pack/metricbeat/module/gcp/_meta/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -82,3 +82,15 @@
exclude_labels: false
period: 1m
collect_dataproc_user_labels: true

- module: gcp
metricsets:
- vertexai_logs
period: 300s # 5 minutes
project_id: "your-project-id"
table_id: "your-project-id.dataset.id.table_name"
credentials_file_path: "/path/to/service-account.json"
# credentials_json: '{"type": "service_account", ...}'
time_lookback_hours: 1 # How many hours back to look for initial data fetch


Loading
Loading