Skip to content

Conversation

gosusnp
Copy link
Contributor

@gosusnp gosusnp commented Oct 1, 2025

AirbyteStateStats enables sources and destination to report the number of records observed per state. This enabled validation of data consistency.

This change adds an optional AirbyteStateStats.additionalStats which is defined as an object of keys to number.

The intent is to allow a looser contract to enable connectors to report additional stats related to the data being moved. For example, we introduced AirbyteRecordMessageMetaChange which describes modifications connectors may need to perform on the data. The goal of this change would be to enable the connectors to report statistics related to those changes to enable better observability without having to scan the destination to extract this information.

description: >
additional stats for this state message. The values are defined as a double to account for integer overflows, and the values should always have a decimal point for proper serialization
type: object
additionalProperties:
Copy link
Contributor

Choose a reason for hiding this comment

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

Curious as to why this is under additionalProperties instead of properties? Is that to make it optional? I thought that the properties are only required if we declare them as required, like in AirbyteGlobalState.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This is the json schema way of saying all the additional properties of this object are of type number.
https://json-schema.org/understanding-json-schema/reference/object

Copy link
Contributor

Choose a reason for hiding this comment

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

Is there how we are saying this object is an open map of string to number?

Copy link
Contributor

Choose a reason for hiding this comment

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

Spoke offline: this is how we enforce the values in the object needs to be a number.

@gosusnp gosusnp merged commit 4f0a640 into main Oct 10, 2025
5 checks passed
@gosusnp gosusnp deleted the gosusnp/add-additional-stats-to-airbyte-state-stats branch October 10, 2025 16:34
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.

3 participants