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

metadata generated_metrics compilation error (v119.0) #12402

Open
Dainerx opened this issue Feb 17, 2025 · 1 comment · May be fixed by #12403
Open

metadata generated_metrics compilation error (v119.0) #12402

Dainerx opened this issue Feb 17, 2025 · 1 comment · May be fixed by #12403
Labels
bug Something isn't working cmd/mdatagen

Comments

@Dainerx
Copy link
Contributor

Dainerx commented Feb 17, 2025

Component(s)

cmd/mdatagen

What happened?

Describe the bug
After adding support to the scraper component type, the generated_metrics.go file will produce a compilation error within any component that's not a Receiver or a Scraper.

Steps to reproduce
Create a connector that has metadata.yml file, run make generate.

What did you expect to see?

func WithStartTime(startTime pcommon.Timestamp) MetricBuilderOption {
	return metricBuilderOptionFunc(func(mb *MetricsBuilder) {
		mb.startTime = startTime
	})
}
func NewMetricsBuilder(mbc MetricsBuilderConfig, settings {{ .Status.Class }}.Settings, options ...MetricBuilderOption) *MetricsBuilder {
	mb := &MetricsBuilder{
        ... 
        }
}

What did you see instead?

func WithStartTime(startTime pcommon.Timestamp) MetricBuilderOption {
	return metricBuilderOptionFunc(func(mb *MetricsBuilder) {
		mb.startTime = startTime
	})
}
// No function signature
	mb := &MetricsBuilder{
        ... 
        }
}

Collector version

v119.0

Environment information

Environment

All environments

@Dainerx Dainerx added the bug Something isn't working label Feb 17, 2025
Dainerx added a commit to Dainerx/opentelemetry-collector that referenced this issue Feb 17, 2025
Copy link
Contributor

Pinging code owners:

See Adding Labels via Comments if you do not have permissions to add labels yourself.

Dainerx added a commit to Dainerx/opentelemetry-collector that referenced this issue Feb 17, 2025
Dainerx added a commit to Dainerx/opentelemetry-collector that referenced this issue Feb 17, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working cmd/mdatagen
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant