renovate 39.243.0 → 39.244.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.
@@ -14,6 +14,10 @@ const exporter_trace_otlp_http_1 = require("@opentelemetry/exporter-trace-otlp-h
14
14
  const instrumentation_1 = require("@opentelemetry/instrumentation");
15
15
  const instrumentation_bunyan_1 = require("@opentelemetry/instrumentation-bunyan");
16
16
  const instrumentation_http_1 = require("@opentelemetry/instrumentation-http");
17
+ const resource_detector_aws_1 = require("@opentelemetry/resource-detector-aws");
18
+ const resource_detector_azure_1 = require("@opentelemetry/resource-detector-azure");
19
+ const resource_detector_gcp_1 = require("@opentelemetry/resource-detector-gcp");
20
+ const resource_detector_github_1 = require("@opentelemetry/resource-detector-github");
17
21
  const resources_1 = require("@opentelemetry/resources");
18
22
  const sdk_trace_base_1 = require("@opentelemetry/sdk-trace-base");
19
23
  const sdk_trace_node_1 = require("@opentelemetry/sdk-trace-node");
@@ -36,15 +40,31 @@ function init() {
36
40
  const exporter = new exporter_trace_otlp_http_1.OTLPTraceExporter();
37
41
  spanProcessors.push(new sdk_trace_base_1.BatchSpanProcessor(exporter));
38
42
  }
43
+ const baseResource = (0, resources_1.resourceFromAttributes)({
44
+ // https://github.com/open-telemetry/opentelemetry-specification/blob/main/specification/resource/semantic_conventions/README.md#semantic-attributes-with-sdk-provided-default-value
45
+ [semantic_conventions_1.ATTR_SERVICE_NAME]: process.env.OTEL_SERVICE_NAME ?? 'renovate',
46
+ // https://github.com/open-telemetry/opentelemetry-js/tree/main/semantic-conventions#unstable-semconv
47
+ // https://github.com/open-telemetry/opentelemetry-js/blob/e9d3c71918635d490b6a9ac9f8259265b38394d0/semantic-conventions/src/experimental_attributes.ts#L7688
48
+ ['service.namespace']: process.env.OTEL_SERVICE_NAMESPACE ?? 'renovatebot.com',
49
+ [semantic_conventions_1.ATTR_SERVICE_VERSION]: process.env.OTEL_SERVICE_VERSION ?? expose_cjs_1.pkg.version,
50
+ });
51
+ const detectedResource = (0, resources_1.detectResources)({
52
+ detectors: [
53
+ resource_detector_aws_1.awsBeanstalkDetector,
54
+ resource_detector_aws_1.awsEc2Detector,
55
+ resource_detector_aws_1.awsEcsDetector,
56
+ resource_detector_aws_1.awsEksDetector,
57
+ resource_detector_aws_1.awsLambdaDetector,
58
+ resource_detector_azure_1.azureAppServiceDetector,
59
+ resource_detector_azure_1.azureFunctionsDetector,
60
+ resource_detector_azure_1.azureVmDetector,
61
+ resource_detector_gcp_1.gcpDetector,
62
+ resource_detector_github_1.gitHubDetector,
63
+ resources_1.envDetector,
64
+ ],
65
+ });
39
66
  const traceProvider = new sdk_trace_node_1.NodeTracerProvider({
40
- resource: (0, resources_1.resourceFromAttributes)({
41
- // https://github.com/open-telemetry/opentelemetry-specification/blob/main/specification/resource/semantic_conventions/README.md#semantic-attributes-with-sdk-provided-default-value
42
- [semantic_conventions_1.ATTR_SERVICE_NAME]: process.env.OTEL_SERVICE_NAME ?? 'renovate',
43
- // https://github.com/open-telemetry/opentelemetry-js/tree/main/semantic-conventions#unstable-semconv
44
- // https://github.com/open-telemetry/opentelemetry-js/blob/e9d3c71918635d490b6a9ac9f8259265b38394d0/semantic-conventions/src/experimental_attributes.ts#L7688
45
- ['service.namespace']: process.env.OTEL_SERVICE_NAMESPACE ?? 'renovatebot.com',
46
- [semantic_conventions_1.ATTR_SERVICE_VERSION]: process.env.OTEL_SERVICE_VERSION ?? expose_cjs_1.pkg.version,
47
- }),
67
+ resource: baseResource.merge(detectedResource),
48
68
  spanProcessors,
49
69
  });
50
70
  const contextManager = new context_async_hooks_1.AsyncLocalStorageContextManager();
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../lib/instrumentation/index.ts"],"names":[],"mappings":";;AAwCA,oBAwDC;AAID,4BAUC;AAGD,0DAIC;AAED,8CAEC;AAeD,gCAiCC;;AAzKD,yCAA0C;AAQ1C,gEAA0C;AAC1C,4CAAyE;AACzE,4EAAqF;AACr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SpanOptions,\n Tracer,\n TracerProvider,\n} 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 { resourceFromAttributes } 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 { pkg } from '../expose.cjs';\nimport {\n isTraceDebuggingEnabled,\n isTraceSendingEnabled,\n isTracingEnabled,\n massageThrowable,\n} from './utils';\n\nlet instrumentations: Instrumentation[] = [];\n\ninit();\n\nexport function init(): void {\n if (!isTracingEnabled()) {\n return;\n }\n\n const spanProcessors: SpanProcessor[] = [];\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 const traceProvider = new NodeTracerProvider({\n resource: 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]: process.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']:\n process.env.OTEL_SERVICE_NAMESPACE ?? 'renovatebot.com',\n [ATTR_SERVICE_VERSION]: process.env.OTEL_SERVICE_VERSION ?? pkg.version,\n }),\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 }\n },\n /* v8 ignore stop */\n }),\n new BunyanInstrumentation(),\n ];\n registerInstrumentations({\n instrumentations,\n });\n}\n\n/* v8 ignore start -- not easily testable */\n// https://github.com/open-telemetry/opentelemetry-js-api/issues/34\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/* v8 ignore stop */\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: SpanOptions,\n): ReturnType<F>;\nexport function instrument<F extends () => ReturnType<F>>(\n name: string,\n fn: F,\n options: SpanOptions = {},\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 (ret instanceof Promise) {\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"]}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../lib/instrumentation/index.ts"],"names":[],"mappings":";;AA0DA,oBA0EC;AAID,4BAUC;AAGD,0DAIC;AAED,8CAEC;AAeD,gCAiCC;;AA7MD,yCAA0C;AAQ1C,gEAA0C;AAC1C,4CAAyE;AACzE,4EAAqF;AACrF,sFAA4E;AAE5E,oEAA0E;AAC1E,kFAA8E;AAC9E,8EAA0E;AAC1E,gFAM8C;AAC9C,oFAIgD;AAChD,gFAAmE;AACnE,sFAAyE;AACzE,wDAIkC;AAClC,kEAKuC;AACvC,kEAAmE;AACnE,8EAG6C;AAC7C,8CAAoC;AACpC,mCAKiB;AAEjB,IAAI,gBAAgB,GAAsB,EAAE,CAAC;AAE7C,IAAI,EAAE,CAAC;AAEP,SAAgB,IAAI;IAClB,IAAI,CAAC,IAAA,wBAAgB,GAAE,EAAE,CAAC;QACxB,OAAO;IACT,CAAC;IAED,MAAM,cAAc,GAAoB,EAAE,CAAC;IAC3C,iBAAiB;IACjB,IAAI,IAAA,+BAAuB,GAAE,EAAE,CAAC;QAC9B,cAAc,CAAC,IAAI,CAAC,IAAI,oCAAmB,CAAC,IAAI,oCAAmB,EAAE,CAAC,CAAC,CAAC;IAC1E,CAAC;IAED,0CAA0C;IAC1C,IAAI,IAAA,6BAAqB,GAAE,EAAE,CAAC;QAC5B,MAAM,QAAQ,GAAG,IAAI,4CAAiB,EAAE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E;QACxE,IAAI,CAAC;YACH,MAAM,GAAG,GAAG,EAAE,EAAE,CAAC;YACjB,IAAI,GAAG,YAAY,OAAO,EAAE,CAAC;gBAC3B,OAAO,GAAG;qBACP,KAAK,CAAC,CAAC,CAAC,EAAE,EAAE;oBACX,IAAI,CAAC,eAAe,CAAC,CAAC,CAAC,CAAC;oBACxB,IAAI,CAAC,SAAS,CAAC;wBACb,IAAI,EAAE,oBAAc,CAAC,KAAK;wBAC1B,OAAO,EAAE,IAAA,wBAAgB,EAAC,CAAC,CAAC;qBAC7B,CAAC,CAAC;oBACH,MAAM,CAAC,CAAC;gBACV,CAAC,CAAC;qBACD,OAAO,CAAC,GAAG,EAAE,CAAC,IAAI,CAAC,GAAG,EAAE,CAAkB,CAAC;YAChD,CAAC;YACD,IAAI,CAAC,GAAG,EAAE,CAAC;YACX,OAAO,GAAG,CAAC;QACb,CAAC;QAAC,OAAO,CAAC,EAAE,CAAC;YACX,IAAI,CAAC,eAAe,CAAC,CAAC,CAAC,CAAC;YACxB,IAAI,CAAC,SAAS,CAAC;gBACb,IAAI,EAAE,oBAAc,CAAC,KAAK;gBAC1B,OAAO,EAAE,IAAA,wBAAgB,EAAC,CAAC,CAAC;aAC7B,CAAC,CAAC;YACH,IAAI,CAAC,GAAG,EAAE,CAAC;YACX,MAAM,CAAC,CAAC;QACV,CAAC;IACH,CAAC,CAAC,CAAC;AACL,CAAC","sourcesContent":["import { ClientRequest } from 'node:http';\nimport type {\n Context,\n Span,\n SpanOptions,\n Tracer,\n TracerProvider,\n} 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 {\n awsBeanstalkDetector,\n awsEc2Detector,\n awsEcsDetector,\n awsEksDetector,\n awsLambdaDetector,\n} from '@opentelemetry/resource-detector-aws';\nimport {\n azureAppServiceDetector,\n azureFunctionsDetector,\n azureVmDetector,\n} from '@opentelemetry/resource-detector-azure';\nimport { gcpDetector } from '@opentelemetry/resource-detector-gcp';\nimport { gitHubDetector } from '@opentelemetry/resource-detector-github';\nimport {\n detectResources,\n envDetector,\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 { pkg } from '../expose.cjs';\nimport {\n isTraceDebuggingEnabled,\n isTraceSendingEnabled,\n isTracingEnabled,\n massageThrowable,\n} from './utils';\n\nlet instrumentations: Instrumentation[] = [];\n\ninit();\n\nexport function init(): void {\n if (!isTracingEnabled()) {\n return;\n }\n\n const spanProcessors: SpanProcessor[] = [];\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 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]: process.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']:\n process.env.OTEL_SERVICE_NAMESPACE ?? 'renovatebot.com',\n [ATTR_SERVICE_VERSION]: process.env.OTEL_SERVICE_VERSION ?? pkg.version,\n });\n\n const detectedResource = detectResources({\n detectors: [\n awsBeanstalkDetector,\n awsEc2Detector,\n awsEcsDetector,\n awsEksDetector,\n awsLambdaDetector,\n azureAppServiceDetector,\n azureFunctionsDetector,\n azureVmDetector,\n gcpDetector,\n gitHubDetector,\n envDetector,\n ],\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 }\n },\n /* v8 ignore stop */\n }),\n new BunyanInstrumentation(),\n ];\n registerInstrumentations({\n instrumentations,\n });\n}\n\n/* v8 ignore start -- not easily testable */\n// https://github.com/open-telemetry/opentelemetry-js-api/issues/34\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/* v8 ignore stop */\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: SpanOptions,\n): ReturnType<F>;\nexport function instrument<F extends () => ReturnType<F>>(\n name: string,\n fn: F,\n options: SpanOptions = {},\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 (ret instanceof Promise) {\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"]}
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": "39.243.0",
4
+ "version": "39.244.0",
5
5
  "type": "commonjs",
6
6
  "bin": {
7
7
  "renovate": "dist/renovate.js",
@@ -161,6 +161,10 @@
161
161
  "@opentelemetry/instrumentation": "0.200.0",
162
162
  "@opentelemetry/instrumentation-bunyan": "0.46.0",
163
163
  "@opentelemetry/instrumentation-http": "0.200.0",
164
+ "@opentelemetry/resource-detector-aws": "2.0.0",
165
+ "@opentelemetry/resource-detector-azure": "0.7.0",
166
+ "@opentelemetry/resource-detector-gcp": "0.34.0",
167
+ "@opentelemetry/resource-detector-github": "0.31.0",
164
168
  "@opentelemetry/resources": "2.0.0",
165
169
  "@opentelemetry/sdk-trace-base": "2.0.0",
166
170
  "@opentelemetry/sdk-trace-node": "2.0.0",
@@ -203,7 +207,7 @@
203
207
  "find-packages": "10.0.4",
204
208
  "find-up": "5.0.0",
205
209
  "fs-extra": "11.3.0",
206
- "git-url-parse": "16.0.1",
210
+ "git-url-parse": "16.1.0",
207
211
  "github-url-from-git": "1.5.0",
208
212
  "glob": "11.0.1",
209
213
  "global-agent": "3.0.0",
@@ -285,7 +289,7 @@
285
289
  "@types/diff": "7.0.2",
286
290
  "@types/eslint-config-prettier": "6.11.3",
287
291
  "@types/fs-extra": "11.0.4",
288
- "@types/git-url-parse": "16.0.0",
292
+ "@types/git-url-parse": "16.0.2",
289
293
  "@types/github-url-from-git": "1.5.3",
290
294
  "@types/global-agent": "3.0.0",
291
295
  "@types/ini": "4.1.1",