/** * Resource Builder * * Standardized resource attributes for all Superblocks services. * * CRITICAL: Resource Attributes vs Span Attributes * * `service.name`, `service.version`, and `deployment.environment.name` MUST be set as * **resource attributes** (once, at SDK initialization), NOT as span attributes (per-span). * * - Resource attributes: Set once, inherited by all spans/metrics/logs * - Span attributes: Set per-span, for request-specific data */ import { type Resource } from "@opentelemetry/resources"; import type { BaseTelemetryConfig } from '../types/index.js'; /** * Required RESOURCE attributes for correlation. * These must NOT be added as span attributes (they're inherited from resource). */ export declare const REQUIRED_RESOURCE_ATTRIBUTES: readonly ["service.name", "service.version", "deployment.environment.name"]; /** * Attributes that should NEVER be set at span level (use resource instead). * Used by linting/validation to catch misuse. */ export declare const RESOURCE_ONLY_ATTRIBUTES: Set; /** * Superblocks namespace for custom resource attributes. */ export declare const SUPERBLOCKS_NAMESPACE = "superblocks"; /** * Build standardized resource for a Superblocks service. * * IMPORTANT: These are RESOURCE attributes (set once at init), not span attributes. * They are inherited by ALL telemetry from this SDK instance. * * Semantic conventions used: * - service.name (required) * - service.version (required) * - deployment.environment.name (required) * - superblocks.* (custom namespace) * * @param config - Service configuration * @returns Resource with standardized attributes */ export declare function buildResource(config: BaseTelemetryConfig): Resource; /** * Validate that a resource has all required attributes. * * @param resource - Resource to validate * @throws Error if missing required attributes */ export declare function validateResource(resource: Resource): void; /** * Assert that span attributes don't include resource-only attributes. * Throws an error if resource-only attributes are present. * For use in linting/CI or development mode. * * @param spanAttrs - Span attributes to validate * @throws Error if resource-only attributes are present */ export declare function assertNoResourceAttributes(spanAttrs: Record): void; //# sourceMappingURL=resource.d.ts.map