Skip to content
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

feat: set is_bff_enabled custom attribute via logging service; create abstraction to make requests to BFF API endpoints with logError/logInfo #1234

Merged
merged 7 commits into from
Dec 10, 2024

Conversation

adamstankiewicz
Copy link
Member

@adamstankiewicz adamstankiewicz commented Dec 10, 2024

Description

ENT-9842

  1. Sets a custom attribute via the logging service (e.g., DatadogLoggingService) as a helper to more easily craft queries for BFF-enabled vs. BFF-disabled enterprise customers. For example, in Datadog, the custom attribute should help filter data with @context.is_bff_enabled:{true/false} vs. hardcoding explicit customer UUIDs via @context.enterprise_customer_uuid:(<uuidA> OR <uuidB>).
  2. Implements an abstraction makeBFFRequest as a helper for the existing fetchEnterpriseLearnerDashboard, but to make its logic reusable across other non-Dashboard route related BFF endpoints in the future. The primary rationale for this change is to always iterate over any BFF response errors and/or warnings, calling logError and/or logInfo respectively for each. This change should help with observability of the frontend app's interactions with the BFF response data.

For all changes

  • Ensure adequate tests are in place (or reviewed existing tests cover changes)
  • Ensure English strings are marked for translation. See documentation for more details.

Only if submitting a visual change

  • Ensure to attach screenshots
  • Ensure to have UX team confirm screenshots

@adamstankiewicz adamstankiewicz changed the title feat: set is_bff_enabled custom attribute via logging service; create abstraction to make requests to BFF API endpoints feat: set is_bff_enabled custom attribute via logging service; create abstraction to make requests to BFF API endpoints with logError/logInfo Dec 10, 2024
* @param {String} [args.enterpriseSlug] - The slug of the enterprise customer.
* @returns {Promise<Object>} - The learner dashboard metadata.
*/
export async function fetchEnterpriseLearnerDashboard({
Copy link
Member Author

Choose a reason for hiding this comment

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

[inform] Moved from bffs.js -> bffs.ts

Copy link

codecov bot commented Dec 10, 2024

Codecov Report

Attention: Patch coverage is 97.61905% with 1 line in your changes missing coverage. Please review.

Project coverage is 89.03%. Comparing base (534156c) to head (93ebcc7).
Report is 1 commits behind head on master.

Files with missing lines Patch % Lines
src/components/app/data/services/bffs.ts 97.05% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master    #1234      +/-   ##
==========================================
+ Coverage   88.96%   89.03%   +0.06%     
==========================================
  Files         401      401              
  Lines        8638     8670      +32     
  Branches     2067     2116      +49     
==========================================
+ Hits         7685     7719      +34     
+ Misses        912      909       -3     
- Partials       41       42       +1     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@adamstankiewicz adamstankiewicz merged commit cb3d2bf into master Dec 10, 2024
6 checks passed
@adamstankiewicz adamstankiewicz deleted the ags/bff-request-abstraction-observability branch December 10, 2024 20:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants