Skip to content

Conversation

Copy link
Contributor

Copilot AI commented Sep 17, 2025

Observable updown counters were incorrectly exporting delta values instead of cumulative values to Geneva. This happened because the GetAggregationTemporality method in the Geneva exporter only checked for kUpDownCounter instrument types but missed kObservableUpDownCounter types.

Both regular and observable updown counters should use cumulative aggregation temporality for proper Geneva export behavior, as updown counters represent values that can go up and down and need to maintain their absolute state rather than just reporting changes.

Changes

Updated the conditional check in GetAggregationTemporality to include both instrument types:

// Before
if (instrument_type == sdk::metrics::InstrumentType::kUpDownCounter)

// After  
if (instrument_type == sdk::metrics::InstrumentType::kUpDownCounter ||
    instrument_type == sdk::metrics::InstrumentType::kObservableUpDownCounter)

Added comprehensive unit test GetAggregationTemporalityTest that verifies:

  • kUpDownCounter returns kCumulative (existing behavior)
  • kObservableUpDownCounter returns kCumulative (fixed behavior)
  • Other instrument types like kCounter and kHistogram continue to return kDelta

This minimal change ensures observable updown counters export their cumulative values to Geneva correctly, matching the behavior of regular updown counters.

Fixes #570.


💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

Copy link
Contributor Author

Copilot AI commented Sep 17, 2025

@lalitb 👋 This repository doesn't have Copilot instructions. With Copilot instructions, I can understand the repository better, work faster and produce higher quality PRs.

I can generate a .github/copilot-instructions.md file for you automatically. Click here to open a pre-filled issue and assign it to me. I'll write the instructions, and then tag you for review.

Copilot AI changed the title [WIP] Observable updown counter is incorrect exported to Geneva Fix observable updown counter aggregation temporality in Geneva exporter Sep 17, 2025
Copilot AI requested a review from lalitb September 17, 2025 16:00
Copilot finished work on behalf of lalitb September 17, 2025 16:00
@lalitb lalitb marked this pull request as ready for review September 17, 2025 21:00
@lalitb lalitb requested a review from a team as a code owner September 17, 2025 21:00
Copy link
Member

@cijothomas cijothomas left a comment

Choose a reason for hiding this comment

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

nit: add changelog too

@ThomsonTan ThomsonTan merged commit 7731a60 into main Sep 17, 2025
3 checks passed
@ThomsonTan ThomsonTan deleted the copilot/fix-570 branch September 17, 2025 21:05
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.

Observable updown counter is incorrect exported to Geneva

4 participants