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: OTLP Log Record Exporter #12

Closed
wants to merge 35 commits into from
Closed

Conversation

kaylareopelle
Copy link
Owner

@kaylareopelle kaylareopelle commented Aug 28, 2024

OTLP Logs exporter

  • add mutual TLS
  • remove write timeout
  • write readme
  • verify the tests (something isn't lining up in translates all the things)
  • check SSL verify none behavior
  • check the version
  • Remove measure_request_duration?
  • Post after logger provider code merged into the API can post before, just need to update exporter tests later
  • have rubocop inherit from the main file

@kaylareopelle kaylareopelle changed the title Otlp log record exporter OTLP Log Record Exporter Sep 12, 2024
@kaylareopelle kaylareopelle force-pushed the otlp-log-record-exporter branch from 38fc818 to ee8cda1 Compare September 12, 2024 05:35
kaylareopelle and others added 13 commits September 11, 2024 22:39
…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>
@kaylareopelle kaylareopelle changed the title OTLP Log Record Exporter feat: OTLP Log Record Exporter Oct 15, 2024
kaylareopelle and others added 11 commits October 15, 2024 13:32
…pentelemetry-ruby into otlp-log-record-exporter
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>
kaylareopelle and others added 9 commits October 31, 2024 12:14
This reduces the number of retries that run during tests
to speed up the tests
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>
… and Instrument Registry (open-telemetry#1725)

* WIP: Log SDK configuration

* feat: Add configuration patch for logs SDK

* style: Update spacing

* test: Add tests for logs api

* feat: Update inheritance to get tests to pass

* feat: Add Instrument Registry to LoggerProvider

Create a registry for loggers to make sure a logger with an identical
name and version is created only once and reused

* feat: Rescue NameError for OTLP logs exporter

When OTLP logs exporter not installed, rescue the error, emit a message
and set the exporter to nil.

* Remove skip instrumenting stuff

* style: Rubocop

* test: Add skip for intermittent failure

* refactor: Remove delegate, mutex from ProxyLogger

* fix: Do not emit logs if stopped

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.
* feat: Add configuration patch to set metrics exporter by environment variable

The environment variable has options for:
* console (default)
* otlp
* in-memory
* none

Like the Traces exporter, more than one exporter can be configured

* fix: Use updated class name for OTLP exporter

* feat: Update config patch for spec compliance

* Default option is now OTLP
* In-Memory option removed, it's not in the spec
* PeriodicMetricReader added for both Console and OTLP exporters
* Add the metrics OTLP exporter gem to the test gem group

* test: Remove setup/teardown tracer env var setting

* test: Update tests for JRuby

* style: Rubocop lines in block

---------

Co-authored-by: Matthew Wear <matthew.wear@gmail.com>
@kaylareopelle
Copy link
Owner Author

Closing in favor of: open-telemetry#1727

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.

5 participants