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

UHF-9982: Overwrite sentry DSN for js tracking #181

Merged
merged 2 commits into from
Oct 18, 2024
Merged

Conversation

hyrsky
Copy link
Contributor

@hyrsky hyrsky commented Oct 17, 2024

UHF-9982

What was done

  • Enable sentry JS tracking.

How to install

  • Make sure your instance is up and running on correct branch.
    • git checkout dev
    • make fresh
  • Run composer require drupal/helfi_api_base:dev-UHF-9982-js-sentry
  • Get Sentry DSN from https://sentry.test.hel.ninja/settings/city-of-helsinki/projects/helfi-core-javascript/keys/.
  • Add to compose.yaml
    diff --git a/compose.yaml b/compose.yaml
    index 99f55b2..2e408f2 100644
    --- a/compose.yaml
    +++ b/compose.yaml
    @@ -31,6 +31,11 @@ services:
         DRUPAL_VARNISH_PORT: 6081
         REDIS_HOST: redis
         PROJECT_NAME: "${PROJECT_NAME}"
    +    SENTRY_DSN: xyz
    +    SENTRY_DSN_REACT: xyz
    +    SENTRY_DSN_PUBLIC: xyz
    +    SENTRY_ENVIRONMENT: 'local'
    +    SENTRY_RELEASE: 'dev'
       extra_hosts:
         - "host.docker.internal:host-gateway"
         - "${DRUPAL_HOSTNAME}:host-gateway"
  • Run make up
  • Add to local.settings.php
    $config['raven.settings']['javascript_error_handler'] = TRUE;

How to test

  • Sentry does not set cookies / localStorage
  • JS errors are logged to Sentry
  • React error handlers still work
  • Correct environment is displayed on error messages.
  • Check that code follows our standards

Continuous documentation

  • This feature has been documented/the documentation has been updated
  • This change doesn't require updates to the documentation

Translations

  • Translations have been added to .po -files and included in this PR

Other PRs

@codecov-commenter
Copy link

codecov-commenter commented Oct 17, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 88.91%. Comparing base (7a37870) to head (f81752f).
Report is 8 commits behind head on main.

Additional details and impacted files
@@             Coverage Diff              @@
##               main     #181      +/-   ##
============================================
- Coverage     88.96%   88.91%   -0.06%     
- Complexity      518      522       +4     
============================================
  Files            76       77       +1     
  Lines          2058     2075      +17     
============================================
+ Hits           1831     1845      +14     
- Misses          227      230       +3     

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

Copy link

sonarcloud bot commented Oct 17, 2024

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.

3 participants