Monitoring the plugin - Amazon Personalize
Services or capabilities described in Amazon Web Services documentation might vary by Region. To see the differences applicable to the China Regions, see Getting Started with Amazon Web Services in China (PDF).

Monitoring the plugin

If you use OpenSearch Service, you can monitor the plugin through metrics in Amazon CloudWatch. For more information, see Monitoring Amazon OpenSearch Service domains.

As you apply the Amazon Personalize Search Ranking plugin to OpenSearch queries, you can monitor the plugin by getting metrics for your search pipelines. Pipeline metrics include statistics like the number of failed requests for the personalized_search_ranking response processor.

Monitoring the plugin with Amazon OpenSearch Service

You can use the following Python code to get metrics for all of your pipelines. For an example of pipeline metrics, see Pipeline metrics example.

import requests from requests_auth_aws_sigv4 import AWSSigV4 domain_endpoint = 'domain endpoint' url = f'{domain_endpoint}/_nodes/stats/search_pipeline' auth = AWSSigV4('es') headers = {'Content-Type': 'application/json'} try: response = requests.get(url, auth=auth, headers=headers, verify=False) print(response.text) except Exception as e: print(f"Error: {e}")

Monitoring the plugin with open source OpenSearch

You can use the following code to get metrics for all of your pipelines. The response contains statistics for all search pipelines. For an example of pipeline metrics, see Pipeline metrics example.

curl -XGET "https://localhost:9200/_nodes/stats/search_pipeline?pretty" -ku 'admin:admin'

Pipeline metrics example

The following code shows an excerpt of the pipeline metrics that are returned from OpenSearch. It shows only the pipelines object that contains statistics for two different pipelines. For each pipeline, you can find Amazon Personalize Search Ranking plugin metrics in the personalized_search_ranking response processor list. For a complete example of all metrics, see Search pipeline metrics.

{ .... .... "pipelines": { "pipelineA": { "request": { "count": 0, "time_in_millis": 0, "current": 0, "failed": 0 }, "response": { "count": 6, "time_in_millis": 2246, "current": 0, "failed": 0 }, "request_processors": [], "response_processors": [ { personalized_search_ranking": { "type": "personalized_search_ranking", "stats": { "count": <number of requests>, "time_in_millis": <time>, "current": 0, "failed": <number of failed requests> } } } ] }, "pipelineB": { "request": { "count": 0, "time_in_millis": 0, "current": 0, "failed": 0 }, "response": { "count": 8, "time_in_millis": 2248, "current": 0, "failed": 0 }, "request_processors": [], "response_processors": [ { "personalized_search_ranking": { "type": "personalized_search_ranking", "stats": { "count": <number of requests>, "time_in_millis": <time>, "current": 0, "failed": <number of failed requests> } } } ] } } .... .... }