Skip to content

Commit

Permalink
Make span sample rate optional config for init
Browse files Browse the repository at this point in the history
  • Loading branch information
Yun-Kim committed Dec 31, 2024
1 parent 280c033 commit d9c8966
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion ddtrace/llmobs/_integrations/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,9 @@ def __init__(self, integration_config: IntegrationConfig) -> None:
self._log_writer = None
self._statsd = None
self.integration_config = integration_config
self._span_pc_sampler = RateSampler(sample_rate=integration_config.span_prompt_completion_sample_rate)
self._span_pc_sampler = RateSampler(
sample_rate=getattr(integration_config, "span_prompt_completion_sample_rate", 1.0)
)

if self.metrics_enabled:
self._statsd = get_dogstatsd_client(get_stats_url(), namespace=self._integration_name)
Expand Down

0 comments on commit d9c8966

Please sign in to comment.