@osfactory/otel-hook 0.14.0 → 0.14.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +17 -3
- package/dist/{adapter-D5R8lhfl.d.ts → adapter-But5fFCk.d.ts} +8 -1
- package/dist/cli.js +210 -45
- package/dist/cli.js.map +1 -1
- package/dist/{export-destinations-DvoH4QOe.d.ts → export-destinations-8tNkIC8a.d.ts} +12 -4
- package/dist/{filesystem-store-B3CpiIRl.d.ts → filesystem-store-Z8XgDtFj.d.ts} +1 -1
- package/dist/{hook-DVK8Don-.d.ts → hook-D7XABd4f.d.ts} +17 -3
- package/dist/index.d.ts +10 -10
- package/dist/index.js +211 -45
- package/dist/index.js.map +1 -1
- package/dist/install.d.ts +3 -3
- package/dist/install.js.map +1 -1
- package/dist/integration.d.ts +6 -6
- package/dist/integration.js +188 -40
- package/dist/integration.js.map +1 -1
- package/dist/lifecycle.d.ts +1 -1
- package/dist/lifecycle.js +1 -1
- package/dist/lifecycle.js.map +1 -1
- package/dist/{memory-B3r6sZtC.d.ts → memory-gipZUiXP.d.ts} +1 -1
- package/dist/{payload-D4r71EL-.d.ts → payload-DWdx9yk3.d.ts} +1 -1
- package/dist/{ports-DhpSDIkp.d.ts → ports-qZTwK-z2.d.ts} +22 -2
- package/dist/providers.d.ts +7 -7
- package/dist/providers.js +22 -5
- package/dist/providers.js.map +1 -1
- package/dist/{registry-DOJh9mzB.d.ts → registry-D9rmMYxw.d.ts} +1 -1
- package/dist/runtime.d.ts +22 -7
- package/dist/runtime.js +154 -28
- package/dist/runtime.js.map +1 -1
- package/dist/state.d.ts +3 -3
- package/dist/state.js.map +1 -1
- package/dist/telemetry.d.ts +2 -2
- package/dist/telemetry.js +26 -9
- package/dist/telemetry.js.map +1 -1
- package/dist/testing.d.ts +6 -6
- package/dist/testing.js +57 -8
- package/dist/testing.js.map +1 -1
- package/package.json +1 -1
package/dist/telemetry.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
export { D as DEFAULT_INSTRUMENTATION_SCOPE, a as DeriveMetricObservationsInput, E as EventTraceIdentity, M as MAX_RECOVERED_START_ATTRIBUTES, b as METRIC_COST_USAGE, c as METRIC_INSTRUMENTS, d as METRIC_OPERATION_DURATION, e as METRIC_SESSIONS, f as METRIC_TOKEN_USAGE, g as METRIC_TOOL_CALLS, h as MetricInstrument, i as MetricInstrumentName, j as MetricObservation, k as MetricPoint, l as MetricsTemporality, O as OPERATION_DURATION_BUCKETS, S as SemanticMappingOptions, m as SpanCorrelation, n as SpanCorrelationResolver, o as SpanDisposition, p as SpanFamily, q as SpanOrphanClassification, r as SpanPairing, s as SpanScopeRef, T as TOKEN_USAGE_BUCKETS, t as TokenType, u as aggregateDeltaPoints, v as canonicalEventTraceIdentities, w as canonicalEventsToReadableSpans, x as deriveMetricObservations, y as parentScopeRefOf, z as spanScopeRefOf, A as startOnlySpanAttributes } from './metric-model-B4lIuk6i.js';
|
|
2
|
-
export { C as ContentRestrictor, a as ContentWithholdingReason, D as DestinationFanoutOptions, b as DurableLogSpool, c as DurableLogSpoolOptions, d as DurableMetricSpool, e as DurableMetricSpoolOptions, f as DurableSpool, g as DurableSpoolOptions, E as ExportDestinationSinks, h as ExportDestinationsOptions, L as LOG_MAPPING_VERSION, i as LOG_SIGNALS, j as LogContentPolicy, k as LogMappingOptions, l as LogMappingResult, m as LogSignal, n as LogSpoolBatch, o as LogsDeliverability, M as MAX_LOG_BODY_CHARACTERS, p as MAX_LOG_RECORDS_PER_BATCH, q as MAX_LOG_RECORDS_PER_EVENT, r as MCP_TOOL_NAME_PATTERN, s as MetricExportResult, t as MetricSpoolBatch, u as MetricsDeliverability, N as NO_LOG_CONTENT, O as OtlpLogSinkOptions, v as OtlpLogTelemetrySink, w as OtlpMetricSinkOptions, x as OtlpMetricTelemetrySink, y as OtlpTelemetrySink, z as OtlpTraceSinkOptions, R as RouteEventsOptions, S as ScopedBatch, A as SerializedLogRecord, B as SerializedSpan, F as SharedCorrelationResolver, G as SignalFanoutOptions, H as SignalFanoutSink, I as SkippedExportDestination, J as SpoolBatch, K as SpoolDrainResult, P as SpoolDropCounts, Q as SpoolDropReason, T as SpoolEnqueueResult, U as SpoolOverflowPolicy, V as SpoolSendOutcome, W as SpoolStats, X as canonicalEventsToLogRecords, Y as createDestinationFanout, Z as createExportDestinationSinks, _ as createFileDurableLogSpool, $ as createFileDurableMetricSpool, a0 as createFileDurableSpool, a1 as createOtlpLogSink, a2 as createOtlpMetricSink, a3 as createOtlpTraceSink, a4 as createSignalFanout, a5 as describeLogsDeliverability, a6 as describeMetricsDeliverability, a7 as eventRepositoryKey, a8 as exporterPolicyForDestination, a9 as logSignalOf, aa as logSignalsForLifecycleEvents, ab as omitRestrictedContent, ac as pointRepositoryKey, ad as resolveLogsEndpoint, ae as resolveMetricsEndpoint, af as resourceRepositoryKey, ag as restrictEventContent, ah as routeEventsToScopes, ai as routePointsToScopes, aj as sessionIdVariantsFor, ak as shareCorrelationPerBatch, al as spoolQueueNamesFor, am as validateMetricSpoolBatch } from './export-destinations-
|
|
2
|
+
export { C as ContentRestrictor, a as ContentWithholdingReason, D as DestinationFanoutOptions, b as DurableLogSpool, c as DurableLogSpoolOptions, d as DurableMetricSpool, e as DurableMetricSpoolOptions, f as DurableSpool, g as DurableSpoolOptions, E as ExportDestinationSinks, h as ExportDestinationsOptions, L as LOG_MAPPING_VERSION, i as LOG_SIGNALS, j as LogContentPolicy, k as LogMappingOptions, l as LogMappingResult, m as LogSignal, n as LogSpoolBatch, o as LogsDeliverability, M as MAX_LOG_BODY_CHARACTERS, p as MAX_LOG_RECORDS_PER_BATCH, q as MAX_LOG_RECORDS_PER_EVENT, r as MCP_TOOL_NAME_PATTERN, s as MetricExportResult, t as MetricSpoolBatch, u as MetricsDeliverability, N as NO_LOG_CONTENT, O as OtlpLogSinkOptions, v as OtlpLogTelemetrySink, w as OtlpMetricSinkOptions, x as OtlpMetricTelemetrySink, y as OtlpTelemetrySink, z as OtlpTraceSinkOptions, R as RouteEventsOptions, S as ScopedBatch, A as SerializedLogRecord, B as SerializedSpan, F as SharedCorrelationResolver, G as SignalFanoutOptions, H as SignalFanoutSink, I as SkippedExportDestination, J as SpoolBatch, K as SpoolDrainResult, P as SpoolDropCounts, Q as SpoolDropReason, T as SpoolEnqueueResult, U as SpoolOverflowPolicy, V as SpoolSendOutcome, W as SpoolStats, X as canonicalEventsToLogRecords, Y as createDestinationFanout, Z as createExportDestinationSinks, _ as createFileDurableLogSpool, $ as createFileDurableMetricSpool, a0 as createFileDurableSpool, a1 as createOtlpLogSink, a2 as createOtlpMetricSink, a3 as createOtlpTraceSink, a4 as createSignalFanout, a5 as describeLogsDeliverability, a6 as describeMetricsDeliverability, a7 as eventRepositoryKey, a8 as exporterPolicyForDestination, a9 as logSignalOf, aa as logSignalsForLifecycleEvents, ab as omitRestrictedContent, ac as pointRepositoryKey, ad as resolveLogsEndpoint, ae as resolveMetricsEndpoint, af as resourceRepositoryKey, ag as restrictEventContent, ah as routeEventsToScopes, ai as routePointsToScopes, aj as sessionIdVariantsFor, ak as shareCorrelationPerBatch, al as spoolQueueNamesFor, am as validateMetricSpoolBatch } from './export-destinations-8tNkIC8a.js';
|
|
3
3
|
import { ExportResult } from '@opentelemetry/core';
|
|
4
4
|
import '@opentelemetry/api';
|
|
5
5
|
import '@opentelemetry/resources';
|
|
@@ -10,7 +10,7 @@ import './destinations-2KrcRslo.js';
|
|
|
10
10
|
import './policy-CimmCfRp.js';
|
|
11
11
|
import './content-M9xIKG7h.js';
|
|
12
12
|
import './schema-oRsbo7WO.js';
|
|
13
|
-
import './ports-
|
|
13
|
+
import './ports-qZTwK-z2.js';
|
|
14
14
|
import './errors.js';
|
|
15
15
|
import './primitives-CJ8-rn-f.js';
|
|
16
16
|
import './taxonomy-DwhTtuWd.js';
|
package/dist/telemetry.js
CHANGED
|
@@ -18,7 +18,7 @@ import {
|
|
|
18
18
|
} from "@opentelemetry/semantic-conventions/incubating";
|
|
19
19
|
|
|
20
20
|
// src/version.ts
|
|
21
|
-
var VERSION = "0.14.
|
|
21
|
+
var VERSION = "0.14.1";
|
|
22
22
|
|
|
23
23
|
// src/telemetry/export-identity.ts
|
|
24
24
|
import { ATTR_SESSION_ID } from "@opentelemetry/semantic-conventions/incubating";
|
|
@@ -4773,6 +4773,12 @@ var omitRestrictedContent = (fact, mode) => {
|
|
|
4773
4773
|
};
|
|
4774
4774
|
var keyOfValue = (value) => typeof value === "string" ? normalizeRepositoryKey(value) : void 0;
|
|
4775
4775
|
var resourceRepositoryKey = (attributes) => keyOfValue(attributes[ATTR_VCS_REPOSITORY_URL_FULL]);
|
|
4776
|
+
var repositoryUrlForKey = (key) => `https://${key}`;
|
|
4777
|
+
var hasOwnStamp = (attributes) => attributes?.[ATTR_VCS_REPOSITORY_URL_FULL] !== void 0;
|
|
4778
|
+
var withRoutedRepository = (event2, key) => hasOwnStamp(event2.contextAttributes) ? event2 : {
|
|
4779
|
+
...event2,
|
|
4780
|
+
contextAttributes: { ...event2.contextAttributes, [ATTR_VCS_REPOSITORY_URL_FULL]: repositoryUrlForKey(key) }
|
|
4781
|
+
};
|
|
4776
4782
|
var eventRepositoryKey = (event2, fallbackKey) => {
|
|
4777
4783
|
const stamped = event2.contextAttributes?.[ATTR_VCS_REPOSITORY_URL_FULL];
|
|
4778
4784
|
return stamped === void 0 ? fallbackKey : keyOfValue(stamped);
|
|
@@ -4806,19 +4812,21 @@ var restrictEventContent = (event2, mode, restrict) => {
|
|
|
4806
4812
|
};
|
|
4807
4813
|
var routeEventsToScopes = (events, scopes, options) => {
|
|
4808
4814
|
const ends = spanEndEdgesOf(events);
|
|
4815
|
+
const fallbackKey = options.workspaceRepositoryKey ?? options.resourceRepositoryKey;
|
|
4809
4816
|
const traces = [];
|
|
4810
4817
|
const logs = [];
|
|
4811
4818
|
let unchanged = true;
|
|
4812
4819
|
for (const event2 of events) {
|
|
4813
4820
|
const anchor = ends.get(event2.eventId) ?? event2;
|
|
4814
|
-
const scope = matchDestinationScope(scopes, eventRepositoryKey(anchor,
|
|
4821
|
+
const scope = matchDestinationScope(scopes, eventRepositoryKey(anchor, fallbackKey));
|
|
4815
4822
|
if (scope === void 0 || !scope.signals.traces || !scope.signals.logs) {
|
|
4816
4823
|
unchanged = false;
|
|
4817
4824
|
}
|
|
4818
4825
|
if (scope === void 0) {
|
|
4819
4826
|
continue;
|
|
4820
4827
|
}
|
|
4821
|
-
const
|
|
4828
|
+
const lowered = scope.contentMode === void 0 ? event2 : restrictEventContent(event2, scope.contentMode, options.restrict);
|
|
4829
|
+
const restricted = hasOwnStamp(anchor.contextAttributes) || fallbackKey === void 0 ? lowered : withRoutedRepository(lowered, fallbackKey);
|
|
4822
4830
|
if (restricted !== event2) {
|
|
4823
4831
|
unchanged = false;
|
|
4824
4832
|
}
|
|
@@ -4841,7 +4849,15 @@ var routePointsToScopes = (scopes, pointsFor, options) => {
|
|
|
4841
4849
|
for (const point of pointsFor(variant) ?? []) {
|
|
4842
4850
|
const scope = matchDestinationScope(scopes, pointRepositoryKey(point, options.fallbackKey));
|
|
4843
4851
|
if (scope?.signals.metrics === true && effective(scope) === variant) {
|
|
4844
|
-
kept.push(
|
|
4852
|
+
kept.push(
|
|
4853
|
+
hasOwnStamp(point.attributes) || options.fallbackKey === void 0 ? point : {
|
|
4854
|
+
...point,
|
|
4855
|
+
attributes: {
|
|
4856
|
+
...point.attributes,
|
|
4857
|
+
[ATTR_VCS_REPOSITORY_URL_FULL]: repositoryUrlForKey(options.fallbackKey)
|
|
4858
|
+
}
|
|
4859
|
+
}
|
|
4860
|
+
);
|
|
4845
4861
|
}
|
|
4846
4862
|
}
|
|
4847
4863
|
}
|
|
@@ -5011,8 +5027,9 @@ var createExportDestinationSinks = (options) => {
|
|
|
5011
5027
|
...metricSpool === void 0 ? {} : { metricSpool },
|
|
5012
5028
|
...destination.scopes === void 0 ? {} : {
|
|
5013
5029
|
scopes: destination.scopes,
|
|
5014
|
-
route: (events) => routeEventsToScopes(events, destination.scopes ?? [], {
|
|
5030
|
+
route: (events, workspaceRepositoryKey) => routeEventsToScopes(events, destination.scopes ?? [], {
|
|
5015
5031
|
...scopedResourceKey === void 0 ? {} : { resourceRepositoryKey: scopedResourceKey },
|
|
5032
|
+
...workspaceRepositoryKey === void 0 ? {} : { workspaceRepositoryKey },
|
|
5016
5033
|
restrict
|
|
5017
5034
|
})
|
|
5018
5035
|
}
|
|
@@ -5029,8 +5046,8 @@ var createScopedFanout = (destination, correlate) => {
|
|
|
5029
5046
|
const none = { accepted: 0, rejected: 0, errors: [] };
|
|
5030
5047
|
return {
|
|
5031
5048
|
...unscoped,
|
|
5032
|
-
emit: async (events) => {
|
|
5033
|
-
const batch = route(events);
|
|
5049
|
+
emit: async (events, emitOptions) => {
|
|
5050
|
+
const batch = route(events, emitOptions?.workspaceRepositoryKey);
|
|
5034
5051
|
if (correlate !== void 0 && (batch.traces.length > 0 || batch.logs.length > 0)) {
|
|
5035
5052
|
await correlate(events);
|
|
5036
5053
|
correlate.alias(batch.traces, events);
|
|
@@ -5056,10 +5073,10 @@ var createDestinationFanout = (destinations, options = {}) => {
|
|
|
5056
5073
|
if (only !== void 0) {
|
|
5057
5074
|
return only.sink;
|
|
5058
5075
|
}
|
|
5059
|
-
const emit = async (events) => {
|
|
5076
|
+
const emit = async (events, emitOptions) => {
|
|
5060
5077
|
const results = await Promise.all(
|
|
5061
5078
|
fanouts.map(
|
|
5062
|
-
(fanout) => fanout.sink.emit(events).catch(
|
|
5079
|
+
(fanout) => fanout.sink.emit(events, emitOptions).catch(
|
|
5063
5080
|
(thrown) => ({
|
|
5064
5081
|
accepted: 0,
|
|
5065
5082
|
rejected: events.length,
|