Tracer Internals Reference
Reference for internal tracer components and advanced functionality.
Warning
This section documents internal APIs that are primarily for SDK maintainers and advanced use cases. For standard usage, see HoneyHiveTracer API Reference instead.
Core Components
Base Classes
- class honeyhive.tracer.core.base.HoneyHiveTracerBase(config=None, session_config=None, evaluation_config=None, *, api_key=<EXPLICIT>, project=<EXPLICIT>, session_name=<EXPLICIT>, source=<EXPLICIT>, server_url=<EXPLICIT>, session_id=<EXPLICIT>, disable_http_tracing=<EXPLICIT>, disable_batch=<EXPLICIT>, verbose=<EXPLICIT>, inputs=<EXPLICIT>, is_evaluation=<EXPLICIT>, run_id=<EXPLICIT>, dataset_id=<EXPLICIT>, datapoint_id=<EXPLICIT>, link_carrier=<EXPLICIT>, test_mode=<EXPLICIT>, **kwargs)[source]
Bases:
objectBase HoneyHive tracer with dynamic initialization and configuration.
This base class provides the core infrastructure for HoneyHive tracing including dynamic configuration handling, initialization logic, and foundational properties. It uses dynamic patterns for flexible setup.
Note: too-many-instance-attributes disabled - Base tracer class requires extensive attributes for configuration management, state tracking, API clients, threading locks, and backward compatibility support.
- Parameters:
config (DotDict)
session_config (SessionConfig | None)
evaluation_config (EvaluationConfig | None)
api_key (str | None | _ExplicitType)
project (str | None | _ExplicitType)
session_name (str | None | _ExplicitType)
source (str | _ExplicitType)
server_url (str | None | _ExplicitType)
session_id (str | None | _ExplicitType)
disable_http_tracing (bool | None | _ExplicitType)
disable_batch (bool | _ExplicitType)
verbose (bool | _ExplicitType)
is_evaluation (bool | _ExplicitType)
run_id (str | None | _ExplicitType)
dataset_id (str | None | _ExplicitType)
datapoint_id (str | None | _ExplicitType)
test_mode (bool | _ExplicitType)
kwargs (Any)
- classmethod reset()[source]
Reset static state for testing purposes.
This method provides backward compatibility for test environments that expect a reset capability. In the multi-instance architecture, this primarily delegates to the lifecycle management system.
- Return type:
None
- classmethod init(config=None, session_config=None, evaluation_config=None, **kwargs)[source]
Factory method for creating tracer instances with dynamic configuration.
This is a simple pass-through to __init__ for backwards compatibility.
- Parameters:
config (TracerConfig | None) – Pydantic tracer configuration
session_config (SessionConfig | None) – Session-specific configuration
evaluation_config (EvaluationConfig | None) – Evaluation-specific configuration
**kwargs (Any) – Backward-compatible parameters
- Returns:
Initialized HoneyHive tracer instance
- Return type:
NoOpSpan
- class honeyhive.tracer.core.base.NoOpSpan[source]
Bases:
objectNo-op span implementation for graceful degradation.
This class provides a safe default span that implements the same interface as a real span but performs no operations. This follows OpenTelemetry best practices for error handling - never return None, always return a usable object.
- record_exception(exception, attributes=None, timestamp=None, escaped=False)[source]
Record exception (no-op).
Processing
Environment Profile
- class honeyhive.tracer.processing.otlp_profiles.EnvironmentProfile(*, name, pool_connections, pool_maxsize, max_retries, timeout, backoff_factor, description='', pool_block=False, additional_config=None)[source]
Bases:
BaseModelEnvironment-specific OTLP configuration profile.
- Parameters:
- model_config: ClassVar[ConfigDict] = {'extra': 'forbid', 'frozen': False, 'validate_assignment': True}
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
OTLP Exporters
- class honeyhive.tracer.processing.otlp_exporter.HoneyHiveOTLPExporter(tracer_instance=None, session_config=None, use_optimized_session=True, protocol='http/protobuf', **kwargs)[source]
Bases:
SpanExporterHoneyHive OTLP exporter with optimized connection pooling.
This exporter is an enhanced wrapper around the standard OpenTelemetry OTLP exporter that includes optimized HTTP session with connection pooling for better performance and reliability. All span processing should have been completed by the HoneyHiveSpanProcessor before spans reach this exporter.
Features: - Optimized HTTP session with connection pooling - Enhanced retry strategies for reliable span delivery - Session statistics and monitoring capabilities - Graceful fallback to standard sessions if optimization fails
- Parameters:
- export(spans)[source]
Export spans to HoneyHive via OTLP.
This method exports spans that have already been processed by the HoneyHiveSpanProcessor. All attribute processing should have been completed before reaching this exporter.
- Parameters:
spans (Sequence[ReadableSpan]) – Sequence of ReadableSpan objects to export
- Returns:
SpanExportResult indicating success or failure
- Return type:
- class honeyhive.tracer.processing.otlp_exporter.OTLPJSONExporter(endpoint, *, headers=None, session=None, timeout=None, tracer_instance=None)[source]
Bases:
SpanExporterOTLP JSON exporter that sends spans in JSON format over HTTP.
This exporter serializes spans to OTLP JSON format and sends them via HTTP POST with Content-Type: application/json. It implements the SpanExporter interface and can be used as a drop-in replacement for OTLPSpanExporter when JSON format is required.
- Parameters:
- export(spans)[source]
Export spans to HoneyHive via OTLP JSON format.
- Parameters:
spans (Sequence[ReadableSpan]) – Sequence of ReadableSpan objects to export
- Returns:
SpanExportResult indicating success or failure
- Return type:
Infrastructure
Environment Detector
- class honeyhive.tracer.infra.environment.EnvironmentDetector(tracer_instance=None)[source]
Bases:
objectComprehensive environment and resource detection.
- Parameters:
tracer_instance (Any | None)
- detect_primary_environment_type()[source]
Detect the primary environment type.
- Returns:
Primary environment type string
- Return type:
- detect_performance_characteristics()[source]
Detect performance characteristics using dynamic analysis.
See Also
HoneyHiveTracer API Reference - Main tracer API
Tracer Architecture Overview - Architecture overview