Skip to content

Commit ea0c286

Browse files
Support ObservabilitySettings (#180)
1 parent 68a5eb8 commit ea0c286

File tree

5 files changed

+84
-14
lines changed

5 files changed

+84
-14
lines changed

.helm/templates/crd-microsoft-synapse.yaml

Lines changed: 32 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,18 @@ spec:
7171
- ORC
7272
- AVRO
7373
default: PARQUET
74+
observabilitySettings:
75+
type: object
76+
description: Configurations for enhancing logs and metrics produced by the plugin application
77+
properties:
78+
metricTags:
79+
type: object
80+
description: Additional tags to be assigned to all emitted metrics
81+
additionalProperties:
82+
type: string
83+
default: {}
84+
default:
85+
metricTags: {}
7486
sourceSettings:
7587
type: object
7688
properties:
@@ -84,6 +96,26 @@ spec:
8496
description: How long to wait before polling for next change set. Accepted range is between 1s and 3600s
8597
minimum: 1
8698
maximum: 3600
99+
httpClientMaxRetries:
100+
type: integer
101+
description: Maximum number of retries for the HTTP client
102+
default: 3
103+
httpClientMinRetryDelaySeconds:
104+
type: number
105+
description: Minimum delay between blob client call retries
106+
default: 0.1
107+
httpClientMaxRetryDelaySeconds:
108+
type: number
109+
description: Maximum delay between blob client call retries
110+
default: 1
111+
httpRetryTimeoutSeconds:
112+
type: number
113+
description: Retry timeout for blob storage operations
114+
default: 60
115+
maxResultsPerPage:
116+
type: integer
117+
description: Maximum number of objects per page in paginated responses
118+
default: 5000
87119
connectionStringRef:
88120
description: |
89121
Name of the secret containing connection details to Synapse storage account and Trino.
@@ -113,12 +145,6 @@ spec:
113145
type: string
114146
apiGroup:
115147
type: string
116-
httpClientMaxRetries:
117-
type: integer
118-
description: Max number of retries on blob reads for the http client.
119-
httpClientRetryDelaySeconds:
120-
type: integer
121-
description: Max retry delay on blob reads for the http client.
122148
rowsPerGroup:
123149
type: integer
124150
description: Maximum number of rows to be grouped together for the staging process to consume.

build.sbt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ lazy val plugin = (project in file("."))
2525
name := "arcane-stream-microsoft-synapse-link",
2626
idePackagePrefix := Some("com.sneaksanddata.arcane.microsoft_synapse_link"),
2727

28-
libraryDependencies += "com.sneaksanddata" % "arcane-framework_3" % "2.0.0-9-gdc66fbd",
28+
libraryDependencies += "com.sneaksanddata" % "arcane-framework_3" % "2.1.0",
2929
libraryDependencies += "io.netty" % "netty-tcnative-boringssl-static" % "2.0.74.Final",
3030

3131
// bugfix for upgrade header

docs/crd.md

Lines changed: 22 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,14 @@ spec:
4242
# The maximum number of rows in a group
4343
rowsPerGroup: 10000
4444

45+
# enhancements for logging and metrics middleware
46+
observabilitySettings:
47+
# extra metric tags for ALL metrics emitted from the streaming app
48+
# Note that tag name and value should only contain alphanumeric characters, separated by `_` if needed
49+
metricTags:
50+
key1: value0
51+
key2: value1
52+
4553
# The settings of the source table
4654
sourceSettings:
4755

@@ -55,12 +63,21 @@ spec:
5563
# The root location of the Microsoft Synapse export
5664
baseLocation: abfss://container@storage-account.dfs.core.windows.net/
5765

58-
# The maximum number of retries for the HTTP client
59-
httpClientMaxRetries: 10
66+
# The maximum number of retries for the HTTP client
67+
httpClientMaxRetries: 10
68+
69+
# Minimum delay between blob client call retries
70+
httpClientMinRetryDelaySeconds: 0.1
71+
72+
# Maximum delay between blob client call retries
73+
httpClientMaxRetryDelaySeconds: 1
74+
75+
# Retry timeout for blob storage operations
76+
httpRetryTimeoutSeconds: 60
77+
78+
# Maximum number of objects per page in paginated responses
79+
maxResultsPerPage: 5000
6080

61-
# Delay in seconds between the retries
62-
httpClientRetryDelaySeconds: 5
63-
6481
# The staging data settings
6582
stagingDataSettings:
6683

src/main/scala/models/app/contracts/StreamSpec.scala

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,12 @@ package models.app.contracts
44
import com.sneaksanddata.arcane.framework.models.settings.{TableFormat, TablePropertiesSettings as TableProperties}
55
import upickle.default.*
66

7+
/** Additional logging and metrics configurations
8+
*/
9+
case class ObservabilitySettings(
10+
metricTags: Map[String, String]
11+
) derives ReadWriter
12+
713
/** The configuration of Iceberg catalog
814
*/
915
case class CatalogSettings(
@@ -55,7 +61,16 @@ case class SinkSettings(
5561

5662
/** The configuration of the stream source.
5763
*/
58-
case class SourceSettings(name: String, baseLocation: String, changeCaptureIntervalSeconds: Int) derives ReadWriter
64+
case class SourceSettings(
65+
name: String,
66+
baseLocation: String,
67+
changeCaptureIntervalSeconds: Int,
68+
httpClientMaxRetries: Int,
69+
httpClientMinRetryDelaySeconds: Double,
70+
httpClientMaxRetryDelaySeconds: Double,
71+
httpRetryTimeoutSeconds: Int,
72+
maxResultsPerPage: Int
73+
) derives ReadWriter
5974

6075
case class TablePropertiesSettings(
6176
partitionExpressions: Array[String],
@@ -83,6 +98,7 @@ case class FieldSelectionRuleSpec(ruleType: String, fields: Array[String]) deriv
8398
* The grouping interval in seconds
8499
*/
85100
case class StreamSpec(
101+
observabilitySettings: ObservabilitySettings,
86102
sourceSettings: SourceSettings,
87103

88104
// Grouping settings

src/test/scala/integration/StreamRunner.scala

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,10 +67,21 @@ object StreamRunner extends ZIOSpecDefault:
6767
| "catalogUri": "http://localhost:20001/catalog"
6868
| }
6969
| },
70+
| "observabilitySettings": {
71+
| "metricTags": {
72+
| "key1": "value0",
73+
| "key2": "value1"
74+
| }
75+
| },
7076
| "sourceSettings": {
7177
| "baseLocation": "abfss://cdm-e2e@devstoreaccount1.dfs.core.windows.net/",
7278
| "changeCaptureIntervalSeconds": 300,
73-
| "name": "dimensionattributelevelvalue"
79+
| "name": "dimensionattributelevelvalue",
80+
| "httpClientMaxRetries": 3,
81+
| "httpClientMinRetryDelaySeconds": 0.1,
82+
| "httpClientMaxRetryDelaySeconds": 1,
83+
| "httpRetryTimeoutSeconds": 60,
84+
| "maxResultsPerPage": 5000
7485
| },
7586
| "stagingDataSettings": {
7687
| "catalog": {

0 commit comments

Comments
 (0)