Skip to content

Commit

Permalink
Added support for RecordContent config setting
Browse files Browse the repository at this point in the history
  • Loading branch information
mirackara committed Mar 8, 2024
1 parent 03ee380 commit 4796c88
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 1 deletion.
4 changes: 4 additions & 0 deletions v3/newrelic/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -242,6 +242,9 @@ type Config struct {
Streaming struct {
Enabled bool
}
RecordContent struct {
Enabled bool
}
}

// CrossApplicationTracer controls behavior relating to cross application
Expand Down Expand Up @@ -677,6 +680,7 @@ func defaultConfig() Config {
c.Heroku.DynoNamePrefixesToShorten = []string{"scheduler", "run"}
c.AIMonitoring.Enabled = false
c.AIMonitoring.Streaming.Enabled = true
c.AIMonitoring.RecordContent.Enabled = true
c.InfiniteTracing.TraceObserver.Port = 443
c.InfiniteTracing.SpanEvents.QueueSize = 10000

Expand Down
6 changes: 6 additions & 0 deletions v3/newrelic/config_options.go
Original file line number Diff line number Diff line change
Expand Up @@ -246,6 +246,12 @@ func ConfigAIMonitoringEnabled(enabled bool) ConfigOption {
}
}

func ConfigAIMonitoringRecordContentEnabled(enabled bool) ConfigOption {
return func(cfg *Config) {
cfg.AIMonitoring.RecordContent.Enabled = enabled
}
}

// ConfigAppLogMetricsEnabled enables or disables the collection of metrics
// data for logs seen by an instrumented logging framework
// default: true
Expand Down
6 changes: 6 additions & 0 deletions v3/newrelic/config_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -132,6 +132,9 @@ func TestCopyConfigReferenceFieldsPresent(t *testing.T) {
"settings":{
"AIMonitoring": {
"Enabled": false,
"RecordContent": {
"Enabled": true
},
"Streaming": {
"Enabled": true
}
Expand Down Expand Up @@ -334,6 +337,9 @@ func TestCopyConfigReferenceFieldsAbsent(t *testing.T) {
"settings":{
"AIMonitoring": {
"Enabled": false,
"RecordContent": {
"Enabled": true
},
"Streaming": {
"Enabled": true
}
Expand Down
2 changes: 1 addition & 1 deletion v3/newrelic/internal_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -291,7 +291,7 @@ func testApp(replyfn func(*internal.ConnectReply), cfgfn func(*Config), t testin

func TestRecordLLMFeedbackEventSuccess(t *testing.T) {
app := testApp(nil, nil, t)
app.RecordLlmFeedbackEvent("traceid", "5", "informative", "message", validParams)
app.RecordLLMFeedbackEvent("traceid", "5", "informative", "message", validParams)
app.expectNoLoggedErrors(t)
app.ExpectCustomEvents(t, []internal.WantEvent{{
Intrinsics: map[string]interface{}{
Expand Down

0 comments on commit 4796c88

Please sign in to comment.