Skip to content

Conversation

@bs-shobhitkumar
Copy link
Contributor

This pull request adds structured asset instrumentation logging to the Percy core network layer, enabling better tracking and analysis of asset loading issues by the API rule engine. Instrumentation logs are now emitted for various asset-related failure scenarios, with detailed metadata and a consistent format, and comprehensive tests are included to verify correct logging behavior.

Asset instrumentation logging enhancements:

  • Introduced the logAssetInstrumentation utility function in utils.js, which logs asset events in a structured, pipe-separated format to the CI debug namespace for API parsing.
  • Integrated asset instrumentation logs into the network layer (network.js) for key failure scenarios, including server errors (5xx), disallowed status codes, request aborts, disallowed hostnames, resources too large, empty responses, missing responses, and disallowed resource types. Each scenario logs a specific category and reason with relevant metadata. [1] [2] [3] [4]

Testing improvements:

  • Added a new test suite in discovery.test.js to verify that instrumentation logs are correctly emitted for 5xx errors, resources that are too large, disallowed status codes, and empty responses, ensuring the logs contain the expected format and metadata.
  • Added unit tests for logAssetInstrumentation in utils.test.js, checking correct formatting, category assignment, inclusion of metadata fields, and message structure for API parsing.

@bs-shobhitkumar bs-shobhitkumar merged commit 4eea8ff into master Jan 14, 2026
41 checks passed
@bs-shobhitkumar bs-shobhitkumar deleted the PER_6583_assets_instrumentation branch January 14, 2026 11:11
@bs-shobhitkumar bs-shobhitkumar added the ✨ enhancement New feature or request label Jan 14, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

✨ enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants