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

Log record processor with emit updates #9

Merged

Conversation

kaylareopelle
Copy link
Owner

  • merges in main
  • backfills refactors from Logger#on_emit PR
  • updates log record limits to accommodate the structure changes in the Logger#on_emit PR

plantfansam and others added 18 commits April 17, 2024 09:44
* try upgrading codeql action

* remove codeql workflow
…ry#1628)

Co-authored-by: Francis Bogsanyi <francis.bogsanyi@shopify.com>
…d Span" warnings (open-telemetry#1620)

* fix: Update `untraced` to suppress logging "Calling finish on an ended Span" warnings

* add tests for untraced

* disable Metrics/PerceivedComplexity in TracerProvider#internal_start_span

* remove setting ALWAYS_ON from test cases

* return a non-recording span without calling @sampler.should_sample

---------

Co-authored-by: Francis Bogsanyi <francis.bogsanyi@shopify.com>
)

* chore: bump ruby/setup-ruby from 1.165.1 to 1.176.0

To fix an error[1] on macos runners resolved in v1.171.0[2]:

    The current runner (macos-14-arm64) was detected as self-hosted
    because the platform does not match a GitHub-hosted runner image
    (or that imageis deprecated and no longer supported).

[1] ruby/setup-ruby#568
[2] ruby/setup-ruby#567

* resolve missing constant error in Ruby 3.3.1
* feat: Support non block structured untraced context
…etry#1637)

* release: Release opentelemetry-common 0.21.0 (was 0.20.1)

---------

Co-authored-by: Robert Laurin <robert.laurin@shopify.com>
See open-telemetry/community#2056 for background

Co-authored-by: Francis Bogsanyi <francis.bogsanyi@shopify.com>
Co-authored-by: Armin Ruech <7052238+arminru@users.noreply.github.com>
…n-telemetry#1632)

Co-authored-by: Daniel Azuma <dazuma@gmail.com>
Co-authored-by: Francis Bogsanyi <francis.bogsanyi@shopify.com>
* chore: bump ruby/setup-ruby to 1.179.0

* Skip bundler 2.5.11 which breaks truffleruby

* Pin to bundler 2.5.10

* Revert "Skip bundler 2.5.11 which breaks truffleruby"

This reverts commit 8298bba.
* Update to google_protobuf >=3.18

* Update exporter/otlp-metrics/opentelemetry-exporter-otlp-metrics.gemspec

Co-authored-by: Francis Bogsanyi <francis.bogsanyi@shopify.com>

---------

Co-authored-by: Francis Bogsanyi <francis.bogsanyi@shopify.com>
…n-telemetry#1646)

* release: Release opentelemetry-exporter-otlp 0.28.0 (was 0.27.0)

---------

Co-authored-by: Robert Laurin <robert.laurin@shopify.com>
Log more information about why an SSL error occured as this can be very difficult to diagnose. This is logged in the same way as other probably fatal issues are, e.g. HTTP 404s.

Co-authored-by: Matthew Wear <matthew.wear@gmail.com>
* opentelemetry-api 1.3.0 (was 1.2.5)
* opentelemetry-sdk 1.5.0 (was 1.4.1)
* opentelemetry-exporter-otlp 0.28.1 (was 0.28.0)
* opentelemetry-semantic_conventions 1.10.1 (was 1.10.0)

Co-authored-by: Daniel Azuma <dazuma@gmail.com>
* feat: Update Logger#on_emit to create LogRecords

* Update logs_sdk/lib/opentelemetry/sdk/logs/log_record_data.rb

Co-authored-by: James Bunch <fallwith@gmail.com>

* feat: Use Context instead of SpanContext

Previously, trace_id, span_id, and trace_flags were assigned based on
the OpenTelemetry::Trace.current_span's SpanContext. The specification
requires a context be accepted as an argument on emit.

If no context is provided, OpenTelemetry::Context.current will be used.

If there isn't a current span on OpenTelemetry::Context.current
trace_id, span_id, and trace_flags will be nil unless they are passed
as arguments.

Also, remaining #emit methods are renamed to #on_emit.

* chore: Add logger provider on emit test

* chore: Remove span_context from  LogRecord

This code was leftover and should have been removed.
Now, the specfic `trace_id`, `span_id`, and `trace_flags`
attributes are used instead.

* feat: Use Time for timestamps

Convert Time to the appropriate nanosecond format in LogRecordData.
Remove Float option from argument declaration.

* feat: Move nanosecond conversion to LogRecord

The LogRecordData definition says the time is already
Integer nanoseconds since epoch, so move the logic to convert
the timestamp to LogRecord#to_log_record_data

* feat: Create LogRecord in LoggerProvider#on_emit

* Follow the pattern in TracerProvider#internal_start_span
* Update spacing in LogRecordData
* Remove resource references outside LoggerProvider
* Remove Logger attr_readers for logger_provider and
  instrumentation_scope

---------

Co-authored-by: James Bunch <fallwith@gmail.com>
Co-authored-by: Matthew Wear <matthew.wear@gmail.com>
Now that we instantiate log records in the logger provider, we can
access the log_record_limits when we create a new log record.
Pass the log_record_limits directly from the logger provider to
the log record and apply the limits in the log record class.
@kaylareopelle kaylareopelle merged commit c79f528 into log-record-processor3 Jul 31, 2024
@kaylareopelle kaylareopelle deleted the log-record-processor-with-emit-updates branch July 31, 2024 16:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

10 participants