Skip to content

Commit

Permalink
Update to counter name.
Browse files Browse the repository at this point in the history
  • Loading branch information
mviitane committed Oct 10, 2022
1 parent 813df95 commit 2eb986a
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/recommendationservice/recommendation_server.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ def ListRecommendations(self, request, context):
span = trace.get_current_span()
span.set_attribute("app.products_recommended.count", len(prod_list))
logger.info("[Recv ListRecommendations] product_ids={}".format(prod_list))
recommendations_counter.add(len(prod_list), {'recommendation.type': 'catalog'})
app_recommendations_counter.add(len(prod_list), {'recommendation.type': 'catalog'})

# build and return response
response = demo_pb2.ListRecommendationsResponse()
Expand Down Expand Up @@ -105,8 +105,8 @@ def must_map_env(key: str):
meter = metrics.get_meter(__name__)

# Create counters
recommendations_counter = meter.create_counter(
'recommendations.counter', unit='recommendations', description="Counts the total number of given recommendations"
app_recommendations_counter = meter.create_counter(
'app.recommendations.counter', unit='recommendations', description="Counts the total number of given recommendations"
)

port = must_map_env('RECOMMENDATION_SERVICE_PORT')
Expand Down

0 comments on commit 2eb986a

Please sign in to comment.