Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Using sampler obj instead of name
  • Loading branch information
jeremydvoss committed May 28, 2024
commit 238ca3df0fac563c44b47e39683df3d33519867d
Original file line number Diff line number Diff line change
Expand Up @@ -365,8 +365,8 @@ def _initialize_components(
metric_exporter_names: Optional[list[str]] = None,
log_exporter_names: Optional[list[str]] = None,
# Could be sampler obj
sampler_name: Optional[str] = None,
# sampler: Optional[Sampler] = None,
# sampler_name: Optional[str] = None,
sampler: Optional[Sampler] = None,
# Could be attribute dict or Resource object
# resource_attributes: Optional[Attributes] = None,
resource: Optional[Resource] = None,
Expand All @@ -378,13 +378,14 @@ def _initialize_components(
metric_exporter_names + _get_exporter_names("metrics"),
log_exporter_names + _get_exporter_names("logs"),
)
if sampler_name is None:
sampler_name = _get_sampler()
sampler = _import_sampler(sampler_name)
# If using sampler obj instead of name
# if sampler is None:
# If using sampler name instead of sampler obj
# if sampler_name is None:
# sampler_name = _get_sampler()
# sampler = _import_sampler(sampler_name)
# sampler = _import_sampler(sampler_name)
# If using sampler obj instead of name. This means user would have to specify the rate on their own
if sampler is None:
sampler_name = _get_sampler()
sampler = _import_sampler(sampler_name)
if id_generator_name is None:
id_generator_name = _get_id_generator()
id_generator = _import_id_generator(id_generator_name)
Expand Down