renovate 44.49.1 → 44.50.0
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.
|
@@ -3,13 +3,15 @@ import { GetDatasourceReleasesSpanProcessor } from "../modules/datasource/span-p
|
|
|
3
3
|
import { GitOperationSpanProcessor } from "../util/git/span-processor.js";
|
|
4
4
|
import { getResourceDetectors } from "./detectors.js";
|
|
5
5
|
import { FileSpanExporter } from "./file-exporter.js";
|
|
6
|
-
import { getFileExporterPath, isFileExporterEnabled, isTraceDebuggingEnabled, isTraceSendingEnabled, isTracingEnabled, massageThrowable } from "./utils.js";
|
|
6
|
+
import { getFileExporterPath, getOtlpProtocol, isFileExporterEnabled, isTraceDebuggingEnabled, isTraceSendingEnabled, isTracingEnabled, massageThrowable } from "./utils.js";
|
|
7
7
|
import { isPromise } from "@sindresorhus/is";
|
|
8
8
|
import { ClientRequest, ServerResponse } from "node:http";
|
|
9
9
|
import * as api from "@opentelemetry/api";
|
|
10
10
|
import { ProxyTracerProvider, SpanStatusCode } from "@opentelemetry/api";
|
|
11
11
|
import { AsyncLocalStorageContextManager } from "@opentelemetry/context-async-hooks";
|
|
12
|
-
import { OTLPTraceExporter } from "@opentelemetry/exporter-trace-otlp-
|
|
12
|
+
import { OTLPTraceExporter } from "@opentelemetry/exporter-trace-otlp-grpc";
|
|
13
|
+
import { OTLPTraceExporter as OTLPTraceExporter$1 } from "@opentelemetry/exporter-trace-otlp-http";
|
|
14
|
+
import { OTLPTraceExporter as OTLPTraceExporter$2 } from "@opentelemetry/exporter-trace-otlp-proto";
|
|
13
15
|
import { registerInstrumentations } from "@opentelemetry/instrumentation";
|
|
14
16
|
import { BunyanInstrumentation } from "@opentelemetry/instrumentation-bunyan";
|
|
15
17
|
import { HttpInstrumentation } from "@opentelemetry/instrumentation-http";
|
|
@@ -20,6 +22,12 @@ import { NodeTracerProvider } from "@opentelemetry/sdk-trace-node";
|
|
|
20
22
|
import { ATTR_SERVICE_NAME, ATTR_SERVICE_VERSION } from "@opentelemetry/semantic-conventions";
|
|
21
23
|
//#region lib/instrumentation/index.ts
|
|
22
24
|
let instrumentations = [];
|
|
25
|
+
function createOtlpExporter() {
|
|
26
|
+
const protocol = getOtlpProtocol();
|
|
27
|
+
if (protocol === "grpc") return new OTLPTraceExporter();
|
|
28
|
+
if (protocol === "http/protobuf") return new OTLPTraceExporter$2();
|
|
29
|
+
return new OTLPTraceExporter$1();
|
|
30
|
+
}
|
|
23
31
|
function init() {
|
|
24
32
|
const spanProcessors = [new GitOperationSpanProcessor(), new GetDatasourceReleasesSpanProcessor()];
|
|
25
33
|
if (!isTracingEnabled()) {
|
|
@@ -29,10 +37,7 @@ function init() {
|
|
|
29
37
|
// v8 ignore if -- TODO add tests
|
|
30
38
|
if (process.env.OTEL_LOG_LEVEL) api.diag.setLogger(new api.DiagConsoleLogger(), api.DiagLogLevel[process.env.OTEL_LOG_LEVEL.toUpperCase()]);
|
|
31
39
|
if (isTraceDebuggingEnabled()) spanProcessors.push(new SimpleSpanProcessor(new ConsoleSpanExporter()));
|
|
32
|
-
if (isTraceSendingEnabled())
|
|
33
|
-
const exporter = new OTLPTraceExporter();
|
|
34
|
-
spanProcessors.push(new BatchSpanProcessor(exporter));
|
|
35
|
-
}
|
|
40
|
+
if (isTraceSendingEnabled()) spanProcessors.push(new BatchSpanProcessor(createOtlpExporter()));
|
|
36
41
|
if (isFileExporterEnabled()) spanProcessors.push(new BatchSpanProcessor(new FileSpanExporter(getFileExporterPath())));
|
|
37
42
|
const env = process.env;
|
|
38
43
|
const baseResource = resourceFromAttributes({
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":[],"sources":["../../lib/instrumentation/index.ts"],"sourcesContent":["import { ClientRequest, ServerResponse } from 'node:http';\nimport type { Context, Span, Tracer, TracerProvider } from '@opentelemetry/api';\nimport * as api from '@opentelemetry/api';\nimport { ProxyTracerProvider, SpanStatusCode } from '@opentelemetry/api';\nimport { AsyncLocalStorageContextManager } from '@opentelemetry/context-async-hooks';\nimport { OTLPTraceExporter } from '@opentelemetry/exporter-trace-otlp-http';\nimport type { Instrumentation } from '@opentelemetry/instrumentation';\nimport { registerInstrumentations } from '@opentelemetry/instrumentation';\nimport { BunyanInstrumentation } from '@opentelemetry/instrumentation-bunyan';\nimport { HttpInstrumentation } from '@opentelemetry/instrumentation-http';\nimport { RedisInstrumentation } from '@opentelemetry/instrumentation-redis';\nimport {\n detectResources,\n resourceFromAttributes,\n} from '@opentelemetry/resources';\nimport {\n BatchSpanProcessor,\n ConsoleSpanExporter,\n SimpleSpanProcessor,\n type SpanProcessor,\n} from '@opentelemetry/sdk-trace-base';\nimport { NodeTracerProvider } from '@opentelemetry/sdk-trace-node';\nimport {\n ATTR_SERVICE_NAME,\n ATTR_SERVICE_VERSION,\n} from '@opentelemetry/semantic-conventions';\nimport { isPromise } from '@sindresorhus/is';\nimport { pkg } from '../expose.ts';\nimport { GetDatasourceReleasesSpanProcessor } from '../modules/datasource/span-processor.ts';\nimport { GitOperationSpanProcessor } from '../util/git/span-processor.ts';\nimport { getResourceDetectors } from './detectors.ts';\nimport { FileSpanExporter } from './file-exporter.ts';\nimport type { RenovateSpanOptions } from './types.ts';\nimport {\n getFileExporterPath,\n isFileExporterEnabled,\n isTraceDebuggingEnabled,\n isTraceSendingEnabled,\n isTracingEnabled,\n massageThrowable,\n} from './utils.ts';\n\nlet instrumentations: Instrumentation[] = [];\n\nexport function init(): void {\n const spanProcessors: SpanProcessor[] = [\n new GitOperationSpanProcessor(),\n new GetDatasourceReleasesSpanProcessor(),\n ];\n\n if (!isTracingEnabled()) {\n const traceProvider = new NodeTracerProvider({ spanProcessors });\n traceProvider.register({\n contextManager: new AsyncLocalStorageContextManager(),\n });\n return;\n }\n\n // v8 ignore if -- TODO add tests\n if (process.env.OTEL_LOG_LEVEL) {\n api.diag.setLogger(\n new api.DiagConsoleLogger(),\n api.DiagLogLevel[\n process.env.OTEL_LOG_LEVEL.toUpperCase() as keyof typeof api.DiagLogLevel\n ],\n );\n }\n\n // add processors\n if (isTraceDebuggingEnabled()) {\n spanProcessors.push(new SimpleSpanProcessor(new ConsoleSpanExporter()));\n }\n\n // OTEL specification environment variable\n if (isTraceSendingEnabled()) {\n const exporter = new OTLPTraceExporter();\n spanProcessors.push(new BatchSpanProcessor(exporter));\n }\n\n if (isFileExporterEnabled()) {\n spanProcessors.push(\n new BatchSpanProcessor(new FileSpanExporter(getFileExporterPath())),\n );\n }\n\n const env = process.env; // don't use getEnv() here to avoid circular dependency with env variables used in the resource detectors\n const baseResource = resourceFromAttributes({\n // https://github.com/open-telemetry/opentelemetry-specification/blob/main/specification/resource/semantic_conventions/README.md#semantic-attributes-with-sdk-provided-default-value\n [ATTR_SERVICE_NAME]: env.OTEL_SERVICE_NAME ?? 'renovate',\n // https://github.com/open-telemetry/opentelemetry-js/tree/main/semantic-conventions#unstable-semconv\n // https://github.com/open-telemetry/opentelemetry-js/blob/e9d3c71918635d490b6a9ac9f8259265b38394d0/semantic-conventions/src/experimental_attributes.ts#L7688\n ['service.namespace']: env.OTEL_SERVICE_NAMESPACE ?? 'renovatebot.com',\n [ATTR_SERVICE_VERSION]: env.OTEL_SERVICE_VERSION ?? pkg.version,\n });\n\n const detectedResource = detectResources({\n detectors: getResourceDetectors(env),\n });\n\n const traceProvider = new NodeTracerProvider({\n resource: baseResource.merge(detectedResource),\n spanProcessors,\n });\n\n const contextManager = new AsyncLocalStorageContextManager();\n traceProvider.register({\n contextManager,\n });\n\n instrumentations = [\n new HttpInstrumentation({\n /* v8 ignore start -- not easily testable */\n applyCustomAttributesOnSpan: (span, request, response) => {\n // ignore 404 errors when the branch protection of Github could not be found. This is expected if no rules are configured\n if (\n request instanceof ClientRequest &&\n request.host === `api.github.com` &&\n request.path.endsWith(`/protection`) &&\n response.statusCode === 404\n ) {\n span.setStatus({ code: SpanStatusCode.OK });\n } else if (\n request instanceof ClientRequest &&\n request.path === '/v2/' &&\n request.method === 'GET' &&\n !request.getHeader('authorization') &&\n response instanceof ServerResponse &&\n response.getHeader('www-authenticate') &&\n response.getHeader('docker-distribution-api-version') &&\n response.statusCode === 401\n ) {\n // Docker API test expects 401 with `www-authenticate` header when registry requires authentication, so ignore this error\n span.setStatus({ code: SpanStatusCode.OK });\n }\n },\n /* v8 ignore stop -- not easily testable */\n }),\n new BunyanInstrumentation(),\n new RedisInstrumentation(),\n ];\n registerInstrumentations({\n instrumentations,\n });\n}\n\n// https://github.com/open-telemetry/opentelemetry-js-api/issues/34\n/* v8 ignore next -- not easily testable */\nexport async function shutdown(): Promise<void> {\n const traceProvider = getTracerProvider();\n if (traceProvider instanceof NodeTracerProvider) {\n await traceProvider.shutdown();\n } else if (traceProvider instanceof ProxyTracerProvider) {\n const delegateProvider = traceProvider.getDelegate();\n if (delegateProvider instanceof NodeTracerProvider) {\n await delegateProvider.shutdown();\n }\n }\n}\n\nexport function disableInstrumentations(): void {\n for (const instrumentation of instrumentations) {\n instrumentation.disable();\n }\n}\n\nexport function getTracerProvider(): TracerProvider {\n return api.trace.getTracerProvider();\n}\n\nfunction getTracer(): Tracer {\n return getTracerProvider().getTracer('renovate');\n}\n\nexport function instrument<F extends () => ReturnType<F>>(\n name: string,\n fn: F,\n): ReturnType<F>;\nexport function instrument<F extends () => ReturnType<F>>(\n name: string,\n fn: F,\n options: RenovateSpanOptions,\n): ReturnType<F>;\nexport function instrument<F extends () => ReturnType<F>>(\n name: string,\n fn: F,\n options: RenovateSpanOptions,\n context: Context,\n): ReturnType<F>;\nexport function instrument<F extends () => ReturnType<F>>(\n name: string,\n fn: F,\n options: RenovateSpanOptions = {},\n context: Context = api.context.active(),\n): ReturnType<F> {\n return getTracer().startActiveSpan(name, options, context, (span: Span) => {\n try {\n const ret = fn();\n if (isPromise(ret)) {\n return ret\n .catch((e) => {\n span.recordException(e);\n span.setStatus({\n code: SpanStatusCode.ERROR,\n message: massageThrowable(e),\n });\n throw e;\n })\n .finally(() => span.end()) as ReturnType<F>;\n }\n span.end();\n return ret;\n } catch (e) {\n span.recordException(e);\n span.setStatus({\n code: SpanStatusCode.ERROR,\n message: massageThrowable(e),\n });\n span.end();\n throw e;\n }\n });\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;AA0CA,IAAI,mBAAsC,CAAC;AAE3C,SAAgB,OAAa;CAC3B,MAAM,iBAAkC,CACtC,IAAI,0BAA0B,GAC9B,IAAI,mCAAmC,CACzC;CAEA,IAAI,CAAC,iBAAiB,GAAG;EAEvB,IAD0B,mBAAmB,EAAE,eAAe,CAClD,CAAC,CAAC,SAAS,EACrB,gBAAgB,IAAI,gCAAgC,EACtD,CAAC;EACD;CACF;;CAGA,IAAI,QAAQ,IAAI,gBACd,IAAI,KAAK,UACP,IAAI,IAAI,kBAAkB,GAC1B,IAAI,aACF,QAAQ,IAAI,eAAe,YAAY,EAE3C;CAIF,IAAI,wBAAwB,GAC1B,eAAe,KAAK,IAAI,oBAAoB,IAAI,oBAAoB,CAAC,CAAC;CAIxE,IAAI,sBAAsB,GAAG;EAC3B,MAAM,WAAW,IAAI,kBAAkB;EACvC,eAAe,KAAK,IAAI,mBAAmB,QAAQ,CAAC;CACtD;CAEA,IAAI,sBAAsB,GACxB,eAAe,KACb,IAAI,mBAAmB,IAAI,iBAAiB,oBAAoB,CAAC,CAAC,CACpE;CAGF,MAAM,MAAM,QAAQ;CACpB,MAAM,eAAe,uBAAuB;GAEzC,oBAAoB,IAAI,qBAAqB;GAG7C,sBAAsB,IAAI,0BAA0B;GACpD,uBAAuB,IAAI,wBAAwB,IAAI;CAC1D,CAAC;CAED,MAAM,mBAAmB,gBAAgB,EACvC,WAAW,qBAAqB,GAAG,EACrC,CAAC;CAED,MAAM,gBAAgB,IAAI,mBAAmB;EAC3C,UAAU,aAAa,MAAM,gBAAgB;EAC7C;CACF,CAAC;CAED,MAAM,iBAAiB,IAAI,gCAAgC;CAC3D,cAAc,SAAS,EACrB,eACF,CAAC;CAED,mBAAmB;EACjB,IAAI,oBAAoB;;AA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CAAC;GAE7B,KAAK,IAAI;GACT,OAAO;EACT,SAAS,GAAG;GACV,KAAK,gBAAgB,CAAC;GACtB,KAAK,UAAU;IACb,MAAM,eAAe;IACrB,SAAS,iBAAiB,CAAC;GAC7B,CAAC;GACD,KAAK,IAAI;GACT,MAAM;EACR;CACF,CAAC;AACH"}
|
|
1
|
+
{"version":3,"file":"index.js","names":["OTLPTraceExporterGrpc","OTLPTraceExporterProto","OTLPTraceExporterHttp"],"sources":["../../lib/instrumentation/index.ts"],"sourcesContent":["import { ClientRequest, ServerResponse } from 'node:http';\nimport type { Context, Span, Tracer, TracerProvider } from '@opentelemetry/api';\nimport * as api from '@opentelemetry/api';\nimport { ProxyTracerProvider, SpanStatusCode } from '@opentelemetry/api';\nimport { AsyncLocalStorageContextManager } from '@opentelemetry/context-async-hooks';\nimport { OTLPTraceExporter as OTLPTraceExporterGrpc } from '@opentelemetry/exporter-trace-otlp-grpc';\nimport { OTLPTraceExporter as OTLPTraceExporterHttp } from '@opentelemetry/exporter-trace-otlp-http';\nimport { OTLPTraceExporter as OTLPTraceExporterProto } from '@opentelemetry/exporter-trace-otlp-proto';\nimport type { Instrumentation } from '@opentelemetry/instrumentation';\nimport { registerInstrumentations } from '@opentelemetry/instrumentation';\nimport { BunyanInstrumentation } from '@opentelemetry/instrumentation-bunyan';\nimport { HttpInstrumentation } from '@opentelemetry/instrumentation-http';\nimport { RedisInstrumentation } from '@opentelemetry/instrumentation-redis';\nimport {\n detectResources,\n resourceFromAttributes,\n} from '@opentelemetry/resources';\nimport {\n BatchSpanProcessor,\n ConsoleSpanExporter,\n SimpleSpanProcessor,\n type SpanExporter,\n type SpanProcessor,\n} from '@opentelemetry/sdk-trace-base';\nimport { NodeTracerProvider } from '@opentelemetry/sdk-trace-node';\nimport {\n ATTR_SERVICE_NAME,\n ATTR_SERVICE_VERSION,\n} from '@opentelemetry/semantic-conventions';\nimport { isPromise } from '@sindresorhus/is';\nimport { pkg } from '../expose.ts';\nimport { GetDatasourceReleasesSpanProcessor } from '../modules/datasource/span-processor.ts';\nimport { GitOperationSpanProcessor } from '../util/git/span-processor.ts';\nimport { getResourceDetectors } from './detectors.ts';\nimport { FileSpanExporter } from './file-exporter.ts';\nimport type { RenovateSpanOptions } from './types.ts';\nimport {\n getFileExporterPath,\n getOtlpProtocol,\n isFileExporterEnabled,\n isTraceDebuggingEnabled,\n isTraceSendingEnabled,\n isTracingEnabled,\n massageThrowable,\n} from './utils.ts';\n\nlet instrumentations: Instrumentation[] = [];\n\nfunction createOtlpExporter(): SpanExporter {\n const protocol = getOtlpProtocol();\n if (protocol === 'grpc') {\n return new OTLPTraceExporterGrpc();\n }\n if (protocol === 'http/protobuf') {\n return new OTLPTraceExporterProto();\n }\n return new OTLPTraceExporterHttp();\n}\n\nexport function init(): void {\n const spanProcessors: SpanProcessor[] = [\n new GitOperationSpanProcessor(),\n new GetDatasourceReleasesSpanProcessor(),\n ];\n\n if (!isTracingEnabled()) {\n const traceProvider = new NodeTracerProvider({ spanProcessors });\n traceProvider.register({\n contextManager: new AsyncLocalStorageContextManager(),\n });\n return;\n }\n\n // v8 ignore if -- TODO add tests\n if (process.env.OTEL_LOG_LEVEL) {\n api.diag.setLogger(\n new api.DiagConsoleLogger(),\n api.DiagLogLevel[\n process.env.OTEL_LOG_LEVEL.toUpperCase() as keyof typeof api.DiagLogLevel\n ],\n );\n }\n\n // add processors\n if (isTraceDebuggingEnabled()) {\n spanProcessors.push(new SimpleSpanProcessor(new ConsoleSpanExporter()));\n }\n\n // OTEL specification environment variable\n if (isTraceSendingEnabled()) {\n spanProcessors.push(new BatchSpanProcessor(createOtlpExporter()));\n }\n\n if (isFileExporterEnabled()) {\n spanProcessors.push(\n new BatchSpanProcessor(new FileSpanExporter(getFileExporterPath())),\n );\n }\n\n const env = process.env; // don't use getEnv() here to avoid circular dependency with env variables used in the resource detectors\n const baseResource = resourceFromAttributes({\n // https://github.com/open-telemetry/opentelemetry-specification/blob/main/specification/resource/semantic_conventions/README.md#semantic-attributes-with-sdk-provided-default-value\n [ATTR_SERVICE_NAME]: env.OTEL_SERVICE_NAME ?? 'renovate',\n // https://github.com/open-telemetry/opentelemetry-js/tree/main/semantic-conventions#unstable-semconv\n // https://github.com/open-telemetry/opentelemetry-js/blob/e9d3c71918635d490b6a9ac9f8259265b38394d0/semantic-conventions/src/experimental_attributes.ts#L7688\n ['service.namespace']: env.OTEL_SERVICE_NAMESPACE ?? 'renovatebot.com',\n [ATTR_SERVICE_VERSION]: env.OTEL_SERVICE_VERSION ?? pkg.version,\n });\n\n const detectedResource = detectResources({\n detectors: getResourceDetectors(env),\n });\n\n const traceProvider = new NodeTracerProvider({\n resource: baseResource.merge(detectedResource),\n spanProcessors,\n });\n\n const contextManager = new AsyncLocalStorageContextManager();\n traceProvider.register({\n contextManager,\n });\n\n instrumentations = [\n new HttpInstrumentation({\n /* v8 ignore start -- not easily testable */\n applyCustomAttributesOnSpan: (span, request, response) => {\n // ignore 404 errors when the branch protection of Github could not be found. This is expected if no rules are configured\n if (\n request instanceof ClientRequest &&\n request.host === `api.github.com` &&\n request.path.endsWith(`/protection`) &&\n response.statusCode === 404\n ) {\n span.setStatus({ code: SpanStatusCode.OK });\n } else if (\n request instanceof ClientRequest &&\n request.path === '/v2/' &&\n request.method === 'GET' &&\n !request.getHeader('authorization') &&\n response instanceof ServerResponse &&\n response.getHeader('www-authenticate') &&\n response.getHeader('docker-distribution-api-version') &&\n response.statusCode === 401\n ) {\n // Docker API test expects 401 with `www-authenticate` header when registry requires authentication, so ignore this error\n span.setStatus({ code: SpanStatusCode.OK });\n }\n },\n /* v8 ignore stop -- not easily testable */\n }),\n new BunyanInstrumentation(),\n new RedisInstrumentation(),\n ];\n registerInstrumentations({\n instrumentations,\n });\n}\n\n// https://github.com/open-telemetry/opentelemetry-js-api/issues/34\n/* v8 ignore next -- not easily testable */\nexport async function shutdown(): Promise<void> {\n const traceProvider = getTracerProvider();\n if (traceProvider instanceof NodeTracerProvider) {\n await traceProvider.shutdown();\n } else if (traceProvider instanceof ProxyTracerProvider) {\n const delegateProvider = traceProvider.getDelegate();\n if (delegateProvider instanceof NodeTracerProvider) {\n await delegateProvider.shutdown();\n }\n }\n}\n\nexport function disableInstrumentations(): void {\n for (const instrumentation of instrumentations) {\n instrumentation.disable();\n }\n}\n\nexport function getTracerProvider(): TracerProvider {\n return api.trace.getTracerProvider();\n}\n\nfunction getTracer(): Tracer {\n return getTracerProvider().getTracer('renovate');\n}\n\nexport function instrument<F extends () => ReturnType<F>>(\n name: string,\n fn: F,\n): ReturnType<F>;\nexport function instrument<F extends () => ReturnType<F>>(\n name: string,\n fn: F,\n options: RenovateSpanOptions,\n): ReturnType<F>;\nexport function instrument<F extends () => ReturnType<F>>(\n name: string,\n fn: F,\n options: RenovateSpanOptions,\n context: Context,\n): ReturnType<F>;\nexport function instrument<F extends () => ReturnType<F>>(\n name: string,\n fn: F,\n options: RenovateSpanOptions = {},\n context: Context = api.context.active(),\n): ReturnType<F> {\n return getTracer().startActiveSpan(name, options, context, (span: Span) => {\n try {\n const ret = fn();\n if (isPromise(ret)) {\n return ret\n .catch((e) => {\n span.recordException(e);\n span.setStatus({\n code: SpanStatusCode.ERROR,\n message: massageThrowable(e),\n });\n throw e;\n })\n .finally(() => span.end()) as ReturnType<F>;\n }\n span.end();\n return ret;\n } catch (e) {\n span.recordException(e);\n span.setStatus({\n code: SpanStatusCode.ERROR,\n message: massageThrowable(e),\n });\n span.end();\n throw e;\n }\n });\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;AA8CA,IAAI,mBAAsC,CAAC;AAE3C,SAAS,qBAAmC;CAC1C,MAAM,WAAW,gBAAgB;CACjC,IAAI,aAAa,QACf,OAAO,IAAIA,kBAAsB;CAEnC,IAAI,aAAa,iBACf,OAAO,IAAIC,oBAAuB;CAEpC,OAAO,IAAIC,oBAAsB;AACnC;AAEA,SAAgB,OAAa;CAC3B,MAAM,iBAAkC,CACtC,IAAI,0BAA0B,GAC9B,IAAI,mCAAmC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resorhus/is";
|
|
3
3
|
//#region lib/instrumentation/utils.ts
|
|
4
|
+
const otlpProtocols = [
|
|
5
|
+
"grpc",
|
|
6
|
+
"http/json",
|
|
7
|
+
"http/protobuf"
|
|
8
|
+
];
|
|
9
|
+
function getOtlpProtocol() {
|
|
10
|
+
const protocol = getEnv().OTEL_EXPORTER_OTLP_TRACES_PROTOCOL ?? getEnv().OTEL_EXPORTER_OTLP_PROTOCOL;
|
|
11
|
+
return otlpProtocols.includes(protocol) ? protocol : "http/json";
|
|
12
|
+
}
|
|
4
13
|
function isTracingEnabled() {
|
|
5
14
|
return isTraceDebuggingEnabled() || isTraceSendingEnabled() || isFileExporterEnabled();
|
|
6
15
|
}
|
|
@@ -22,6 +31,6 @@ function massageThrowable(e) {
|
|
|
22
31
|
return String(e);
|
|
23
32
|
}
|
|
24
33
|
//#endregion
|
|
25
|
-
export { getFileExporterPath, isFileExporterEnabled, isTraceDebuggingEnabled, isTraceSendingEnabled, isTracingEnabled, massageThrowable };
|
|
34
|
+
export { getFileExporterPath, getOtlpProtocol, isFileExporterEnabled, isTraceDebuggingEnabled, isTraceSendingEnabled, isTracingEnabled, massageThrowable };
|
|
26
35
|
|
|
27
36
|
//# sourceMappingURL=utils.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"utils.js","names":[],"sources":["../../lib/instrumentation/utils.ts"],"sourcesContent":["import { isNullOrUndefined } from '@sindresorhus/is';\nimport { getEnv } from '../util/env.ts';\n\nexport function isTracingEnabled(): boolean {\n return (\n isTraceDebuggingEnabled() ||\n isTraceSendingEnabled() ||\n isFileExporterEnabled()\n );\n}\n\nexport function isTraceDebuggingEnabled(): boolean {\n return !!getEnv().RENOVATE_TRACING_CONSOLE_EXPORTER;\n}\n\nexport function isTraceSendingEnabled(): boolean {\n return !!getEnv().OTEL_EXPORTER_OTLP_ENDPOINT;\n}\n\nexport function isFileExporterEnabled(): boolean {\n return !!getEnv().RENOVATE_TRACING_FILE_EXPORTER_PATH;\n}\n\nexport function getFileExporterPath(): string {\n return getEnv().RENOVATE_TRACING_FILE_EXPORTER_PATH!;\n}\n\nexport function massageThrowable(e: unknown): string | undefined {\n if (isNullOrUndefined(e)) {\n return undefined;\n }\n if (e instanceof Error) {\n return e.message;\n }\n return String(e); // oxlint-disable-line typescript/no-base-to-string\n}\n"],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"utils.js","names":[],"sources":["../../lib/instrumentation/utils.ts"],"sourcesContent":["import { isNullOrUndefined } from '@sindresorhus/is';\nimport { getEnv } from '../util/env.ts';\n\nexport type OtlpProtocol = 'grpc' | 'http/json' | 'http/protobuf';\n\nconst otlpProtocols: OtlpProtocol[] = ['grpc', 'http/json', 'http/protobuf'];\n\n// https://github.com/open-telemetry/opentelemetry-specification/blob/main/specification/configuration/sdk-environment-variables.md#otlp-exporter\n// `OTEL_EXPORTER_OTLP_TRACES_PROTOCOL` takes precedence over the general `OTEL_EXPORTER_OTLP_PROTOCOL`.\n// Defaults to `http/json`, matching Renovate's historic (pre-multi-protocol) behaviour, rather than the spec's `http/protobuf` default, to avoid a breaking change for existing users who haven't set this variable.\nexport function getOtlpProtocol(): OtlpProtocol {\n const protocol =\n getEnv().OTEL_EXPORTER_OTLP_TRACES_PROTOCOL ??\n getEnv().OTEL_EXPORTER_OTLP_PROTOCOL;\n return otlpProtocols.includes(protocol as OtlpProtocol)\n ? (protocol as OtlpProtocol)\n : 'http/json';\n}\n\nexport function isTracingEnabled(): boolean {\n return (\n isTraceDebuggingEnabled() ||\n isTraceSendingEnabled() ||\n isFileExporterEnabled()\n );\n}\n\nexport function isTraceDebuggingEnabled(): boolean {\n return !!getEnv().RENOVATE_TRACING_CONSOLE_EXPORTER;\n}\n\nexport function isTraceSendingEnabled(): boolean {\n return !!getEnv().OTEL_EXPORTER_OTLP_ENDPOINT;\n}\n\nexport function isFileExporterEnabled(): boolean {\n return !!getEnv().RENOVATE_TRACING_FILE_EXPORTER_PATH;\n}\n\nexport function getFileExporterPath(): string {\n return getEnv().RENOVATE_TRACING_FILE_EXPORTER_PATH!;\n}\n\nexport function massageThrowable(e: unknown): string | undefined {\n if (isNullOrUndefined(e)) {\n return undefined;\n }\n if (e instanceof Error) {\n return e.message;\n }\n return String(e); // oxlint-disable-line typescript/no-base-to-string\n}\n"],"mappings":";;;AAKA,MAAM,gBAAgC;CAAC;CAAQ;CAAa;AAAe;AAK3E,SAAgB,kBAAgC;CAC9C,MAAM,WACJ,OAAO,CAAC,CAAC,sCACT,OAAO,CAAC,CAAC;CACX,OAAO,cAAc,SAAS,QAAwB,IACjD,WACD;AACN;AAEA,SAAgB,mBAA4B;CAC1C,OACE,wBAAwB,KACxB,sBAAsB,KACtB,sBAAsB;AAE1B;AAEA,SAAgB,0BAAmC;CACjD,OAAO,CAAC,CAAC,OAAO,CAAC,CAAC;AACpB;AAEA,SAAgB,wBAAiC;CAC/C,OAAO,CAAC,CAAC,OAAO,CAAC,CAAC;AACpB;AAEA,SAAgB,wBAAiC;CAC/C,OAAO,CAAC,CAAC,OAAO,CAAC,CAAC;AACpB;AAEA,SAAgB,sBAA8B;CAC5C,OAAO,OAAO,CAAC,CAAC;AAClB;AAEA,SAAgB,iBAAiB,GAAgC;CAC/D,IAAI,kBAAkB,CAAC,GACrB;CAEF,IAAI,aAAa,OACf,OAAO,EAAE;CAEX,OAAO,OAAO,CAAC;AACjB"}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "renovate",
|
|
3
3
|
"description": "Automated dependency updates. Flexible so you don't need to be.",
|
|
4
|
-
"version": "44.
|
|
4
|
+
"version": "44.50.0",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"bin": {
|
|
7
7
|
"renovate": "dist/renovate.js",
|
|
@@ -99,7 +99,9 @@
|
|
|
99
99
|
"@cdktf/hcl2json": "0.21.0",
|
|
100
100
|
"@opentelemetry/api": "1.9.1",
|
|
101
101
|
"@opentelemetry/context-async-hooks": "2.10.0",
|
|
102
|
+
"@opentelemetry/exporter-trace-otlp-grpc": "0.221.0",
|
|
102
103
|
"@opentelemetry/exporter-trace-otlp-http": "0.221.0",
|
|
104
|
+
"@opentelemetry/exporter-trace-otlp-proto": "0.221.0",
|
|
103
105
|
"@opentelemetry/instrumentation": "0.221.0",
|
|
104
106
|
"@opentelemetry/instrumentation-bunyan": "0.66.0",
|
|
105
107
|
"@opentelemetry/instrumentation-http": "0.221.0",
|
package/renovate-schema.json
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
{
|
|
2
2
|
"$id": "https://docs.renovatebot.com/renovate-schema.json",
|
|
3
|
-
"title": "JSON schema for Renovate 44.
|
|
3
|
+
"title": "JSON schema for Renovate 44.50.0 config files (https://renovatebot.com/)",
|
|
4
4
|
"$schema": "http://json-schema.org/draft-07/schema#",
|
|
5
|
-
"x-renovate-version": "44.
|
|
5
|
+
"x-renovate-version": "44.50.0",
|
|
6
6
|
"allowComments": true,
|
|
7
7
|
"type": "object",
|
|
8
8
|
"definitions": {
|