Skip to content

Commit

Permalink
fix: init tracer provider without resource attribute if ebpf
Browse files Browse the repository at this point in the history
  • Loading branch information
Tamir David authored and Tamir David committed Aug 26, 2024
1 parent c1cdb0c commit a9521bb
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions initializer/components.py
Original file line number Diff line number Diff line change
Expand Up @@ -63,15 +63,14 @@ def initialize_components(trace_exporters = None, metric_exporters = None, log_e
def initialize_traces_if_enabled(trace_exporters, resource, span_processor = None):
traces_enabled = os.getenv(sdk_config.OTEL_TRACES_EXPORTER, "none").strip().lower()
if traces_enabled != "none":

provider = TracerProvider(resource=resource)


# TODO: uncomment once the OdigosSampler is implemented
# odigos_sampler = OdigosSampler()
# sampler = ParentBased(odigos_sampler)

# Exporting using exporters
if trace_exporters is not None:
provider = TracerProvider(resource=resource)
id_generator_name = sdk_config._get_id_generator()
id_generator = sdk_config._import_id_generator(id_generator_name)
provider.id_generator = id_generator
Expand All @@ -86,6 +85,7 @@ def initialize_traces_if_enabled(trace_exporters, resource, span_processor = Non

# Exporting using EBPF
else:
provider = TracerProvider()
set_tracer_provider(provider)
if span_processor is not None:
provider.add_span_processor(span_processor)
Expand Down

0 comments on commit a9521bb

Please sign in to comment.