Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: OpenTelemetry.logger_provider API, ProxyLoggers, Configuration, and Instrument Registry #1725

Merged
merged 17 commits into from
Nov 18, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
style: Update spacing
  • Loading branch information
kaylareopelle committed Aug 28, 2024
commit 679c085452472faf2cdaf19d5d784588022aad99
11 changes: 5 additions & 6 deletions logs_sdk/lib/opentelemetry/sdk/logs/configuration_patch.rb
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@
module OpenTelemetry
module SDK
module Logs
# The ConfiguratorPatch implements a hook to configure the logs
# portion of the SDK.
# The ConfiguratorPatch implements a hook to configure the logs portion
# of the SDK.
module ConfiguratorPatch
def add_log_record_processor(log_record_processor)
@log_record_processors << log_record_processor
Expand All @@ -23,8 +23,8 @@ def initialize
@log_record_processors = []
end

# The logs_configuration_hook method is where we define the setup process
# for logs SDK.
# The logs_configuration_hook method is where we define the setup
# process for logs SDK.
def logs_configuration_hook
OpenTelemetry.logger_provider = Logs::LoggerProvider.new(resource: @resource)
configure_log_record_processors
Expand All @@ -36,7 +36,7 @@ def configure_log_record_processors
end

def wrapped_log_exporters_from_env
# default is console until other exporters built
# TODO: set default to OTLP to match traces, default is console until other exporters merged
exporters = ENV.fetch('OTEL_LOGS_EXPORTER', 'console')

exporters.split(',').map do |exporter|
Expand All @@ -51,7 +51,6 @@ def wrapped_log_exporters_from_env
nil
else
Logs::Export::BatchLogRecordProcessor.new(OpenTelemetry::Exporter::OTLP::LogsExporter.new)
# fetch_exporter(exporter, 'OpenTelemetry::Exporter::OTLP::Exporter')
end
else
OpenTelemetry.logger.warn "The #{exporter} exporter is unknown and cannot be configured, log records will not be exported"
Expand Down
1 change: 1 addition & 0 deletions sdk/lib/opentelemetry/sdk/configurator.rb
Original file line number Diff line number Diff line change
Expand Up @@ -189,6 +189,7 @@ def wrapped_exporters_from_env # rubocop:disable Metrics/CyclomaticComplexity
when 'none' then nil
when 'otlp'
otlp_protocol = ENV['OTEL_EXPORTER_OTLP_TRACES_PROTOCOL'] || ENV['OTEL_EXPORTER_OTLP_PROTOCOL'] || 'http/protobuf'

if otlp_protocol != 'http/protobuf'
OpenTelemetry.logger.warn "The #{otlp_protocol} transport protocol is not supported by the OTLP exporter, spans will not be exported."
nil
Expand Down
Loading