Skip to content
Closed
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
61 changes: 36 additions & 25 deletions integration-tests/tests/otel-export.lux
Original file line number Diff line number Diff line change
Expand Up @@ -210,8 +210,27 @@
[global offset=$1]

[shell otel_collector]
# Verify request/storage metrics emitted by the initial snapshot before later span matching
# consumes this export window.
"""?
Metric #[0-9]+
Descriptor:
-> Name: electric\.plug\.serve_shape\.count
"""

"""?
Metric #[0-9]+
Descriptor:
-> Name: electric\.plug\.serve_shape\.bytes
"""

"""?
Metric #[0-9]+
Descriptor:
-> Name: electric\.storage\.snapshot_stored\.operations
"""

# Verify that the initial snapshot query span is exported from the Snapshotter path.
?Span #[0-9]+
?Name[ ]+: shape_snapshot\.execute_for_shape
?->[ ]shape\.query_reason: Str\(initial_snapshot\)

Expand All @@ -226,24 +245,8 @@
??"metadata"

[shell otel_collector]
# Verify that a direct subset snapshot query span is exported from the PartialModes path.
?Span #[0-9]+
?Name[ ]+: shape_snapshot\.execute_for_shape
?->[ ]shape\.query_reason: Str\(subset_query\)

[shell client]
[invoke curl_shape "http://localhost:3000/v1/shape?table=items&handle=$handle&offset=$offset&live"]

??HTTP/1.1 200 OK
??"value":{"val":"3"}

[shell psql]
!insert into items values ('4');
??INSERT

[shell otel_collector]
# Verify that new measurement exports from this branch are present
# Order matches actual OTEL export order (not alphabetical)
# Verify request/storage metrics emitted after the insert + subset snapshot export window.
# Order matches actual OTEL export order (not alphabetical).
"""?
Metric #[0-9]+
Descriptor:
Expand All @@ -256,12 +259,6 @@
-> Name: electric\.plug\.serve_shape\.bytes
"""

"""?
Metric #[0-9]+
Descriptor:
-> Name: electric\.storage\.snapshot_stored\.operations
"""

"""?
Metric #[0-9]+
Descriptor:
Expand All @@ -274,6 +271,20 @@
-> Name: electric\.storage\.transaction_stored\.operations
"""

# Verify that a direct subset snapshot query span is exported from the PartialModes path.
?Name[ ]+: shape_snapshot\.execute_for_shape
?->[ ]shape\.query_reason: Str\(subset_query\)

[shell client]
[invoke curl_shape "http://localhost:3000/v1/shape?table=items&handle=$handle&offset=$offset&live"]

??HTTP/1.1 200 OK
??"value":{"val":"3"}

[shell psql]
!insert into items values ('4');
??INSERT

###

[cleanup]
Expand Down
Loading