File size: 4,030 Bytes
31e8457 051bada 31e8457 051bada 31e8457 051bada 31e8457 051bada 31e8457 051bada 31e8457 051bada 31e8457 051bada 31e8457 051bada 31e8457 051bada 31e8457 051bada 31e8457 051bada 31e8457 051bada 31e8457 051bada 31e8457 051bada 31e8457 051bada 31e8457 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 | import * as Effect from "../../Effect.ts";
/**
* OTLP resource metadata attached to exported logs, metrics, and traces.
*
* @category models
* @since 4.0.0
*/
export interface Resource {
/** Resource attributes */
attributes: Array<KeyValue>;
/** Resource droppedAttributesCount */
droppedAttributesCount: number;
}
/**
* Creates an OTLP resource from service metadata and additional attributes.
*
* **Details**
*
* The resource always includes `service.name`, includes `service.version` when
* provided, and converts custom attributes into OTLP attribute values.
*
* @category constructors
* @since 4.0.0
*/
export declare const make: (options: {
readonly serviceName: string;
readonly serviceVersion?: string | undefined;
readonly attributes?: Record<string, unknown> | undefined;
}) => Resource;
/**
* Creates an OTLP resource from explicit options and OpenTelemetry
* configuration.
*
* **Details**
*
* `OTEL_RESOURCE_ATTRIBUTES`, `OTEL_SERVICE_NAME`, and
* `OTEL_SERVICE_VERSION` override explicit options; missing required
* configuration is converted to a defect.
*
* @category constructors
* @since 4.0.0
*/
export declare const fromConfig: (options?: {
readonly serviceName?: string | undefined;
readonly serviceVersion?: string | undefined;
readonly attributes?: Record<string, unknown> | undefined;
} | undefined) => Effect.Effect<Resource>;
/**
* Returns the `service.name` attribute from an OTLP resource.
*
* **When to use**
*
* Use when an OTLP resource is known to contain a string `service.name` and
* throwing is acceptable if that invariant is broken.
*
* **Gotchas**
*
* Throws if the resource does not contain a string `service.name` attribute.
*
* @category Attributes
* @since 4.0.0
*/
export declare const serviceNameUnsafe: (resource: Resource) => string;
/**
* Converts key/value entries into OTLP `KeyValue` attributes.
*
* @category Attributes
* @since 4.0.0
*/
export declare const entriesToAttributes: (entries: Iterable<[string, unknown]>) => Array<KeyValue>;
/**
* Converts an arbitrary JavaScript value into an OTLP `AnyValue`.
*
* **Details**
*
* Arrays are converted recursively, primitive values use their matching OTLP
* fields, and unsupported values are formatted as strings.
*
* @category Attributes
* @since 4.0.0
*/
export declare const unknownToAttributeValue: (value: unknown) => AnyValue;
/**
* An OTLP attribute represented as a string key and typed value.
*
* @category models
* @since 4.0.0
*/
export interface KeyValue {
/** KeyValue key */
key: string;
/** KeyValue value */
value: AnyValue;
}
/**
* OTLP `AnyValue` payload for scalar, array, key/value-list, or byte values.
*
* @category models
* @since 4.0.0
*/
export interface AnyValue {
/** AnyValue stringValue */
stringValue?: string | null;
/** AnyValue boolValue */
boolValue?: boolean | null;
/** AnyValue intValue */
intValue?: number | null;
/** AnyValue doubleValue */
doubleValue?: number | null;
/** AnyValue arrayValue */
arrayValue?: ArrayValue;
/** AnyValue kvlistValue */
kvlistValue?: KeyValueList;
/** AnyValue bytesValue */
bytesValue?: Uint8Array;
}
/**
* OTLP array value containing nested `AnyValue` entries.
*
* @category models
* @since 4.0.0
*/
export interface ArrayValue {
/** ArrayValue values */
values: Array<AnyValue>;
}
/**
* OTLP key/value-list value containing nested attributes.
*
* @category models
* @since 4.0.0
*/
export interface KeyValueList {
/** KeyValueList values */
values: Array<KeyValue>;
}
/**
* Low and high 32-bit parts of a 64-bit integer value.
*
* @category models
* @since 4.0.0
*/
export interface LongBits {
low: number;
high: number;
}
/**
* Accepted runtime representations for an OTLP/protobuf fixed 64-bit value.
*
* @category models
* @since 4.0.0
*/
export type Fixed64 = LongBits | string | number;
//# sourceMappingURL=OtlpResource.d.ts.map |