Skip to content

Change Workloads For Circuit Breaker #40843

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

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

tvaron3
Copy link
Member

@tvaron3 tvaron3 commented May 1, 2025

Description

  • Added config to send logs to app insights. This will improve the monitoring experience for client side issues.
  • Added config for enabling per partition circuit breaker.
  • Added option to not remove logs when shutting down the workloads.
  • Added a user agent prefix config to be able to separate vm traffic more easily in kusto.

@Copilot Copilot AI review requested due to automatic review settings May 1, 2025 16:51
@tvaron3 tvaron3 requested a review from a team as a code owner May 1, 2025 16:51
@github-actions github-actions bot added the Cosmos label May 1, 2025
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 new configuration options to enhance log monitoring and circuit breaker functionality in the test workloads. Key changes include adding new configuration values (USER_AGENT_PREFIX, APP_INSIGHTS_CONNECTION_STRING, CIRCUIT_BREAKER_ENABLED), modifying logger creation to utilize these configs (with changes to user agent format, logger level, and log rotation settings), and updating documentation for scale testing.

Reviewed Changes

Copilot reviewed 4 out of 5 changed files in this pull request and generated 3 comments.

File Description
sdk/cosmos/azure-cosmos/tests/workloads/workload_utils.py Updated get_user_agent and create_logger functions to incorporate config-driven behavior and adjust logger settings.
sdk/cosmos/azure-cosmos/tests/workloads/workload_configs.py Added new configuration parameters to support monitoring and circuit breaker functionality.
sdk/cosmos/azure-cosmos/tests/workloads/r_w_q_workload.py Removed an unused import to streamline the code.
sdk/cosmos/azure-cosmos/tests/workloads/dev.md Revised documentation to reflect the new setup and shutdown commands along with updated installation instructions.
Files not reviewed (1)
  • sdk/cosmos/azure-cosmos/tests/workloads/shutdown_workloads.sh: Language not supported
Comments suppressed due to low confidence (1)

sdk/cosmos/azure-cosmos/tests/workloads/workload_utils.py:110

  • The logger is now obtained from the root logger instead of using the 'azure.cosmos' logger as before, yet the Azure monitor is configured with logger_name 'azure.cosmos'. Please verify that this change is intentional and that logging behavior remains consistent.
logger = logging.getLogger()

@azure-sdk
Copy link
Collaborator

API change check

API changes are not detected in this pull request.

from workload_configs import NUMBER_OF_LOGICAL_PARTITIONS, PARTITION_KEY

from azure.monitor.opentelemetry import configure_azure_monitor
from workload_configs import (NUMBER_OF_LOGICAL_PARTITIONS, PARTITION_KEY, USER_AGENT_PREFIX,
Copy link
Contributor

@allenkim0129 allenkim0129 May 2, 2025

Choose a reason for hiding this comment

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

Nit: It might be easier to use * instead of adding every variables.

)
logger.setLevel(logging.DEBUG)
logger.setLevel(logging.INFO)
Copy link
Contributor

Choose a reason for hiding this comment

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

Why did you change the log level to INFO? Also, can we just make the log level configurable? or add a parameter for the log level?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
Status: No status
Development

Successfully merging this pull request may close these issues.

4 participants