Skip to content

Conversation

@Slawaq
Copy link
Contributor

@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.41%. Comparing base (efa7ef5) to head (2458b46).
⚠️ Report is 1 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #6191   +/-   ##
=======================================
  Coverage   95.41%   95.41%           
=======================================
  Files         317      317           
  Lines        9460     9460           
  Branches     2199     2199           
=======================================
  Hits         9026     9026           
  Misses        434      434           
🚀 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
Contributor 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
Copy link
Member

@raphael-theriault-swi raphael-theriault-swi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you !

@raphael-theriault-swi raphael-theriault-swi added this pull request to the merge queue Dec 8, 2025
Merged via the queue into open-telemetry:main with commit 0a1a631 Dec 8, 2025
27 checks passed
@otelbot
Copy link
Contributor

otelbot bot commented Dec 8, 2025

Thank you for your contribution @Slawaq! 🎉 We would like to hear from you about your experience contributing to OpenTelemetry by taking a few minutes to fill out this survey.

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