Skip to content

Commit

Permalink
Merge pull request #759 from nr-swilloughby/corrected_securityagent_u…
Browse files Browse the repository at this point in the history
…pdates

corrections to recent securityagent updates
  • Loading branch information
nr-swilloughby authored Jul 31, 2023
2 parents ff4322c + ac837d2 commit fde5165
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
4 changes: 3 additions & 1 deletion v3/integrations/nrgrpc/nrgrpc_server.go
Original file line number Diff line number Diff line change
Expand Up @@ -377,7 +377,9 @@ func StreamServerInterceptor(app *newrelic.Application, options ...HandlerOption
return func(srv any, ss grpc.ServerStream, info *grpc.StreamServerInfo, handler grpc.StreamHandler) error {
txn := startTransaction(ss.Context(), app, info.FullMethod)
defer txn.End()
newrelic.GetSecurityAgentInterface().SendEvent("GRPC_INFO", info.IsClientStream, info.IsServerStream)
if newrelic.IsSecurityAgentPresent() {
newrelic.GetSecurityAgentInterface().SendEvent("GRPC_INFO", info.IsClientStream, info.IsServerStream)
}
err := handler(srv, newWrappedServerStream(ss, txn))
reportInterceptorStatus(ss.Context(), txn, localHandlerMap, err)
return err
Expand Down
6 changes: 3 additions & 3 deletions v3/newrelic/secure_agent.go
Original file line number Diff line number Diff line change
Expand Up @@ -43,9 +43,9 @@ type securityAgent interface {
func (app *Application) RegisterSecurityAgent(s securityAgent) {
if app != nil && app.app != nil && s != nil {
secureAgent = s
}
if app.app.run != nil {
secureAgent.RefreshState(getLinkedMetaData(app.app))
if app.app.run != nil {
secureAgent.RefreshState(getLinkedMetaData(app.app))
}
}
}

Expand Down

0 comments on commit fde5165

Please sign in to comment.