Skip to content

Commit

Permalink
Remove debug level
Browse files Browse the repository at this point in the history
  • Loading branch information
TonyCTHsu committed Aug 29, 2024
1 parent 5a132b7 commit 9f863d7
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 17 deletions.
2 changes: 1 addition & 1 deletion lib/datadog/core/telemetry/event.rb
Original file line number Diff line number Diff line change
Expand Up @@ -338,7 +338,6 @@ def payload
class Log < Base
LEVELS = {
error: 'ERROR',
debug: 'DEBUG',
warn: 'WARN',
}.freeze

Expand All @@ -357,6 +356,7 @@ def payload
{
logs: [
{
# Required fields
message: @message,
level: @level,
# More optional fields to be added here...
Expand Down
15 changes: 12 additions & 3 deletions lib/datadog/core/telemetry/logging.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
13 changes: 0 additions & 13 deletions spec/datadog/core/telemetry/event_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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')
Expand Down

0 comments on commit 9f863d7

Please sign in to comment.