Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
# Changelog

## 2.1.0

- Added optional `correlation_id` support to the typed monitoring event request
model and ingestion serialization.

## 1.0.0

- Rebuilt the client for the current 13-operation public monitoring API.
Expand Down
19 changes: 19 additions & 0 deletions UPGRADING.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,3 +15,22 @@ Use these resources:
Python models use snake_case fields and preserve unknown enum values through
tolerant string enums. Existing v1 clients can continue using `/v1`; v2
clients must use the v2 artifact and endpoint.

## Upgrading to 2.1.0

The 2.1.0 client adds the optional `correlation_id` field to
`MonitoringEvent`. Use it when the same transaction spans services that report
different references:

```python
MonitoringEvent(
flow="payment_to_wallet",
type="payment.succeeded",
reference="order-123",
entity_id="wallet-123",
correlation_id="checkout-123",
)
```

The value is sent as event metadata and does not change operation grouping or
evaluation behavior.
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ build-backend = "hatchling.build"

[project]
name = "reconify-python"
version = "2.0.0"
version = "2.1.0"
description = "Typed Python client for the Reconify Public API"
readme = "README.md"
requires-python = ">=3.10"
Expand Down
1 change: 1 addition & 0 deletions src/reconify/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -131,6 +131,7 @@ class MonitoringEvent(RequestModel):
entity_id: str
occurred_at: datetime | None = None
amount: str | None = None
correlation_id: str | None = None
currency: str | None = None
data: MonitoringEventData | None = None
metadata: dict[str, str | int | float | bool] | None = None
Expand Down
2 changes: 2 additions & 0 deletions tests/test_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,7 @@ def handler(request: httpx.Request) -> httpx.Response:
reference="order-1",
entity_id="wallet-1",
amount="10.00",
correlation_id="checkout-123",
currency="USD",
)
]
Expand All @@ -104,6 +105,7 @@ def handler(request: httpx.Request) -> httpx.Response:
client.ingestion.ingest_monitoring_events(body)

assert json.loads(requests[0].content)["events"][0]["entity_id"] == "wallet-1"
assert json.loads(requests[0].content)["events"][0]["correlation_id"] == "checkout-123"
assert requests[0].url.path == "/v2/events"


Expand Down
2 changes: 1 addition & 1 deletion uv.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading