Subversion Repositories SmartDukaan

Rev

Show changed files | Details | Compare with Previous | Blame | RSS feed

Filtering Options

Rev Age Author Path Log message Diff
37726 17 d 15 h amit /trunk/ sentry: stop developer laptops reporting to the live GlitchTip board

GlitchTip #586 was 57 events tagged environment=production whose stack read
/opt/homebrew/Cellar/tomcat@8/8.5.100/libexec/... with server_name set to a
developer's machine. Nothing was wrong on prod: a laptop was posting into the
production project and was indistinguishable from it.

Two things combined to allow that. The DSN lives in log4j2.xml, which ships inside
every build, so any machine running this code can report. And the Sentry SDK
defaults `environment` to "production" when it is not set -- which it never was --
so local runs arrived pre-labelled as prod.

Adds sentry.properties to each module, read off the classpath by the SDK itself
(io.sentry.config.PropertiesProviderFactory) and merged over the appender's config.
Both keys used here are honoured by io.sentry.ExternalOptions in 7.22.6 (verified
against the jar): `enabled` and `environment`.

The COMMITTED values are the safe ones -- enabled=false, environment=dev -- so a
plain local build is silent. build.gradle rewrites both from -Penv= alongside the
env.property it already writes, so only a deliberate -Penv=staging|prod build
reports, and it carries the right environment tag. tasks.build.doLast restores the
safe default afterwards, mirroring the existing handling of env.property.

Verified both directions: default build leaves enabled=false/environment=dev,
-Penv=prod yields enabled=true/environment=prod.

Note this makes the board trustworthy rather than merely quieter: events can now be
filtered on environment, and anything unlabelled is a build that predates this.
 
37491 35 d 18 h amit /trunk/ errors: ship ERROR events to GlitchTip via the log4j2 Sentry appender

io.sentry:sentry-log4j2:7.22.6 in all three deployables. Pinned to 7.x because
8.x drops Java 8; verified class major version 52.

minimumEventLevel=ERROR is load-bearing. It only became safe after r37490 moved
business validations to WARN -- 32% of the ERROR stream was HTTP 400s where the
user is simply told what to fix, and sending those would have made "insufficient
balance" the top issue and buried real bugs. Breadcrumbs come from INFO so an
issue arrives with the log lines that preceded it.

Attached to the application loggers only; framework noise is not our bug.

web's log4j2.xml is committed here. cron's and fofo's are held back: both carry
uncommitted local development paths (a user.home expansion, and an absolute
/Users path) that would break production logging and the Alloy log tailing.
Their Sentry blocks are staged locally and should land with whoever owns those
path edits.
 
36418 161 d 12 h amit /trunk/profitmandi-web/ OkHttp→Apache HttpClient migration. HyperTrackController/TrackingController now use RestClient, DB reads extracted to HyperTrackService to release connections before external HTTP calls. V2FofoDigifyController uses HttpClientFactory.  
35599 252 d 9 h amit /trunk/profitmandi-web/ Add HikariCP dependency for connection pooling  
35389 295 d 14 h amit /trunk/profitmandi-web/ donot commit  
27028 2218 d 10 h tejbeer /trunk/profitmandi-web/ change  
26217 2452 d 18 h amit.gupta /trunk/  
23947 2995 d 18 h tejbeer /trunk/ date changes  
23704 3055 d 14 h amit.gupta /trunk/profitmandi-web/  
23693 3056 d 19 h tejbeer /trunk/profitmandi-web/ dependnecy change  
22874 3253 d 18 h ashik.ali /trunk/profitmandi-web/  
22531 3289 d 19 h ashik.ali /trunk/profitmandi-web/  
22427 3311 d 13 h ashik.ali /trunk/profitmandi-web/