Abstract out OTLP http exporter logic#5160
Abstract out OTLP http exporter logic#5160lorenzoronzani wants to merge 20 commits intoopen-telemetry:mainfrom
Conversation
|
/easycla |
2a75552 to
4405d3e
Compare
There was a problem hiding this comment.
I would recommend reconsidering your approach here. I'm generally not a huge fan of having functions with a huge number of arguments. I'd generally be more in favor of creating a common OTLPHttpClient, as is done in this PR
I was thinking the same but looking around I thought that the implemented method was the one expected. I can convert with a common client class. Thanks for the review |
|
I moved these 3 public constants: from each exporter (Log, Metric, Trace) into the common one but this Q: What is the right process in this cases? |
| break | ||
| return LogRecordExportResult.FAILURE | ||
| return ( | ||
| LogRecordExportResult.SUCCESS |
There was a problem hiding this comment.
can this Enum be part of _SignalConfig and returned directly from OTLPHttpClient
There was a problem hiding this comment.
Could be but I don't like to much that the parent needs to know children. This because you need to specify a list of types but what about in the future I want to add a new type of exporter? I should edit also the parent class.
What do you think?
|
|
||
| ## Unreleased | ||
|
|
||
| - `opentelemetry-exporter-otlp-proto-http`: refactor shared HTTP exporter logic into common module, extract `_setup_session`, `_export`, |
There was a problem hiding this comment.
This description is sort of obsolete now
There was a problem hiding this comment.
Thanks for spotting that. I am waiting because I don't know what do we want to do with public constants like what I said in my previous comment. This is important because if we want to proceed with moved them into the parent class this it's a breaking change
Description
This PR contains the refactoring required inside the
http_exporter_logiccomponent. The idea is to remove the duplicated code abstracting out inside a common sectionFixes #2990
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
uv run tox -e py312-test-opentelemetry-exporter-otlp-proto-httpDoes This PR Require a Contrib Repo Change?
Checklist: