Skip to content

Commit

Permalink
Add NewFactory method with type (#34703)
Browse files Browse the repository at this point in the history
  • Loading branch information
dineshg13 authored Mar 4, 2025
1 parent 3350070 commit 23a1092
Showing 1 changed file with 6 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,11 @@ func NewFactoryForAgent(s serializer.MetricSerializer, enricher tagenricher, hos

// NewFactory creates a new factory for the serializer exporter.
func NewFactory() exp.Factory {
return NewFactoryWithType(TypeStr)
}

// NewFactoryWithType creates a new factory for the serializer exporter with the given type string.
func NewFactoryWithType(typeStr string) exp.Factory {
var options []otlpmetrics.TranslatorOption
if !pkgdatadog.MetricRemappingDisabledFeatureGate.IsEnabled() {
options = append(options, otlpmetrics.WithRemapping())
Expand All @@ -119,7 +124,7 @@ func NewFactory() exp.Factory {
},
options: options,
}
cfgType := component.MustNewType(TypeStr)
cfgType := component.MustNewType(typeStr)
return exp.NewFactory(
cfgType,
newDefaultConfig,
Expand Down

0 comments on commit 23a1092

Please sign in to comment.