renovate 42.29.0 → 42.29.2

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.
@@ -23,6 +23,7 @@ const resources_1 = require("@opentelemetry/resources");
23
23
  const sdk_trace_base_1 = require("@opentelemetry/sdk-trace-base");
24
24
  const sdk_trace_node_1 = require("@opentelemetry/sdk-trace-node");
25
25
  const semantic_conventions_1 = require("@opentelemetry/semantic-conventions");
26
+ const is_1 = require("@sindresorhus/is");
26
27
  const expose_cjs_1 = require("../expose.cjs");
27
28
  const env_1 = require("../util/env");
28
29
  const utils_1 = require("./utils");
@@ -124,7 +125,7 @@ function instrument(name, fn, options = {}, context = api.context.active()) {
124
125
  return getTracer().startActiveSpan(name, options, context, (span) => {
125
126
  try {
126
127
  const ret = fn();
127
- if (ret instanceof Promise) {
128
+ if ((0, is_1.isPromise)(ret)) {
128
129
  return ret
129
130
  .catch((e) => {
130
131
  span.recordException(e);
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../lib/instrumentation/index.ts"],"names":[],"mappings":";;AAuDA,oBA2EC;AAID,4BAUC;AAED,0DAIC;AAED,8CAEC;AAqBD,gCAiCC;;AAhND,yCAA0C;AAE1C,gEAA0C;AAC1C,4CAAyE;AACzE,4EAAqF;AACrF,sFAA4E;AAE5E,oEAA0E;AAC1E,kFAA8E;AAC9E,8EAA0E;AAC1E,gFAA4E;AAC5E,gFAM8C;AAC9C,oFAIgD;AAChD,gFAAmE;AACnE,sFAAyE;AACzE,wDAIkC;AAClC,kEAKuC;AACvC,kEAAmE;AACnE,8EAG6C;AAC7C,8CAAoC;AACpC,qCAAqC;AAErC,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,GAAo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Provider } 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 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 { getEnv } from '../util/env';\nimport type { RenovateSpanOptions } from './types';\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 env = getEnv();\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: [\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 next -- 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 /* v8 ignore next -- not easily testable */\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 }),\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 (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":";;AAwDA,oBA2EC;AAID,4BAUC;AAED,0DAIC;AAED,8CAEC;AAqBD,gCAiCC;;AAjND,yCAA0C;AAE1C,gEAA0C;AAC1C,4CAAyE;AACzE,4EAAqF;AACrF,sFAA4E;AAE5E,oE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AAG,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 { 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 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 { isPromise } from '@sindresorhus/is';\nimport { pkg } from '../expose.cjs';\nimport { getEnv } from '../util/env';\nimport type { RenovateSpanOptions } from './types';\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 env = getEnv();\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: [\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 next -- 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 /* v8 ignore next -- not easily testable */\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 }),\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"]}
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": "42.29.0",
4
+ "version": "42.29.2",
5
5
  "type": "commonjs",
6
6
  "bin": {
7
7
  "renovate": "dist/renovate.js",
@@ -107,7 +107,7 @@
107
107
  "@opentelemetry/instrumentation": "0.208.0",
108
108
  "@opentelemetry/instrumentation-bunyan": "0.54.0",
109
109
  "@opentelemetry/instrumentation-http": "0.208.0",
110
- "@opentelemetry/instrumentation-redis": "0.57.0",
110
+ "@opentelemetry/instrumentation-redis": "0.57.1",
111
111
  "@opentelemetry/resource-detector-aws": "2.8.0",
112
112
  "@opentelemetry/resource-detector-azure": "0.16.0",
113
113
  "@opentelemetry/resource-detector-gcp": "0.43.0",
@@ -1,7 +1,7 @@
1
1
  {
2
- "title": "JSON schema for Renovate 42.29.0 config files (https://renovatebot.com/)",
2
+ "title": "JSON schema for Renovate 42.29.2 config files (https://renovatebot.com/)",
3
3
  "$schema": "http://json-schema.org/draft-07/schema#",
4
- "x-renovate-version": "42.29.0",
4
+ "x-renovate-version": "42.29.2",
5
5
  "allowComments": true,
6
6
  "type": "object",
7
7
  "properties": {