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

Deprecate component.Host.GetExporters #7390

Merged
merged 5 commits into from
May 26, 2023

Conversation

djaglowski
Copy link
Member

See #7370

@codecov
Copy link

codecov bot commented Mar 15, 2023

Codecov Report

Patch and project coverage have no change.

Comparison is base (87dd85a) 91.02% compared to head (4ffb16f) 91.02%.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #7390   +/-   ##
=======================================
  Coverage   91.02%   91.02%           
=======================================
  Files         295      295           
  Lines       14535    14535           
=======================================
  Hits        13231    13231           
  Misses       1042     1042           
  Partials      262      262           
Impacted Files Coverage Δ
service/host.go 89.47% <ø> (ø)
service/internal/graph/graph.go 98.68% <ø> (ø)

☔ View full report in Codecov by Sentry.
📢 Do you have feedback about the report comment? Let us know in this issue.

@djaglowski djaglowski marked this pull request as ready for review March 15, 2023 20:51
@djaglowski djaglowski requested review from a team and bogdandrutu March 15, 2023 20:51
Copy link
Member

@mx-psi mx-psi left a comment

Choose a reason for hiding this comment

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

LGTM, should we also deprecate

func (host *serviceHost) GetExporters() map[component.DataType]map[component.ID]component.Component {
and
func (g *pipelinesGraph) GetExporters() map[component.DataType]map[component.ID]component.Component {

to avoid further internal usage of these methods?

Also, we may need to add exceptions for existing components on contrib that use this method while we migrate them

@djaglowski djaglowski force-pushed the deprecate-get-exporters branch 2 times, most recently from 432e97c to 860b695 Compare March 21, 2023 15:25
component/host.go Outdated Show resolved Hide resolved
service/host.go Outdated Show resolved Hide resolved
service/internal/graph/graph.go Outdated Show resolved Hide resolved
@bogdandrutu
Copy link
Member

There are some usages that cannot be converted I believe, one is in the signalfx receiver. cc @dmitryax

@dmitryax
Copy link
Member

dmitryax commented Mar 23, 2023

There are some usages that cannot be converted I believe, one is in the signalfx receiver. cc @dmitryax

At Splunk, we rely on metadata updates sent directly from receivers to exporters. The same approach is implemented in k8scluster receiver, which we have an issue for open-telemetry/opentelemetry-collector-contrib#19741. The effort to replace that mechanism is significant. So maybe we wait for an alternative implementation before deprecating host.GetExporters?

@dmitryax
Copy link
Member

dmitryax commented Mar 23, 2023

Also, we usually resolve all the to-be-deprecated usages in contrib before the actual deprecation in the core. Then, the deprecated API is usually removed on the next release. That way, we avoid adding //nolint comments in contrib. This deprecation should definitely stay longer than one version, but I still think deprecating it now is too aggressive. I'd like to have at least some solution for the metadata updates first.

@djaglowski
Copy link
Member Author

There are some usages that cannot be converted I believe, one is in the signalfx receiver. cc @dmitryax

#7370 details all uses in core and contrib. k8sclusterreciever -> signalfxexporter is the only case that cannot be solved with a connector, but it can be solved with an extension.

we usually resolve all the to-be-deprecated usages in contrib before the actual deprecation in the core.

In this case at least, I wonder if by waiting to deprecate we could be inviting additional novel uses that would have to be untangled. If you think it'll be a while before k8sclusterreciever -> signalfxexporter can use an extension, perhaps we could deprecate when that is the only remaining case? Then we only have one //nolint but in exchange we could discourage misuse.

@dmitryax
Copy link
Member

#7370 details all uses in core and contrib. k8sclusterreciever -> signalfxexporter is the only case that cannot be solved with a connector, but it can be solved with an extension.

We also use that in some receivers in Splunk distribution, but it's the same metadata use case.

In this case at least, I wonder if by waiting to deprecate we could be inviting additional novel uses that would have to be untangled. If you think it'll be a while before k8sclusterreciever -> signalfxexporter can use an extension, perhaps we could deprecate when that is the only remaining case? Then we only have one //nolint but in exchange we could discourage misuse.

Sounds good to me. Let's migrate at least a couple of components before deprecating. And I'll start planning the migration for open-telemetry/opentelemetry-collector-contrib#19741. I'm good with deprecating it earlier, but we need a more descriptive message telling users it'll stay until all the usages in contrib are migrated with a link to #7370. Currently, it seems like it'll be dropped next release as it's usually done for other deprecations.

@djaglowski
Copy link
Member Author

I'm good with deprecating it earlier, but we need a more descriptive message telling users it'll stay until all the usages in contrib are migrated with a link to #7370. Currently, it seems like it'll be dropped next release as it's usually done for other deprecations.

Good points. I'll update the comment and will continue pushing forward with the other uses.

@djaglowski djaglowski force-pushed the deprecate-get-exporters branch from 6587e2c to f6be42d Compare March 27, 2023 13:57
@github-actions
Copy link
Contributor

This PR was marked stale due to lack of activity. It will be closed in 14 days.

@github-actions github-actions bot added the Stale label Apr 11, 2023
@mx-psi mx-psi removed the Stale label Apr 11, 2023
@github-actions
Copy link
Contributor

This PR was marked stale due to lack of activity. It will be closed in 14 days.

@github-actions github-actions bot added the Stale label Apr 26, 2023
@mx-psi mx-psi removed the Stale label Apr 26, 2023
@github-actions
Copy link
Contributor

This PR was marked stale due to lack of activity. It will be closed in 14 days.

@github-actions github-actions bot added the Stale label May 11, 2023
@mx-psi mx-psi removed the Stale label May 11, 2023
@github-actions
Copy link
Contributor

This PR was marked stale due to lack of activity. It will be closed in 14 days.

Copy link
Member

@dmitryax dmitryax left a comment

Choose a reason for hiding this comment

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

I think we can merge it. Let's just remove the target version for now?

component/host.go Outdated Show resolved Hide resolved
Copy link
Member

@dmitryax dmitryax left a comment

Choose a reason for hiding this comment

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

I think we can merge it. Let's just remove the target version for now?

component/host.go Outdated Show resolved Hide resolved
service/host.go Outdated Show resolved Hide resolved
service/internal/graph/graph.go Outdated Show resolved Hide resolved
@djaglowski djaglowski force-pushed the deprecate-get-exporters branch from f19068b to 4ffb16f Compare May 26, 2023 10:21
@djaglowski djaglowski added the ready-to-merge Code review completed; ready to merge by maintainers label May 26, 2023
@dmitryax dmitryax merged commit fe2ae8d into open-telemetry:main May 26, 2023
@github-actions github-actions bot added this to the next release milestone May 26, 2023
@djaglowski djaglowski deleted the deprecate-get-exporters branch May 30, 2023 14:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ready-to-merge Code review completed; ready to merge by maintainers
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants