-
Notifications
You must be signed in to change notification settings - Fork 0
feat: Add logs configuration patch #11
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
Conversation
|
|
||
| # @return [Object, Logger] configured Logger or a default STDOUT Logger. | ||
| def logger | ||
| @logger ||= Logger.new($stdout, level: ENV['OTEL_LOG_LEVEL'] || Logger::INFO) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Might not need the changes in this file until we have instrumentation
| # @api private | ||
| # | ||
| # {ProxyLoggerProvider} is an implementation of {OpenTelemetry::Logs::LoggerProvider}. | ||
| # It is the default global logger provider returned by OpenTelemetry.logger_provider. | ||
| # It delegates to a "real" LoggerProvider after the global logger provider is registered. | ||
| # It returns {ProxyLogger} instances until the delegate is installed. | ||
| class ProxyLoggerProvider < Logs::LoggerProvider | ||
| Key = Struct.new(:name, :version) | ||
| private_constant(:Key) | ||
| # Returns a new {ProxyLoggerProvider} instance. | ||
| # | ||
| # @return [ProxyLoggerProvider] | ||
| def initialize | ||
| super | ||
|
|
||
| @mutex = Mutex.new | ||
| @registry = {} | ||
| @delegate = nil | ||
| end |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We want the instrumentation registry merged first so these features aren't random
Create a registry for loggers to make sure a logger with an identical name and version is created only once and reused
When OTLP logs exporter not installed, rescue the error, emit a message and set the exporter to nil.
…pentelemetry-ruby into logs-configuration-patch
…d operation (open-telemetry#1713) * feature: adds on_ending method as an optional callback for span processors Signed-off-by: Gustavo Pantuza <gustavopantuza@gmail.com> * feature: calls every span processor that has on_ending implemented right after setting the end timestamp Signed-off-by: Gustavo Pantuza <gustavopantuza@gmail.com> * test: adds tests for the new on_ending method from span processors Signed-off-by: Gustavo Pantuza <gustavopantuza@gmail.com> * docs: Informs the on_ending callback is an experimental features from official spec Signed-off-by: Gustavo Pantuza <gustavopantuza@gmail.com> * Update sdk/lib/opentelemetry/sdk/trace/span_processor.rb Co-authored-by: Kayla Reopelle <87386821+kaylareopelle@users.noreply.github.com> * Update sdk/lib/opentelemetry/sdk/trace/span_processor.rb Co-authored-by: Kayla Reopelle <87386821+kaylareopelle@users.noreply.github.com> * refactor: switch method name from on_ending to on_finish to comply with project name strategy Signed-off-by: Gustavo Pantuza <gustavopantuza@gmail.com> --------- Signed-off-by: Gustavo Pantuza <gustavopantuza@gmail.com> Co-authored-by: Kayla Reopelle <87386821+kaylareopelle@users.noreply.github.com>
Some tests in BatchLogRecordProcessor had timing issues due to the work method. Since we don't rely on that method for these tests, stub the work method to do nothing. Co-authored-by: Tanna McClure <tannalynn@users.noreply.github.com> Co-authored-by: Matthew Wear <matthew.wear@gmail.com>
* fix: update references to logging exporter This exporter has been replaced by the debug exporter and will be removed soon Signed-off-by: Alex Boten <223565+codeboten@users.noreply.github.com> * update example to use v0.109.0 of the collector Signed-off-by: Alex Boten <223565+codeboten@users.noreply.github.com> --------- Signed-off-by: Alex Boten <223565+codeboten@users.noreply.github.com> Co-authored-by: Matthew Wear <matthew.wear@gmail.com>
* feat: add basic metrics view support * feat: lint * feat: metric view lint * feat: metrics - use flatten for 1-d array MetricData * Update metrics_sdk/lib/opentelemetry/sdk/metrics/state/metric_stream.rb Co-authored-by: Kayla Reopelle <87386821+kaylareopelle@users.noreply.github.com> * Update metrics_sdk/lib/opentelemetry/sdk/metrics/meter_provider.rb Co-authored-by: Kayla Reopelle <87386821+kaylareopelle@users.noreply.github.com> * update doc * revision * align the test case * Update metrics_sdk/lib/opentelemetry/sdk/metrics/meter_provider.rb Co-authored-by: Kayla Reopelle <87386821+kaylareopelle@users.noreply.github.com> * Update metrics_sdk/lib/opentelemetry/sdk/metrics/meter_provider.rb Co-authored-by: Kayla Reopelle <87386821+kaylareopelle@users.noreply.github.com> * Update metrics_sdk/lib/opentelemetry/sdk/metrics/meter_provider.rb Co-authored-by: Kayla Reopelle <87386821+kaylareopelle@users.noreply.github.com> * Update metrics_sdk/lib/opentelemetry/sdk/metrics/view.rb Co-authored-by: Kayla Reopelle <87386821+kaylareopelle@users.noreply.github.com> * Update metrics_sdk/lib/opentelemetry/sdk/metrics/view/registered_view.rb Co-authored-by: Kayla Reopelle <87386821+kaylareopelle@users.noreply.github.com> * refactor view and add test * revision --------- Co-authored-by: Kayla Reopelle <87386821+kaylareopelle@users.noreply.github.com> Co-authored-by: Matthew Wear <matthew.wear@gmail.com>
* feat: Add log record attribute limits Similar to SpanLimits, add a LogRecordLimits class that handles configuration of attribute count and value length values. * Update logs_sdk/test/opentelemetry/sdk/logs/log_record_test.rb * Update logs_sdk/lib/opentelemetry/sdk/logs/log_record.rb * Update logs_sdk/lib/opentelemetry/sdk/logs/log_record.rb --------- Co-authored-by: Matthew Wear <matthew.wear@gmail.com>
* fix: add mTLS for metrics exporter * fix: add second pem for parameter override * update test case * Update exporter/otlp-metrics/README.md Co-authored-by: Bart de Water <496367+bdewater@users.noreply.github.com> --------- Co-authored-by: Bart de Water <496367+bdewater@users.noreply.github.com> Co-authored-by: Matthew Wear <matthew.wear@gmail.com>
Validate pull request titles to ensure they adhere to conventional commits. This matches the validation performed in contrib. Co-authored-by: Matthew Wear <matthew.wear@gmail.com>
The OTEL_EXPORTER_OTLP_METRICS_TEMPORALITY_PREFERENCE env var sets the temporality as a string. However, checks throughout the metrics SDK and the OTLP exporter expect the temporality to be a symbol. Now, when aggregations that use this env var are initialized, the temporality will be coerced into a symbol.
Co-authored-by: Kayla Reopelle <87386821+kaylareopelle@users.noreply.github.com>
Co-authored-by: Kayla Reopelle <87386821+kaylareopelle@users.noreply.github.com>
…elemetry#1752) * test: Use Zlib.gunzip to compare body with estr Zlib.gzip adds a timestamp, which may be different than the one in the encoded req.body due to the test timing, and may cause an intermittent failure. Compare the unzipped request with the encoded_estr to avoid the timestamp interfering with the equality check. Co-authored-by: Tanna McClure <tannalynn@users.noreply.github.com> * test: Remove skip for TruffleRuby The assertions in this test differ from the other intermittent failures. Hopefully, the test is not failing and was skipped because the name of the test is the same as others. * chore: Remove comment --------- Co-authored-by: Tanna McClure <tannalynn@users.noreply.github.com>
* release: Release 2 gems * opentelemetry-metrics-api 0.1.1 (was 0.1.0) * opentelemetry-metrics-sdk 0.3.0 (was 0.2.0) * chore: Update CHANGELOG for metrics api * chore: Increase minimum metrics API version Refactors prevent a lower version from being compatible with the latest metrics SDK * chore: Use fixed instead of added in changelog --------- Co-authored-by: Daniel Azuma <dazuma@gmail.com> Co-authored-by: Kayla Reopelle <kreopelle@newrelic.com>
Previously, a no-op Logger was returned when LoggerProvider#logger was called after the provider was stopped. Now, when the provider is stopped, the on_emit method will return early and not emit any log records. This more closely follows the behavior in the TracerProvider.
We have to instantiate the processor outside of the stub so that the stub can be applied to the processor, but the method we're stubbing runs on initialization, so we sometimes run out of expectations. If we explicitly set 'OTEL_RUBY_BLRP_START_THREAD_ON_BOOT' to 'false' for the 'removes the older log records from the batch if full' test, the stubbed `work` method will not run outside of the stub block. Co-authored-by: Tanna McClure <tannalynn@users.noreply.github.com>
|
Closing, as this has been merged into main upstream. See: open-telemetry#1725 |
OpenTelemetry.logger_provider