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

Reduce dependency on MetricsLevel throughout otel-arrow #283

Merged
merged 6 commits into from
Jan 24, 2025

Conversation

drewrelmas
Copy link
Collaborator

@drewrelmas drewrelmas commented Jan 24, 2025

Related to issue #280

Also see open-telemetry/opentelemetry-collector#11061 and open-telemetry/opentelemetry-collector#12143

There is a movement to remove MetricsLevel from the Collector's TelemetrySettings, which is used explicitly in various places in the otel-arrow project.

In addition to the 'dead code' identified in #280, this PR aims to remove other instances of reference to MetricsLevel.

In one case this is not currently possible because a component in opentelemetry-collector-contrib depends on an otel-arrow arrow_record function signature including MetricsLevel, see otelarrowreceiver. Instead, introduced a temporary WithMeterProviderAlt without that paramater that should become the new default implementation once the Contrib component is updated accordingly.

@drewrelmas drewrelmas marked this pull request as ready for review January 24, 2025 15:59
Comment on lines +448 to +458
var bytes int
bpt := b.processor.telemetry

// Check if the instrument is enabled to calculate the size of the batch in bytes.
// See https://pkg.go.dev/go.opentelemetry.io/otel/sdk/metric/internal/x#readme-instrument-enabled
batchSendSizeBytes := bpt.telemetryBuilder.ProcessorBatchBatchSendSizeBytes
instr, ok := batchSendSizeBytes.(interface{ Enabled(context.Context) bool })
if !ok || instr.Enabled(bpt.exportCtx) {
bytes = b.batch.sizeBytes(req)
}
b.processor.telemetry.record(trigger, int64(sent), bytes)

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I see you followed the upstream branch here. Thanks. (I don't love this, but I want it to stay close to the upstream!)

@jmacd jmacd merged commit 020393f into open-telemetry:main Jan 24, 2025
2 checks passed
@drewrelmas drewrelmas deleted the drewrelmas/remove-leveldetailed branch January 24, 2025 18:37
@drewrelmas drewrelmas mentioned this pull request Jan 24, 2025
jmacd pushed a commit that referenced this pull request Jan 24, 2025
- Make a generic `AttributesStore` in pkg/arrow.
[#276](#276)
- Update to v0.117.0 collector dependencies.
[#277](#277),
[#279](#279)
- Deprecate local versions of `fileexporter` and `filereceiver` in favor
of upstream components with related README changes.
[#278](#278)
- Made an incremental step towards deprecating `MetricsLevel` usage in
the project.
[#283](#283)
jmacd pushed a commit that referenced this pull request Feb 6, 2025
…119.0 (#287)

Related to #280, follow-up to #283 and
open-telemetry/opentelemetry-collector-contrib#37512.

Now that the Collector-Contrib `otelarrowreceiver` in release v0.119.0
uses the `WithMeterProviderAlt` function, it is safe to change the
signature of `WithMeterProvider` to follow through on the deprecation of
`MetricsLevel`.

After another otel-arrow release and subsequent contrib release, will
remove the `Alt` function entirely.

Finally, updated the `mdatagen` result in `concurrentbatchprocessor` to
reflect the additional deprecation of `MetricsLevel` following upstream
activity at
https://github.com/open-telemetry/opentelemetry-collector/tree/main/processor/batchprocessor.
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.

2 participants