diff --git a/lib/datadog/core/telemetry/event.rb b/lib/datadog/core/telemetry/event.rb index 15e9a81d848..e79d1bc4093 100644 --- a/lib/datadog/core/telemetry/event.rb +++ b/lib/datadog/core/telemetry/event.rb @@ -338,7 +338,6 @@ def payload class Log < Base LEVELS = { error: 'ERROR', - debug: 'DEBUG', warn: 'WARN', }.freeze @@ -357,6 +356,7 @@ def payload { logs: [ { + # Required fields message: @message, level: @level, # More optional fields to be added here... diff --git a/lib/datadog/core/telemetry/logging.rb b/lib/datadog/core/telemetry/logging.rb index 8fadeafb623..ed040c9de50 100644 --- a/lib/datadog/core/telemetry/logging.rb +++ b/lib/datadog/core/telemetry/logging.rb @@ -5,10 +5,19 @@ module Datadog module Core module Telemetry - # Logging interface for sending telemetry logs. + # === INTRENAL USAGE ONLY === + # + # Logging interface for sending telemetry logs... so we can fix them. + # + # For developer using this module: + # - MUST NOT provide any sensitive information (PII) + # - SHOULD reduce the data cardinality for batching/aggregation + # + # Before using it, ask yourself: + # - Do we need to know about this (ie. internal error or client error)? + # - How severe/critical is this error? (ie. error, warning, fatal) + # - What information needed to make it actionable? # - # Reporting internal error so that we can fix them. - # IMPORTANT: Make sure to not log any sensitive information. module Logging extend self diff --git a/spec/datadog/core/telemetry/event_spec.rb b/spec/datadog/core/telemetry/event_spec.rb index 8986562659a..bbb5c1051bc 100644 --- a/spec/datadog/core/telemetry/event_spec.rb +++ b/spec/datadog/core/telemetry/event_spec.rb @@ -227,19 +227,6 @@ def contain_configuration(*array) ) end - it do - event = Datadog::Core::Telemetry::Event::Log.new(message: 'Hi', level: :debug) - expect(event.type).to eq('logs') - expect(event.payload).to eq( - { - logs: [{ - message: 'Hi', - level: 'DEBUG' - }] - } - ) - end - it do event = Datadog::Core::Telemetry::Event::Log.new(message: 'Hi', level: :warn) expect(event.type).to eq('logs')