Skip to content

Commit

Permalink
[chore] [cmd/mdatagen] Update status.go template
Browse files Browse the repository at this point in the history
To produce the same output as mdatagen in contrib. It makes it easy to compare the diff on the mdatagen migration
  • Loading branch information
dmitryax committed Mar 5, 2024
1 parent cb21fbe commit 4f065a2
Show file tree
Hide file tree
Showing 14 changed files with 44 additions and 59 deletions.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

14 changes: 6 additions & 8 deletions cmd/mdatagen/main_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -390,20 +390,19 @@ import (
)
var (
Type = component.MustNewType("foo")
scopeName = ""
Type = component.MustNewType("foo")
)
const (
MetricsStability = component.StabilityLevelBeta
)
func Meter(settings component.TelemetrySettings) metric.Meter {
return settings.MeterProvider.Meter(scopeName)
return settings.MeterProvider.Meter("")
}
func Tracer(settings component.TelemetrySettings) trace.Tracer {
return settings.TracerProvider.Tracer(scopeName)
return settings.TracerProvider.Tracer("")
}
`,
},
Expand All @@ -430,20 +429,19 @@ import (
)
var (
Type = component.MustNewType("foo")
scopeName = ""
Type = component.MustNewType("foo")
)
const (
MetricsStability = component.StabilityLevelAlpha
)
func Meter(settings component.TelemetrySettings) metric.Meter {
return settings.MeterProvider.Meter(scopeName)
return settings.MeterProvider.Meter("")
}
func Tracer(settings component.TelemetrySettings) trace.Tracer {
return settings.TracerProvider.Tracer(scopeName)
return settings.TracerProvider.Tracer("")
}
`,
},
Expand Down
5 changes: 2 additions & 3 deletions cmd/mdatagen/templates/status.go.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ import (

var (
Type = component.MustNewType("{{ .Type }}")
scopeName = "{{ .ScopeName }}"
)

const (
Expand All @@ -22,9 +21,9 @@ const (
)

func Meter(settings component.TelemetrySettings) metric.Meter {
return settings.MeterProvider.Meter(scopeName)
return settings.MeterProvider.Meter("{{ .ScopeName }}")
}

func Tracer(settings component.TelemetrySettings) trace.Tracer {
return settings.TracerProvider.Tracer(scopeName)
return settings.TracerProvider.Tracer("{{ .ScopeName }}")
}

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 3 additions & 4 deletions exporter/debugexporter/internal/metadata/generated_status.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 3 additions & 4 deletions exporter/otlpexporter/internal/metadata/generated_status.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 3 additions & 4 deletions receiver/otlpreceiver/internal/metadata/generated_status.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 4f065a2

Please sign in to comment.