Skip to content

fix: setting IsMonotonic to true during Cumulative metric conversion#49826

Merged
songy23 merged 5 commits into
open-telemetry:mainfrom
swapnil-signoz:fix/googlecloudmonitoring-cumulative-metrics
Jul 22, 2026
Merged

fix: setting IsMonotonic to true during Cumulative metric conversion#49826
songy23 merged 5 commits into
open-telemetry:mainfrom
swapnil-signoz:fix/googlecloudmonitoring-cumulative-metrics

Conversation

@swapnil-signoz

Copy link
Copy Markdown
Contributor

Description

receiver/googlecloudmonitoring: GCP's cumulative metric kind maps to OTel's Monotonic Sum, but during conversion to OTel metric IsMonotonic value is not being set. This PR adds the SetIsMonotonic call and a test for it.

Please check the issue attached below for more context.

Link to tracking issue

Fixes #49804

Testing

I have added test case which checks the converted metric has IsMonotonic set to true

Documentation

Not Applicable

Authorship

  • I, a human, wrote this pull request description myself.

@swapnil-signoz
swapnil-signoz requested review from a team, TylerHelmuth and dashpole as code owners July 22, 2026 16:59
@linux-foundation-easycla

linux-foundation-easycla Bot commented Jul 22, 2026

Copy link
Copy Markdown

CLA Signed
The committers listed above are authorized under a signed CLA.

@swapnil-signoz swapnil-signoz changed the title Fix/googlecloudmonitoring cumulative metrics fix: setting IsMonotonic to true during Cumulative metric conversion Jul 22, 2026
@github-actions github-actions Bot added the first-time contributor PRs made by new contributors label Jul 22, 2026
@github-actions

Copy link
Copy Markdown
Contributor

Welcome, contributor! Thank you for your contribution to opentelemetry-collector-contrib.

Important reminders:

  • Read our Contributing Guidelines.
  • Sign the CLA if you haven't already.
  • Follow the OpenTelemetry Generative AI policy: disclose any AI use in your contribution, and communicate (PR descriptions, review replies) in your own words rather than AI-generated text.
  • Give reviewers at least a few days before pinging them for feedback.
  • If you need help with general setup, development process, or contributor etiquette, ask in #opentelemetry-new-contributors.
  • First-time contributors should have at most one PR not marked as draft until their first PR is merged.
  • If your change isn't one of our priority components, reviews may take more time.
  • Raise technical or Collector-specific questions in #otel-collector-dev or a Collector SIG meeting.


# The name of the component, or a single word describing the area of concern, (e.g. receiver/filelog)
component: exporter/elasticsearch
component: receiver/googlecloudmonitoringreceiver

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Suggested change
component: receiver/googlecloudmonitoringreceiver
component: receiver/googlecloudmonitoring

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

updated


# A brief description of the change. Surround your text with quotes ("") if it needs to start with a backtick (`).
note: "Allow `traces`, `profiles`, and `synthetics` as valid `data_stream.type` values when overriding via attributes in `bodymap` mapping mode, in addition to the existing `logs` and `metrics`."
note: "Fix cumulative metrics to be marked as monotonic"

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Suggested change
note: "Fix cumulative metrics to be marked as monotonic"
note: "CUMULATIVE metrics from Cloud Monitoring will now be properly marked as monotonic upon conversion"

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

updated

@opentelemetry-pr-dashboard

opentelemetry-pr-dashboard Bot commented Jul 22, 2026

Copy link
Copy Markdown

Pull request dashboard status

Status last refreshed: 2026-07-22 19:05:11 UTC.

  • Status: Merged.

This automated status or its linked feedback items may be incorrect. If something looks wrong, please report it with the result you expected.

@braydonk braydonk added the ready to merge Code review completed; ready to merge by maintainers label Jul 22, 2026
@songy23
songy23 merged commit d3fa279 into open-telemetry:main Jul 22, 2026
172 of 173 checks passed
@otelbot

otelbot Bot commented Jul 22, 2026

Copy link
Copy Markdown
Contributor

Thank you for your contribution @swapnil-signoz! 🎉 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

first-time contributor PRs made by new contributors ready to merge Code review completed; ready to merge by maintainers receiver/googlecloudmonitoring

Projects

None yet

Development

Successfully merging this pull request may close these issues.

(receiver/googlecloudmonitoring) Cumulative and Delta (Int64, Double) sum conversion does not set IsMonotonic property

3 participants