From 1ef2739c4f2300b1171fe8983f4cfe0a8bf33ec5 Mon Sep 17 00:00:00 2001 From: Kunal Gupta <39487888+iamKunalGupta@users.noreply.github.com> Date: Tue, 21 May 2024 07:09:13 +0530 Subject: [PATCH] refactor: rename common package to prevent conflicts/confusion --- flow/instrumentation/{common => otel_common}/resource.go | 2 +- flow/instrumentation/tracing/setup.go | 4 ++-- flow/otel_metrics/otel_manager.go | 4 ++-- 3 files changed, 5 insertions(+), 5 deletions(-) rename flow/instrumentation/{common => otel_common}/resource.go (95%) diff --git a/flow/instrumentation/common/resource.go b/flow/instrumentation/otel_common/resource.go similarity index 95% rename from flow/instrumentation/common/resource.go rename to flow/instrumentation/otel_common/resource.go index 517ea0a60e..4b51759deb 100644 --- a/flow/instrumentation/common/resource.go +++ b/flow/instrumentation/otel_common/resource.go @@ -1,4 +1,4 @@ -package common +package otel_common import ( "go.opentelemetry.io/otel/sdk/resource" diff --git a/flow/instrumentation/tracing/setup.go b/flow/instrumentation/tracing/setup.go index 4c2aabc902..01850312f2 100644 --- a/flow/instrumentation/tracing/setup.go +++ b/flow/instrumentation/tracing/setup.go @@ -11,7 +11,7 @@ import ( "go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp" sdktrace "go.opentelemetry.io/otel/sdk/trace" - "github.com/PeerDB-io/peer-flow/instrumentation/common" + "github.com/PeerDB-io/peer-flow/instrumentation/otel_common" "github.com/PeerDB-io/peer-flow/peerdbenv" ) @@ -61,7 +61,7 @@ func SetupOtelTraceProviderExporter(otelServiceName string) (func(ctx context.Co if err != nil { return nil, fmt.Errorf("failed to create OpenTelemetry trace exporter: %w", err) } - otelResource, err := common.NewOtelResource(otelServiceName) + otelResource, err := otel_common.NewOtelResource(otelServiceName) if err != nil { return nil, fmt.Errorf("failed to create OpenTelemetry resource: %w", err) } diff --git a/flow/otel_metrics/otel_manager.go b/flow/otel_metrics/otel_manager.go index 56ec2406ed..0cd1f20aa3 100644 --- a/flow/otel_metrics/otel_manager.go +++ b/flow/otel_metrics/otel_manager.go @@ -9,7 +9,7 @@ import ( "go.opentelemetry.io/otel/metric" sdkmetric "go.opentelemetry.io/otel/sdk/metric" - "github.com/PeerDB-io/peer-flow/instrumentation/common" + "github.com/PeerDB-io/peer-flow/instrumentation/otel_common" "github.com/PeerDB-io/peer-flow/peerdbenv" ) @@ -44,7 +44,7 @@ func SetupOtelMetricsExporter(otelServiceName string) (*sdkmetric.MeterProvider, if err != nil { return nil, fmt.Errorf("failed to create OpenTelemetry metrics exporter: %w", err) } - otelResource, err := common.NewOtelResource(otelServiceName) + otelResource, err := otel_common.NewOtelResource(otelServiceName) if err != nil { return nil, fmt.Errorf("failed to create OpenTelemetry resource: %w", err) }