Skip to content

Conversation

@Slawaq
Copy link

@Slawaq Slawaq commented Dec 5, 2025

Which problem is this PR solving?

The JSDoc for the ExporterConfig.appendTimestamp configuration option in the Prometheus exporter incorrectly states that the default value is true.

However, the actual implementation in PrometheusExporter.ts explicitly defines the default as false in static readonly DEFAULT_OPTIONS:
https://github.com/open-telemetry/opentelemetry-js/blob/main/experimental/packages/opentelemetry-exporter-prometheus/src/PrometheusExporter.ts#L31

static readonly DEFAULT_OPTIONS = {
  // ...
  appendTimestamp: false,
  // ...
};

This PR resolves the inconsistency to prevent user confusion—something I initially experienced when reading the JS sources and .d.ts files.

Short description of the changes

  • Updated the JSDoc in experimental/packages/opentelemetry-exporter-prometheus/src/export/types.ts to reflect that @default is false.

Type of change

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • This change requires a documentation update

How Has This Been Tested?

This is a documentation-only change (JSDoc fix) and does not alter runtime behavior. I verified the default value by inspecting the source code in PrometheusExporter.ts and PrometheusSerializer.ts.

  • Manual verification of code implementation vs documentation.

Checklist:

  • Followed the style guidelines of this project
  • Unit tests have been added (N/A: Documentation fix only)
  • Documentation has been updated

@Slawaq Slawaq requested a review from a team as a code owner December 5, 2025 16:38
@linux-foundation-easycla
Copy link

linux-foundation-easycla bot commented Dec 5, 2025

CLA Signed

The committers listed above are authorized under a signed CLA.

@raphael-theriault-swi
Copy link
Member

Thanks for the contribution ! Could you add a changelog entry in experimental/CHANGELOG.md ?

@codecov
Copy link

codecov bot commented Dec 5, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 95.40%. Comparing base (bc9e37f) to head (1801e4e).

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #6191   +/-   ##
=======================================
  Coverage   95.40%   95.40%           
=======================================
  Files         317      317           
  Lines        9462     9462           
  Branches     2199     2199           
=======================================
  Hits         9027     9027           
  Misses        435      435           
🚀 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.

@Slawaq
Copy link
Author

Slawaq commented Dec 5, 2025

@raphael-theriault-swi done ✅

Slawaq and others added 2 commits December 7, 2025 20:38
The JSDoc has a mismatch with the actual default values of PrometheusExporter. It's false and not true
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants