fix(major::pr): re-architect instrumentation library

This commit is contained in:
Emilio Garcia 2025-10-06 17:54:05 -04:00
parent 7e3cf1fb20
commit 8fe3a25158
21 changed files with 422 additions and 462 deletions

View file

@ -0,0 +1,27 @@
# Copyright (c) Meta Platforms, Inc. and affiliates.
# All rights reserved.
#
# This source code is licensed under the terms described in the LICENSE file in
# the root directory of this source tree.
from typing import Literal
from pydantic import BaseModel, Field
class OTelConfig(BaseModel):
"""
OpenTelemetry instrumentation configuration.
Most OTel settings use environment variables (OTEL_*).
See: https://opentelemetry.io/docs/specs/otel/configuration/sdk-configuration-variables/
"""
service_name: str | None = Field(
default=None,
description="Service name (overridden by OTEL_SERVICE_NAME env var)",
)
span_processor: Literal["batch", "simple"] = Field(
default="batch",
description="Span processor type (overridden by OTEL_SPAN_PROCESSOR env var)",
)