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

Add *args, **kwargsto user implementable interfaces #2650

Closed
ocelotl opened this issue Apr 28, 2022 · 2 comments · Fixed by #2654
Closed

Add *args, **kwargsto user implementable interfaces #2650

ocelotl opened this issue Apr 28, 2022 · 2 comments · Fixed by #2654
Assignees
Labels
1.10.0rc1 release candidate 1 for metrics GA metrics

Comments

@ocelotl
Copy link
Contributor

ocelotl commented Apr 28, 2022

I think potentially we should try to add *args, **kwargs or config objects to any user implementable interfaces going forward to avoid this kind of issue.

Originally posted by @aabmass in #2402 (comment)

@lzchen
Copy link
Contributor

lzchen commented Apr 29, 2022

Adding this to metric components will probably be blocking for the release. Should only be a few (exporter, metricreader).

@lzchen lzchen added 1.10.0rc1 release candidate 1 for metrics GA metrics labels Apr 29, 2022
@ocelotl ocelotl self-assigned this Apr 29, 2022
@ocelotl ocelotl changed the title I think potentially we should try to add *args, **kwargs or config objects to any user implementable interfaces going forward to avoid this kind of issue. Add *args, **kwargsto user implementable interfaces Apr 29, 2022
ocelotl added a commit to ocelotl/opentelemetry-python that referenced this issue May 1, 2022
ocelotl added a commit to ocelotl/opentelemetry-python that referenced this issue May 2, 2022
ocelotl added a commit to ocelotl/opentelemetry-python that referenced this issue May 2, 2022
@aabmass
Copy link
Member

aabmass commented May 3, 2022

Just want to call out one alternative:

@dataclass(frozen=True)
class ExportConfig:
  pass

# ...
class MetricExporter(ABC):
  def export(self, metrics: Sequence[Metric], export_config: ExportConfig = ExportConfig()):
    pass

ocelotl added a commit that referenced this issue May 4, 2022
* Add variadic arguments to metric exporter/reader interfaces

Fixes #2650

* Add changelog entry

* Remove args

* Add args again

This reverts commit 7eb6134.

* Add missing args
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
1.10.0rc1 release candidate 1 for metrics GA metrics
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants