Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: prepare release 2.0.0/0.200.0 #5521

Open
wants to merge 5 commits into
base: main
Choose a base branch
from

Conversation

pichlermarc
Copy link
Member

@pichlermarc pichlermarc commented Mar 4, 2025

Note

Scheduled for Mar 17, 2025

2.0.0

Summary

  • The minimum supported Node.js has been raised to ^18.19.0 || >=20.6.0. This means that support for Node.js 14 and 16 has been dropped.
  • The minimum supported TypeScript version has been raised to 5.0.4.
  • The compilation target for transpiled TypeScript has been raised to ES2022 (from ES2017).
  • The public interface has changed
  • Only experimental versions 0.200.0 are compatible with this release

💥 Breaking Change

  • feat(sdk-trace-base)!: Add parentSpanContext and remove parentSpanId from Span and ReadableSpan #5450 @JacksonWeber
    • (user-facing): the SDK's Spans parentSpanId was replaced by parentSpanContext, to migrate to the new property, please replace span.parentSpanId -> span.parentSpanContext?.spanId
  • feat(sdk-metrics)!: drop deprecated type field on MetricDescriptor #5291 @chancancode
  • feat(sdk-metrics)!: drop deprecated InstrumentDescriptor type; use MetricDescriptor instead #5277 @chancancode
  • feat(sdk-metrics)!: bump minimum version of @opentelemetry/api peer dependency to 1.9.0 #5254 @chancancode
  • chore(shim-opentracing): replace deprecated SpanAttributes #4430 @JamieDanielson
  • chore(otel-core): replace deprecated SpanAttributes #4408 @JamieDanielson
  • feat(sdk-metrics)!: remove MeterProvider.addMetricReader() in favor of constructor option #4419 @pichlermarc
  • chore(otel-resources): replace deprecated SpanAttributes #4428 @JamieDanielson
  • feat(sdk-metrics)!: remove MeterProvider.addMetricReader() in favor of constructor option #4419 @pichlermarc
  • feat(sdk-metrics)!: replace attributeKeys with custom processors option #4532 @pichlermarc
  • refactor(sdk-trace-base)!: replace SpanAttributes with Attributes #5009 @david-luna
  • refactor(resources)!: replace ResourceAttributes with Attributes #5016 @david-luna
  • feat(sdk-metrics)!: drop View and Aggregation in favor of ViewOptions and AggregationOption #4931 @pichlermarc
  • refactor(sdk-trace-base)!: remove new Span constructor in favor of Tracer.startSpan API #5048 @david-luna
  • refactor(sdk-trace-base)!: remove BasicTracerProvider.addSpanProcessor API in favor of constructor options. #5134 @david-luna
  • refactor(sdk-trace-base)!: make resource property private in BasicTracerProvider and remove getActiveSpanProcessor API. #5192 @david-luna
  • feat(sdk-metrics)!: extract IMetricReader interface and use it over abstract class #5311
    • (user-facing): MeterProviderOptions now provides the more general IMetricReader type over MetricReader
    • If you accept MetricReader in your public interface, consider accepting the more general IMetricReader instead to avoid unintentional breaking changes
  • feat(sdk-trace)!: remove ability to have BasicTracerProvider instantiate exporters #5239 @pichlermarc
    • When extending BasicTracerProvider, the class offered multiple methods to facilitate the creation of exporters and auto-pairing with SpanProcessors.
      • This functionality has been removed - users may now pass SpanProcessors to the base class constructor when extending
      • (user-facing): _registeredExporters has been removed
      • (user-facing): _getSpanExporter has been removed
      • (user-facing): _buildExporterFromEnv has been removed
  • feat(core)!: remove deprecated IdGenerator and RandomIdGenerator #5309 @pichlermarc
  • feat(core)!: remove deprecated type InstrumentationLibrary #5308 @pichlermarc
    • (user-facing): please use equivalent type InstrumentationScope instead
  • feat(sdk-trace-base)!: replace usages fo InstrumentationLibrary with InstrumentationScope #5308 @pichlermarc
    • (user-facing) rename Tracer.instrumentationLibrary -> Tracer.instrumentationScope
    • (user-facing) rename ReadableSpan.instrumentationLibrary -> ReadableSpan.instrumentationScope
      • also renames the property in implementations of ReadableSpan
  • feat(exporter-jaeger): use ReadableSpan.instrumentationScope over ReadableSpan.instrumentationLibrary #5308 @pichlermarc
  • feat(exporter-zipkin): use ReadableSpan.instrumentationScope over ReadableSpan.instrumentationLibrary #5308 @pichlermarc
  • chore!: update typescript to version 5.0.4 #5145 @david-luna
    • (user-facing) dropped support for typescript@<5.0.4
    • (user-facing) all packages published from this repository will from now on drop support for old versions of typescript in minor releases. We will only drop support for versions that are older than 2 years.
  • feat(core)!: remove deprecated samplers #5316 @pichlermarc
    • (user-facing): deprecated AlwaysOnSampler has moved to @opentelemetry/sdk-trace-base
    • (user-facing): deprecated AlwaysOffSampler has moved to @opentelemetry/sdk-trace-base
    • (user-facing): deprecated ParentBasedSampler has moved to @opentelemetry/sdk-trace-base
    • (user-facing): deprecated TraceIdRatioSampler has moved to @opentelemetry/sdk-trace-base
  • feat(resource): Merge sync and async resource interfaces into a single interface #5350 @dyladan
    • Resource constructor now takes a single argument which contains an optional attributes object
    • Detected resource attribute values may be a promise or a synchronous value
    • Resources are now merged by the order in which their detectors are configured instead of async attributes being last
    • Resource detectors now return DetectedResource plain objects instead of new Resource()
  • feat(sdk-trace-base)!: drop ability to instantiate propagators beyond defaults #5355 @pichlermarc
    • (user-facing): only a non-env-var based default is now used on BasicTracerProvider#register().
      • propagators can now not be configured via OTEL_PROPAGATORS or window.OTEL_PROPAGATORS anymore, please pass the propagator to NodeTracerProvider#register() instead.
      • if not configured directly via code, BasicTracerProvider#register() will now fall back to defaults (tracecontext and baggage)
  • feat(sdk-trace-node)!: drop ability to instantiate propagators beyond defaults #5355 @pichlermarc
    • (user-facing): only a non-env-var based default is now used on NodeTracerProvider#register().
      • propagators can now not be configured via OTEL_PROPAGATORS anymore, please pass the propagator to NodeTracerProvider#register() instead.
      • if not configured via code, NodeTracerProvider#register() will now fall back to the defaults (tracecontext and baggage)
      • if autoconfiguration based on enviornment variables is needed, please use NodeSDK from @opentelemetry/sdk-node.
  • feat(sdk-trace-web)!: drop ability to instantiate propagators beyond defaults #5355 @pichlermarc
    • (user-facing): only a non-env-var based default is now used on WebTracerProvider#register().
      • propagators can now not be configured via window.OTEL_PROPAGATORS anymore, please pass the propagator to WebTracerProvider#register() instead.
      • if not configured via code, WebTracerProvider#register() will now fall back to defaults (tracecontext and baggage)
  • feat(sdk-trace)!: drop unnecessary exports #5405 @pichlermarc
    • (user-facing): EXPORTER_FACTORY is not used anymore and has been removed
    • (user-facing): PROPAGATOR_FACTORY is not used anymore and has been removed
    • (user-facing): ForceFlushState was intended for internal use and has been removed
    • (user-facing): the Tracer class was unintentionally exported and has been removed
      • to obtain a Tracer, please use BasicTracerProvider#getTracer(), NodeTracerProvider#getTracer() or WebTracerProvider#getTracer()
      • to reference a Tracer, please use the Tracer type from @opentelemetry/api
  • chore!: Raise the minimum supported Node.js version to ^18.19.0 || >=20.6.0. Support for Node.js 14, 16, and early minor versions of 18 and 20 have been dropped. This applies to all packages except the 'api' and 'semantic-conventions' packages. #5395 @trentm
  • feat(core)!: remove TracesSamplerValues from exports #5406 @pichlermarc
    • (user-facing): TracesSamplerValues was only consumed internally and has been removed from exports without replacement
  • chore(resources)!: Remove deprecated duplicate browser detector from @opentelemetry/resource in favor of @opentelemetry/opentelemetry-browser-detector #5420
  • feat(core)!: remove unused and obsolete functions and types #5444 @pichlermarc
    • (user-facing): VERSION was an internal constant that was unintentionally exported. It has been removed without replacement.
    • (user-facing): isWrapped has been removed in favor of isWrapped from @opentelemetry/instrumentation
    • (user-facing): ShimWrapped has been removed in favor of ShimWrapped from @opentelemetry/instrumentation
    • (user-facing): hexToBase64 was a utility function that is not used by the SDK anymore. It has been removed without replacement.
    • (user-facing): hexToBinary was a utility function that now internal to @opentelemetry/otlp-tranformer. It has been removed without replacement.
    • (user-facing): baggageUtils.getKeyParis was an internal utility function that was unintentionally exported. It has been removed without replacement.
    • (user-facing): baggageUtils.serializeKeyPairs was an internal utility function that was unintentionally exported. It has been removed without replacement.
    • (user-facing): baggageUtils.parseKeyPairsIntoRecord, has been removed in favor of parseKeyPairsIntoRecord
    • (user-facing): baggageUtils.parsePairKeyValue was an internal utility function that was unintentionally exported. It has been removed without replacement.
    • (user-facing): TimeOriginLegacy has been removed without replacement.
    • (user-facing): isAttributeKey was an internal utility function that was unintentionally exported. It has been removed without replacement.
  • feat(sdk-trace-base)!: do not read environment variables from window in browsers #5445 @pichlermarc
    • (user-facing): all configuration previously possible via window.OTEL_* is now not supported anymore, please pass configuration options to constructors instead.
    • Note: Node.js environment variable configuration continues to work as-is.
  • feat(exporter-zipkin)!: do not read environment variables from window in browsers #5465 @pichlermarc
    • (user-facing): all configuration previously possible via window.OTEL_* is now not supported anymore, please pass configuration options to constructors instead.
    • Note: Node.js environment variable configuration continues to work as-is.
  • feat(resource)!: Remove resource class export in favor of functions and types only to aid in cross-version compatibility #5421
    • Renames Resource class to ResourceImpl and makes it package-private
    • Renames IResource interface to Resource
    • Export function resourceFromAttributes to create a Resource from a DetectedAttributes object
    • Export function defaultResource to create a default resource #5467 @pichlermarc
    • Export function emptyResource to create an empty resource #5467 @pichlermarc
    • Only export types and functions. This aids in cross-version compatibility and makes it more easily extensible in the future.
  • feat(resources)!: do not read environment variables from window in browsers #5466 @pichlermarc
    • (user-facing): all configuration previously possible via window.OTEL_* is now not supported anymore
      • If you have been using the envDetector in browser environments, please migrate to manually creating a resource.
      • Note: Node.js environment variable configuration continues to work as-is.
  • fix(sdk-trace-base)!: use ParentBasedAlwaysOnSampler over AlwaysOnSampler when bogus data is supplied to OTEL_TRACES_SAMPLER
    • this aligns the SDK implementation with the specification
  • feat(core)!: drop getEnv(), getEnvWithoutDefaults() #5481 @pichlermarc
    • (user-facing): getEnv() has been replaced by getStringFromEnv(), getNumberFromEnv(), getBooleanFromEnv(), getStringListFromEnv()
      • these new functions do not include defaults, please inline any defaults if necessary (example: getStringFromEnv("OTEL_FOO") ?? "my-default")
      • to find the previously used defaults, please see here
    • (user-facing): getEnvWithoutDefaults() has been replaced by getStringFromEnv(), getNumberFromEnv(), getBooleanFromEnv(), getStringListFromEnv()
    • (user-facing): DEFAULT_ENVIRONMENT has been removed, please inline any defaults from now on
      • to find the previously used defaults, please see here
    • (user-facing): ENVIRONMENT has been removed without replacement
    • (user-facing): RAW_ENVIRONMENT has been removed without replacement
    • (user-facing): parseEnvironment has been removed without replacement
  • feat(sdk-trace-base): remove BasicTracerProvider#register() to improve tree-shaking #5503 @pichlermarc
    • (user-facing): BasicTracerProvider#register() has been removed
      • to register a global propagator, please use propagation.setGlobalPropagator() from @opentelemetry/api
      • to register a global context manager, please use context.setGlobalContextManager() from @opentelemetry/api
  • feat!: set compilation target to ES2022 for all packages except @opentelemetry/api, @opentelemetry/api-logs, @opentelemetry/api-events, and @opentelemetry/semantic-conventions #5456 @david-luna
    • (user-facing): drops browser runtimes which do not support ES2022 features
  • feat(core)! drop unused constants #5504 @pichlermarc
    • (user-facing): DEFAULT_ATTRIBUTE_VALUE_LENTGHT_LIMIT has been removed, please use Infinity instead
    • (user-facing): DEFAULT_ATTRIBUTE_VALUE_COUNT_LIMIT has been removed, please use 128 instead
    • (user-facing): DEFAULT_SPAN_ATTRIBUTE_PER_EVENT_COUNT_LIMIT has been removed, please use 128 instead
    • (user-facing): DEFAULT_SPAN_ATTRIBUTE_PER_LINK_COUNT_LIMIT has been removed, please use 128 instead

🚀 (Enhancement)

  • feat(sdk-trace-web): do not throw when passing extra options #5357 @pichlermarc
    • WebTracerProvider constructor now does not throw anymore when contextManager or propagator are passed as extra options to the constructor
  • feat(sdk-trace-base): add stack trace warning to debug instrumentation #5363 @neilfordyce
  • feat(core): add more scalable replacements for getEnv(), getEnvWithoutDefaults() #5443 @pichlermarc
  • refactor(exporter-jaeger): migrate away from getEnv() #5464 @pichlermarc
  • feat(core): add diagLogLevelFromString utility #5475 @pichlermarc

🐛 (Bug Fix)

  • fix(exporter-zipkin): remove usages of deprecated url.parse from node:url #5390 @chancancode
  • fix(sdk-metrics): do not export from PeriodicExportingMetricReader when there are no metrics to export. #5288 @JacksonWeber
  • fix(sdk-trace-base): always wait on pending export in SimpleSpanProcessor. #5303 @anuraaga
  • fix(core): avoid using util in configuration.ts for browser compatibility #5524 @sriraamas

🏠 (Internal)

  • refactor(sdk-metrics): the internal InstrumentDescriptor type now extends MetricDescriptor; moved public InstrumentType type enum into ./src/export/MetricData.ts #5277
  • refactor(sdk-metrics): remove Gauge and MetricAdvice workaround types in favor of the upstream @opentelemetry/api types #5254 @chancancode
  • chore: remove checks for unsupported node versions #4341 @dyladan
  • refactor(sdk-trace-base): remove BasicTracerProvider._registeredSpanProcessors private property. #5134 @david-luna
  • refactor(sdk-trace-base): rename BasicTracerProvider.activeSpanProcessor private property. #5211 @david-luna
  • chore(selenium-tests): remove internal selenium-tests/ package, it wasn't being used @trentm
  • chore: update typescript module compiler option to node16. #5347 @david-luna
  • feat(opentelemetry-instrumentation): replace semver package with internal semantic versioning check implementation to get rid of semver package initialization overhead especially in the AWS Lambda environment during coldstart #5305 @serkan-ozal
  • chore: unpin @opentelemetry/semantic-conventions dep to allow better de-duplication in installs #5439 @trentm

0.200.0

Summary

  • The minimum supported Node.js has been raised to ^18.19.0 || >=20.6.0. This means that support for Node.js 14 and 16 has been dropped.
  • The minimum supported TypeScript version has been raised to 5.0.4.
  • The compilation target for transpiled TypeScript has been raised to ES2022 (from ES2017).
  • The public interface has changed
  • Only stable versions 2.0.0 are compatible with this release

💥 Breaking Change

  • feat(exporter-prometheus)!: stop the using type field to enforce naming conventions #5291 @chancancode
    • Any non-monotonic sums will now be treated as counters and will therefore include the _total suffix.
  • feat(shim-opencenus)!: stop mapping removed Instrument type to OpenTelemetry metrics #5291 @chancancode
    • The internal OpenTelemetry data model dropped the concept of instrument type on exported metrics, therefore mapping it is not necessary anymore.
  • feat(instrumentation-fetch)!: passthrough original response to applyCustomAttributes hook #5281 @chancancode
    • Previously, the fetch instrumentation code unconditionally clones every fetch() response in order to preserve the ability for the applyCustomAttributes hook to consume the response body. This is fundamentally unsound, as it forces the browser to buffer and retain the response body until it is fully received and read, which crates unnecessary memory pressure on large or long-running response streams. In extreme cases, this is effectively a memory leak and can cause the browser tab to crash. If your use case for applyCustomAttributes requires access to the response body, please chime in on #5293.
  • chore!: Raise the minimum supported Node.js version to ^18.19.0 || >=20.6.0. Support for Node.js 14, 16, and early minor versions of 18 and 20 have been dropped. This applies to all packages except the 'api' and 'semantic-conventions' packages. #5395 @trentm
  • feat(sdk-node)!: use IMetricReader over MetricReader #5311
    • (user-facing): NodeSDKConfiguration now provides the more general IMetricReader type over MetricReader
  • feat(exporter-metrics-otlp-http)!: do not read environment variables from window in browsers #5473 @pichlermarc
    • (user-facing): all configuration previously possible via window.OTEL_* is now not supported anymore, please pass configuration options to constructors instead.
    • Note: Node.js environment variable configuration continues to work as-is.
  • feat(sdk-logs)!: do not read environment variables from window in browsers #5472 @pichlermarc
    • (user-facing): all configuration previously possible via window.OTEL_* is now not supported anymore, please pass configuration options to constructors instead.
      • Note: Node.js environment variable configuration continues to work as-is.

🚀 (Enhancement)

  • feat(instrumentation-fetch): add a requestHook option #5380
  • feat(instrumentation): re-export initialize function from import-in-the-middle #5123
  • feat(sdk-node): lower diagnostic level #5360 @cjihrig
  • feat(exporter-prometheus): add additional attributes option #5317 @marius-a-mueller
    • Add withResourceConstantLabels option to ExporterConfig. It can be used to define a regex pattern to choose which resource attributes will be used as static labels on the metrics. The default is to not set any static labels.

🐛 (Bug Fix)

  • fix(instrumentation-grpc): monitor error events with events.errorMonitor #5369 @cjihrig
  • fix(exporter-metrics-otlp-http): browser OTLPMetricExporter was not passing config to OTLPMetricExporterBase super class #5331 @trentm
  • fix(instrumentation-fetch, instrumentation-xhr): Ignore network events with zero-timings #5332 @chancancode
  • fix(exporter-logs/trace-otlp-grpc): fix error for missing dependency otlp-exporter-base #5412 @JamieDanielson

🏠 (Internal)

  • chore(instrumentation-grpc): remove unused findIndex() function #5372 @cjihrig
  • refactor(otlp-exporter-base): remove unnecessary isNaN() checks #5374 @cjihrig
  • refactor(exporter-prometheus): remove unnecessary isNaN() check #5377 @cjihrig
  • refactor(sdk-node): move code to auto-instantiate propagators into utils #5355 @pichlermarc
  • chore: unpin @opentelemetry/semantic-conventions dep to allow better de-duplication in installs #5439 @trentm
  • refactor(instrumentation-http): migrate away from getEnv() #5469 @pichlermarc
  • refactor(sdk-node): migrate away from getEnv() #5475 @pichlermarc

@pichlermarc pichlermarc added this to the OpenTelemetry SDK 2.0 milestone Mar 4, 2025
@pichlermarc pichlermarc added the target:next-major-release This PR targets the next major release (`next` branch) label Mar 4, 2025
Copy link

codecov bot commented Mar 4, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 94.95%. Comparing base (ecd67de) to head (5fce4f7).

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #5521   +/-   ##
=======================================
  Coverage   94.95%   94.95%           
=======================================
  Files         308      308           
  Lines        7927     7927           
  Branches     1604     1604           
=======================================
  Hits         7527     7527           
  Misses        400      400           
🚀 New features to boost your workflow:
  • Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@JakeGinnivan
Copy link

@pichlermarc I put this in the ESM related thread, but it might be worth considering not including NodeJS 18, it is out of support on 2025-04-30 (only about 6 weeks away).

Then you can drop CommonJS entirely in the release (see https://antfu.me/posts/move-on-to-esm-only).

Being able to require(esm) has been back ported into Node 20 now so there is pretty broad ecosystem compatibility and it saves having to dual publish to esm and cjs.

@pichlermarc
Copy link
Member Author

@JakeGinnivan, thanks for reaching out. We're releasing on Monday and the release candidate is already published.

That means that we'll not make any major changes to the 2.0 release anymore. There will be more major releases in the future, though - 2.0 is just the first step towards a more regular major release cadence.

@pichlermarc pichlermarc force-pushed the chore/prepare-next-release branch from 068f4e5 to acfed92 Compare March 14, 2025 13:08
@pichlermarc pichlermarc marked this pull request as ready for review March 14, 2025 13:16
@pichlermarc pichlermarc requested a review from a team as a code owner March 14, 2025 13:16
@pichlermarc
Copy link
Member Author

rebased onto main - now ready for review. 🙂

@pichlermarc
Copy link
Member Author

(lint step is failing due to a server error contacting https://slack.cncf.io - I'll re run the workflow once it's back up)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
target:next-major-release This PR targets the next major release (`next` branch)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

re-enable "docs.yml" workflow (for deploying API docs) once "main" is ready for releases again
3 participants