diff --git a/flow/cmd/worker.go b/flow/cmd/worker.go index 7702ba5ebd..ef4f0bbca2 100644 --- a/flow/cmd/worker.go +++ b/flow/cmd/worker.go @@ -140,7 +140,7 @@ func WorkerSetup(opts *WorkerSetupOptions) (*workerSetupResponse, error) { var metricsProvider *sdkmetric.MeterProvider var otelManager *otel_metrics.OtelManager if opts.EnableOtelMetrics { - metricsProvider, err = otel_metrics.SetupOtelMetricsExporter() + metricsProvider, err = otel_metrics.SetupOtelMetricsExporter("flow-worker") if err != nil { return nil, err } diff --git a/flow/otel_metrics/otel_manager.go b/flow/otel_metrics/otel_manager.go index 85190f75b9..ceb7a511db 100644 --- a/flow/otel_metrics/otel_manager.go +++ b/flow/otel_metrics/otel_manager.go @@ -32,7 +32,7 @@ func newOtelResource(otelServiceName string) (*resource.Resource, error) { return r, err } -func SetupOtelMetricsExporter() (*sdkmetric.MeterProvider, error) { +func SetupOtelMetricsExporter(otelServiceName string) (*sdkmetric.MeterProvider, error) { metricExporter, err := otlpmetrichttp.New(context.Background(), otlpmetrichttp.WithCompression(otlpmetrichttp.GzipCompression), ) @@ -40,7 +40,7 @@ func SetupOtelMetricsExporter() (*sdkmetric.MeterProvider, error) { return nil, fmt.Errorf("failed to create OpenTelemetry metrics exporter: %w", err) } - resource, err := newOtelResource("flow-worker") + resource, err := newOtelResource(otelServiceName) if err != nil { return nil, fmt.Errorf("failed to create OpenTelemetry resource: %w", err) }