Skip to content

Migrate receiver creator to internal data model #701

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

Merged
merged 1 commit into from
Aug 13, 2020

Conversation

dmitryax
Copy link
Member

@dmitryax dmitryax commented Aug 12, 2020

Description:
Once simple prometheus exporter migrated to internal data model, it cannot be dynamically created anymore. This commit migrate receiver creator to internal data model along with other receivers that can be created dynamically:

  • kubeletstatsreceiver
  • redisreceiver

The receivers are not migrated completely. For now they use converters. This fixes the currently broken build.

@dmitryax dmitryax requested a review from a team August 12, 2020 23:39
@dmitryax dmitryax force-pushed the convert-metrics-creator branch 3 times, most recently from 459ef24 to 8879641 Compare August 13, 2020 01:05

// This is a copy of go.opentelemetry.io/collector/component/componenttest/example_factories.go
// migrated to internal data model
// TODO: Remove it once this package the one in core updated to support the new data model
Copy link
Member

Choose a reason for hiding this comment

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

Please create an issue.

Copy link
Member Author

Choose a reason for hiding this comment

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

@dmitryax dmitryax force-pushed the convert-metrics-creator branch from 8879641 to a49402b Compare August 13, 2020 01:07
@@ -89,7 +91,7 @@ func (r *runnable) Run() error {
ctx := obsreport.ReceiverContext(r.ctx, typeStr, transport, r.receiverName)
for _, md := range mds {
ctx = obsreport.StartMetricsReceiveOp(ctx, typeStr, transport)
err = r.consumer.ConsumeMetricsData(ctx, *md)
err = r.consumer.ConsumeMetrics(ctx, pdatautil.MetricsFromMetricsData([]consumerdata.MetricsData{*md}))
Copy link
Member

Choose a reason for hiding this comment

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

Please create an issue to change line 89 kubelet.NewMetadata(r.extraMetadataLabels, podsMetadata) to return an array of non pointers to avoid this for loop :)

Copy link
Member Author

Choose a reason for hiding this comment

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

@bogdandrutu
Copy link
Member

Fix the lint checks

@dmitryax dmitryax force-pushed the convert-metrics-creator branch 3 times, most recently from c394f1a to bac2f34 Compare August 13, 2020 01:48
Once simple prometheus exporter migrated to internal data model, it cannot be dynamically created anymore. This commit migrate receiver creator to internal data model along with other receivers that can be created dynamically:
- kubeletstatsreceiver
- redisreceiver

The receivers are not migrated completely. For now they use converters. This fixes the currently broken build.
@dmitryax dmitryax force-pushed the convert-metrics-creator branch from 3b057d6 to daeb40f Compare August 13, 2020 04:04
@bogdandrutu bogdandrutu merged commit a92c8ac into open-telemetry:master Aug 13, 2020
dyladan referenced this pull request in dynatrace-oss-contrib/opentelemetry-collector-contrib Jan 29, 2021
ljmsc referenced this pull request in ljmsc/opentelemetry-collector-contrib Feb 21, 2022
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