Skip to content

Commit

Permalink
+ Add support for new instance log to tracking
Browse files Browse the repository at this point in the history
+ Update Changelog
  • Loading branch information
lbwexler committed Apr 7, 2024
1 parent 174c9ee commit 95162e0
Show file tree
Hide file tree
Showing 6 changed files with 17 additions and 37 deletions.
30 changes: 7 additions & 23 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
data structures (e.g. Hazelcast Maps) should be used as needed, as well as limiting certain
actions to the "master" server. See toolbox, or Hoist for help.
** `hoist-react >= 64.0` is required.
* New support for reporting of service statistics for trobuleshooting/monitoring. Implement
* New support for reporting of service statistics for troubleshooting/monitoring. Implement
`BaseService.getAdminStats()` to provide diagnostic metadata about the state of your service that
will then be displayed in the admin client.
* All `Throwable`s are now serialized to JSON by default using Hoist's standard customization of
Expand All @@ -34,34 +34,18 @@
### Breaking Changes
* The following server-side Hoist events are now implemented as cluster-wide Hazelcast messages
rather than single-server Grails events:
** 'xhFeedbackReceived', 'xhClientErrorReceived', 'xhConfigChanged', and 'xhMonitorStatusReport'
'xhFeedbackReceived', 'xhClientErrorReceived', 'xhConfigChanged', and 'xhMonitorStatusReport'
Any applications that are listening to these events with `BaseService.subscribe` should instead use
the new cluster aware method `BaseService.subscribeToTopic`.
* The `exceptionRenderer` singleton has been simplified and renamed as `xhExceptionHandler`. This
change was needed to better support cross-cluster exception handling. This object is used by
Hoist internally for catching uncaught exceptions and this change is not expected to impact
most applications.

* New support for Role Management.
* Hoist now supports an out-of-the-box, database-driven system for maintaining a hierarchical
set of roles and associating them with individual users.
* New system supports app and plug-in specific integrations to AD and other enterprise systems.
* Hoist-react `v64` is now required and will provide an administrative UI to visualize and
manage the new role system.
* See `DefaultRoleService` for more information.

### ⚙️ Technical

* Add `xh/echoHeaders` utility endpoint. Useful for verifying headers (e.g. `jespa_connection_id`)
that are installed by or must pass through multiple ingresses/load balancers.
* Remove HTML tag escaping when parsing alert banner create/update request JSON.

### 💥 Breaking Changes

* Applications will typically need to adjust their implementation of `BaseRoleService`. Most
applications are expected to adopt the new provided `DefaultRoleService`, and may be required to
migrate existing code/data to the new API. Applications that wish to continue to use a completely
custom `BaseRoleService` will need to implement one additional method: `getUsersForRole`.
* Applications will need to add an `instance` column to two tables, with the following SQL, or equivalent:
```sql
ALTER TABLE `xh_client_error` ADD COLUMN `instance` VARCHAR(50) NULL;
ALTER TABLE `xh_track_log` ADD COLUMN `instance` VARCHAR(50) NULL;
```

### 📚 Libraries
* grails `6.1.0`
Expand Down
3 changes: 3 additions & 0 deletions grails-app/domain/io/xh/hoist/clienterror/ClientError.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ class ClientError implements JSONFormat {
String appVersion
String appEnvironment
String url
String instance
boolean userAlerted = false
Date dateCreated
String impersonating
Expand All @@ -48,6 +49,7 @@ class ClientError implements JSONFormat {
appVersion(nullable: true, maxSize: 100)
appEnvironment(nullable: true, maxSize: 100)
url(nullable: true, maxSize: 500)
instance(nullable: true, maxSize: 50)
impersonating(nullable: true, maxSize: 50)
}

Expand All @@ -63,6 +65,7 @@ class ClientError implements JSONFormat {
appVersion : appVersion,
appEnvironment: appEnvironment,
url : url,
instance : instance,
userAlerted : userAlerted,
dateCreated : dateCreated,
day : appDay(dateCreated),
Expand Down
3 changes: 3 additions & 0 deletions grails-app/domain/io/xh/hoist/track/TrackLog.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ class TrackLog implements JSONFormat {
String appVersion
String appEnvironment
String url
String instance
Integer elapsed
String severity
Date dateCreated
Expand Down Expand Up @@ -51,6 +52,7 @@ class TrackLog implements JSONFormat {
appVersion(nullable: true, maxSize: 100)
appEnvironment(nullable: true, maxSize: 100)
url(nullable: true, maxSize: 500)
instance(nullable: true, maxSize: 50)
elapsed(nullable: true)
impersonating(nullable: true, maxSize: 50)
}
Expand All @@ -74,6 +76,7 @@ class TrackLog implements JSONFormat {
appVersion : appVersion,
appEnvironment: appEnvironment,
url : url,
instance: instance
]
}

Expand Down
14 changes: 0 additions & 14 deletions grails-app/init/io/xh/hoist/ClusterConfig.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -112,20 +112,6 @@ class ClusterConfig {
return ret
}

/**
* Override this method to specify additional classes that should be serialized with Kryo
* when being stored in Hazelcast structures.
*
* Kryo provides a more efficient serialization format and is recommended over default
* Java serialization for objects being stored in Hazelcast.
*
* Note that objects being stored in a Hoist `ReplicatedValue` or cluster-enabled `Cache` will not
* need their classes specified in this method. These objects are always serialized via Kryo.
*/
protected List<Class> classesForKryo() {
return [ReplicatedValueEntry, Entry, ClusterResponse]
}

/**
* Override this to create additional default configs in the application.
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ package io.xh.hoist.clienterror
import com.hazelcast.map.IMap
import grails.gorm.transactions.Transactional
import io.xh.hoist.BaseService
import io.xh.hoist.cluster.ClusterService
import io.xh.hoist.util.Utils

import static io.xh.hoist.browser.Utils.getBrowser
Expand Down Expand Up @@ -80,6 +81,7 @@ class ClientErrorService extends BaseService {
appVersion : appVersion ?: Utils.appVersion,
appEnvironment: Utils.appEnvironment,
url : url?.take(500),
instance : ClusterService.instanceName,
userAlerted : userAlerted,
dateCreated : new Date(now),
impersonating: identityService.impersonating ? username : null
Expand Down
2 changes: 2 additions & 0 deletions grails-app/services/io/xh/hoist/track/TrackService.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ package io.xh.hoist.track

import groovy.transform.CompileStatic
import io.xh.hoist.BaseService
import io.xh.hoist.cluster.ClusterService
import io.xh.hoist.config.ConfigService
import io.xh.hoist.util.Utils

Expand Down Expand Up @@ -111,6 +112,7 @@ class TrackService extends BaseService {
data: data,
url: params.url,
appVersion: params.appVersion ?: Utils.appVersion,
instance: ClusterService.instanceName,
appEnvironment: Utils.appEnvironment
]

Expand Down

0 comments on commit 95162e0

Please sign in to comment.