Add OTLP HTTP MetricExporter max_export_batch_size#4576
Conversation
|
I think the aiohttp-client test failure is a hiccup from the recent release, not from changes in this PR. |
|
Working on some conflict resolution with changes introduced in #4564 |
|
Hi @lzchen and @open-telemetry/python-approvers , please may I have a new review of this PR. In 25e8be9 I resolved merge conflicts which required some redesign of HTTP metrics batching to match the timeout updates in #4564. That was the main change since last approval; the The last Cassandra and Celery instrumentor test failures seem unrelated and are citing commit hashes like similar failures in other PRs. |
Hi again, please may I have a review |
42Questions
left a comment
There was a problem hiding this comment.
Two comments re implementation.
MikeGoldsmith
left a comment
There was a problem hiding this comment.
Looks good. Left one comment regarding reporting failures across batches.
|
This PR has been automatically marked as stale because it has not had any activity for 14 days. It will be closed if no further activity occurs within 14 days of this comment. |
|
Not stale - Can someone from @open-telemetry/python-approvers take a look please? |
There was a problem hiding this comment.
Hi @tammy-baylis-swi @lzchen. I was trying to wrap my head around this PR while merging main into my branch, but I am wondering, does it actually work? The types seem to be very off, and I think only work since everything is mocked heavily in the unit tests - the bytes sent will probably be the wrong type based on my skim.
If that sounds right, could it be reverted and tried again?
|
|
||
|
|
||
| def _split_metrics_data( | ||
| metrics_data: pb2.MetricsData, |
There was a problem hiding this comment.
This should be ExportMetricsServiceRequest
| def _split_metrics_data( | ||
| metrics_data: pb2.MetricsData, | ||
| max_export_batch_size: int | None = None, | ||
| ) -> Iterable[pb2.MetricsData]: |
There was a problem hiding this comment.
I think this is also supposed to be Iterable[ExportMetricsServiceRequest]
| # Non-retryable | ||
| MagicMock(ok=False, status_code=400, reason="bad request"), | ||
| ] | ||
| mock_encode_metrics.return_value = pb2.MetricsData( |
There was a problem hiding this comment.
encode_metrics returns ExportMetricsServiceRequest
Hi @anuraaga , I'll take a look. Meanwhile, could you share more about your issue? What specific error do you get when you opt into this feature while instrumenting your test services? |
This gist contains a quick demo app and output using changes from this PR and |
|
Thanks @tammy-baylis-swi for confirming. It seems the collector works with either proto so the issue may be less pressing, but I filed #5014 since it still seems needs fixing |
Description
Adds support for HTTP OTLPMetricExporter configurable
max_export_batch_size, like the gRPC OTLPMetricExporter already does (completed through issue #2710 with PR #2809).This is currently much longer than the gRPC version because:
Fixes #4577
Type of change
Please delete options that are not relevant.
How Has This Been Tested?
Please describe the tests that you ran to verify your changes. Provide instructions so we can reproduce. Please also list any relevant details for your test configuration
add(1)calls to eachmax_export_batch_size=2and endpoint as Collector (debug).Does This PR Require a Contrib Repo Change?
Checklist: