Skip to content

Commit 34eab3f

Browse files
authored
feat: Add open telemetry metrics and traces (#3404)
## Relevant issue(s) Resolves #293 Resolves #74 ## Description This PR adds OpenTelemetry metrics and tracing. Telemetry is only enabled if the `telemetry` build flag is set. Our default telemetry configuration uses the `http` exporter, but we can expand it to `grpc` and `console` if needed. The exporters are configured through the standardized OpenTelemetry environment variables found here: https://pkg.go.dev/go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetrichttp https://pkg.go.dev/go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp ## Tasks - [x] I made sure the code is well commented, particularly hard-to-understand areas. - [x] I made sure the repository-held documentation is changed accordingly. - [x] I made sure the pull request title adheres to the conventional commit style (the subset used in the project can be found in [tools/configs/chglog/config.yml](tools/configs/chglog/config.yml)). - [x] I made sure to discuss its limitations such as threats to validity, vulnerability to mistake and misuse, robustness to invalidation of assumptions, resource requirements, ... ## How has this been tested? Manually testing with Jaeger ``` docker run --rm --name jaeger \ -p 16686:16686 \ -p 4317:4317 \ -p 4318:4318 \ -p 5778:5778 \ -p 9411:9411 \ jaegertracing/jaeger:2.2.0 ``` ``` DEFRA_KEYRING_SECRET=secret \ OTEL_EXPORTER_OTLP_ENDPOINT=http://localhost:4318 \ go run -tags telemetry ./cmd/defradb start ``` > Trace dashboard ![Jaeger UI](https://github.com/user-attachments/assets/edefc26f-1252-44c9-bae7-54cff63e4b56) > Detailed trace example ![_ 3240f64_ GetCollections _DefraDB_ _ Jaeger UI](https://github.com/user-attachments/assets/704c2108-d90f-43b5-b11b-a677d9592b82) > Nested trace example ![_ b146bd9_ ExecRequest _DefraDB_ _ Jaeger UI](https://github.com/user-attachments/assets/dd64d339-d9b5-4588-9c4b-aa691a884a93) Specify the platform(s) on which this was tested: - MacOS
1 parent d6b003b commit 34eab3f

32 files changed

+478
-387
lines changed

.github/workflows/test-coverage.yml

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -236,6 +236,27 @@ jobs:
236236
coverage-artifact-name: "coverage_encryption"
237237
coverage-path: coverage.txt
238238

239+
# This job runs the database with telemetry tests using default configuration, on linux.
240+
test-telemetry:
241+
name: Test telemetry job
242+
243+
runs-on: ubuntu-latest
244+
245+
env:
246+
GOFLAGS: -tags=telemetry
247+
248+
steps:
249+
- name: Checkout code into the directory
250+
uses: actions/checkout@v4
251+
252+
- name: Setup defradb
253+
uses: ./.github/composites/setup-defradb
254+
255+
- name: Test coverage & save coverage report in an artifact
256+
uses: ./.github/composites/test-coverage-with-artifact
257+
with:
258+
coverage-artifact-name: "coverage_telemetry"
259+
coverage-path: coverage.txt
239260

240261
## This job gathers all the coverage reports and uploads them to code-cov
241262
upload-coverage:
@@ -248,6 +269,7 @@ jobs:
248269
- test-lens # 2 test(s)
249270
- test-view # 1 test(s)
250271
- test-encryption # 1 test(s)
272+
- test-telemetry # 1 test(s)
251273

252274
# Important to know:
253275
# - We didn't use `if: always()` here, so this job doesn't run if we manually canceled.

README.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@ Read the documentation on [docs.source.network](https://docs.source.network/).
3434
* [Access Control System](#access-control-system)
3535
* [Supporting CORS](#supporting-cors)
3636
* [Backing up and restoring](#backing-up-and-restoring)
37+
* [Telemetry](#telemetry)
3738
* [Community](#community)
3839
* [Licensing](#licensing)
3940
* [Contributors](#contributors)
@@ -473,6 +474,14 @@ To restore the data, run the following command:
473474
defradb client backup import path/to/backup.json
474475
```
475476

477+
## Telemetry
478+
479+
DefraDB has no telemetry reporting by default. To enable OpenTelemetry in DefraDB you must build with the `telemetry` tag set. To configure the HTTP exporters use the environment variables in the links below.
480+
481+
[Metric exporter documentation](https://pkg.go.dev/go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetrichttp)
482+
483+
[Trace exporter documentation](https://pkg.go.dev/go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp)
484+
476485
## Community
477486

478487
Discuss on [Discord](https://discord.gg/w7jYQVJ) or [Github Discussions](https://github.com/sourcenetwork/defradb/discussions). The Source project is on [Twitter](https://twitter.com/sourcenetwrk).

cli/config.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,7 @@ var configFlags = map[string]string{
6868
"source-hub-address": "acp.sourceHub.address",
6969
"development": "development",
7070
"secret-file": "secretfile",
71+
"no-telemetry": "telemetry.disabled",
7172
}
7273

7374
// configDefaults contains default values for config entries.
@@ -96,6 +97,7 @@ var configDefaults = map[string]any{
9697
"log.source": false,
9798
"log.stacktrace": false,
9899
"secretfile": ".env",
100+
"telemetry.disabled": false,
99101
}
100102

101103
// defaultConfig returns a new config with default values.

cli/config_test.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,4 +70,5 @@ func TestLoadConfigNotExist(t *testing.T) {
7070
assert.Equal(t, "file", cfg.GetString("keyring.backend"))
7171

7272
assert.Equal(t, false, cfg.GetBool("development"))
73+
assert.Equal(t, false, cfg.GetBool("telemetry.disabled"))
7374
}

cli/start.go

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,9 +26,11 @@ import (
2626
"github.com/sourcenetwork/defradb/event"
2727
"github.com/sourcenetwork/defradb/http"
2828
"github.com/sourcenetwork/defradb/internal/db"
29+
"github.com/sourcenetwork/defradb/internal/telemetry"
2930
"github.com/sourcenetwork/defradb/keyring"
3031
"github.com/sourcenetwork/defradb/net"
3132
"github.com/sourcenetwork/defradb/node"
33+
"github.com/sourcenetwork/defradb/version"
3234
)
3335

3436
const devModeBanner = `
@@ -149,6 +151,17 @@ func MakeStartCommand() *cobra.Command {
149151
}
150152
}
151153

154+
if !cfg.GetBool("no-telemetry") {
155+
ver, err := version.NewDefraVersion()
156+
if err != nil {
157+
return err
158+
}
159+
err = telemetry.ConfigureTelemetry(cmd.Context(), ver.String())
160+
if err != nil {
161+
log.ErrorContextE(cmd.Context(), "failed to configure telemetry", err)
162+
}
163+
}
164+
152165
signalCh := make(chan os.Signal, 1)
153166
signal.Notify(signalCh, os.Interrupt, syscall.SIGTERM)
154167

@@ -250,6 +263,11 @@ func MakeStartCommand() *cobra.Command {
250263
"no-encryption",
251264
cfg.GetBool(configFlags["no-encryption"]),
252265
"Skip generating an encryption key. Encryption at rest will be disabled. WARNING: This cannot be undone.")
266+
cmd.PersistentFlags().Bool(
267+
"no-telemetry",
268+
cfg.GetBool(configFlags["no-telemetry"]),
269+
"Disables telemetry reporting. Telemetry is only enabled in builds that use the telemetry flag.",
270+
)
253271
return cmd
254272
}
255273

docs/config.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -164,3 +164,7 @@ SourceHub ACP requests in order to create protected data.
164164
## `secretfile`
165165

166166
Path to the file containing secrets. Defaults to `.env`.
167+
168+
## `telemetry.disabled`
169+
170+
Disables telemetry reporting. Telemetry is only enabled in builds that use the `telemetry` flag. Defaults to `false`.

docs/website/references/cli/defradb_start.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ defradb start [flags]
2121
--max-txn-retries int Specify the maximum number of retries per transaction (default 5)
2222
--no-encryption Skip generating an encryption key. Encryption at rest will be disabled. WARNING: This cannot be undone.
2323
--no-p2p Disable the peer-to-peer network synchronization system
24+
--no-telemetry Disables telemetry reporting. Telemetry is only enabled in builds that use the telemetry flag.
2425
--p2paddr strings Listen addresses for the p2p network (formatted as a libp2p MultiAddr) (default [/ip4/127.0.0.1/tcp/9171])
2526
--peers stringArray List of peers to connect to
2627
--privkeypath string Path to the private key for tls

go.mod

Lines changed: 12 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -57,8 +57,13 @@ require (
5757
github.com/valyala/fastjson v1.6.4
5858
github.com/vito/go-sse v1.1.2
5959
github.com/zalando/go-keyring v0.2.6
60-
go.opentelemetry.io/otel/metric v1.34.0
60+
go.opentelemetry.io/contrib/instrumentation/runtime v0.59.0
61+
go.opentelemetry.io/otel v1.34.0
62+
go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetrichttp v1.34.0
63+
go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp v1.31.0
64+
go.opentelemetry.io/otel/sdk v1.34.0
6165
go.opentelemetry.io/otel/sdk/metric v1.34.0
66+
go.opentelemetry.io/otel/trace v1.34.0
6267
go.uber.org/zap v1.27.0
6368
golang.org/x/crypto v0.32.0
6469
golang.org/x/exp v0.0.0-20250106191152-7588d65b2ba8
@@ -188,7 +193,7 @@ require (
188193
github.com/gorilla/websocket v1.5.3 // indirect
189194
github.com/grpc-ecosystem/go-grpc-middleware v1.4.0 // indirect
190195
github.com/grpc-ecosystem/grpc-gateway v1.16.0 // indirect
191-
github.com/grpc-ecosystem/grpc-gateway/v2 v2.22.0 // indirect
196+
github.com/grpc-ecosystem/grpc-gateway/v2 v2.25.1 // indirect
192197
github.com/gsterjov/go-libsecret v0.0.0-20161001094733-a6f4afe4910c // indirect
193198
github.com/hashicorp/errwrap v1.1.0 // indirect
194199
github.com/hashicorp/go-cleanhttp v0.5.2 // indirect
@@ -353,9 +358,9 @@ require (
353358
go.opentelemetry.io/auto/sdk v1.1.0 // indirect
354359
go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.49.0 // indirect
355360
go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.56.0 // indirect
356-
go.opentelemetry.io/otel v1.34.0 // indirect
357-
go.opentelemetry.io/otel/sdk v1.34.0 // indirect
358-
go.opentelemetry.io/otel/trace v1.34.0 // indirect
361+
go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.31.0 // indirect
362+
go.opentelemetry.io/otel/metric v1.34.0 // indirect
363+
go.opentelemetry.io/proto/otlp v1.5.0 // indirect
359364
go.uber.org/dig v1.18.0 // indirect
360365
go.uber.org/fx v1.23.0 // indirect
361366
go.uber.org/mock v0.5.0 // indirect
@@ -372,8 +377,8 @@ require (
372377
gonum.org/v1/gonum v0.15.1 // indirect
373378
google.golang.org/api v0.171.0 // indirect
374379
google.golang.org/genproto v0.0.0-20240227224415-6ceb2ff114de // indirect
375-
google.golang.org/genproto/googleapis/api v0.0.0-20241202173237-19429a94021a // indirect
376-
google.golang.org/genproto/googleapis/rpc v0.0.0-20241202173237-19429a94021a // indirect
380+
google.golang.org/genproto/googleapis/api v0.0.0-20250115164207-1a7da9e5054f // indirect
381+
google.golang.org/genproto/googleapis/rpc v0.0.0-20250115164207-1a7da9e5054f // indirect
377382
google.golang.org/protobuf v1.36.4 // indirect
378383
gopkg.in/ini.v1 v1.67.0 // indirect
379384
gopkg.in/yaml.v2 v2.4.0 // indirect

go.sum

Lines changed: 16 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -755,8 +755,8 @@ github.com/grpc-ecosystem/grpc-gateway v1.5.0/go.mod h1:RSKVYQBd5MCa4OVpNdGskqpg
755755
github.com/grpc-ecosystem/grpc-gateway v1.9.5/go.mod h1:vNeuVxBJEsws4ogUvrchl83t/GYV9WGTSLVdBhOQFDY=
756756
github.com/grpc-ecosystem/grpc-gateway v1.16.0 h1:gmcG1KaJ57LophUzW0Hy8NmPhnMZb4M0+kPpLofRdBo=
757757
github.com/grpc-ecosystem/grpc-gateway v1.16.0/go.mod h1:BDjrQk3hbvj6Nolgz8mAMFbcEtjT1g+wF4CSlocrBnw=
758-
github.com/grpc-ecosystem/grpc-gateway/v2 v2.22.0 h1:asbCHRVmodnJTuQ3qamDwqVOIjwqUPTYmYuemVOx+Ys=
759-
github.com/grpc-ecosystem/grpc-gateway/v2 v2.22.0/go.mod h1:ggCgvZ2r7uOoQjOyu2Y1NhHmEPPzzuhWgcza5M1Ji1I=
758+
github.com/grpc-ecosystem/grpc-gateway/v2 v2.25.1 h1:VNqngBF40hVlDloBruUehVYC3ArSgIyScOAyMRqBxRg=
759+
github.com/grpc-ecosystem/grpc-gateway/v2 v2.25.1/go.mod h1:RBRO7fro65R6tjKzYgLAFo0t1QEXY1Dp+i/bvpRiqiQ=
760760
github.com/gsterjov/go-libsecret v0.0.0-20161001094733-a6f4afe4910c h1:6rhixN/i8ZofjG1Y75iExal34USq5p+wiN1tpie8IrU=
761761
github.com/gsterjov/go-libsecret v0.0.0-20161001094733-a6f4afe4910c/go.mod h1:NMPJylDgVpX0MLRlPy15sqSwOFv/U1GZ2m21JhFfek0=
762762
github.com/hashicorp/consul/api v1.3.0/go.mod h1:MmDNSzIMUjNpY/mQ398R4bk2FnqQLoPndWW5VkKPlCE=
@@ -1528,8 +1528,16 @@ go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.4
15281528
go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.49.0/go.mod h1:Mjt1i1INqiaoZOMGR1RIUJN+i3ChKoFRqzrRQhlkbs0=
15291529
go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.56.0 h1:UP6IpuHFkUgOQL9FFQFrZ+5LiwhhYRbi7VZSIx6Nj5s=
15301530
go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.56.0/go.mod h1:qxuZLtbq5QDtdeSHsS7bcf6EH6uO6jUAgk764zd3rhM=
1531+
go.opentelemetry.io/contrib/instrumentation/runtime v0.59.0 h1:rfi2MMujBc4yowE0iHckZX4o4jg6SA67EnFVL8ldVvU=
1532+
go.opentelemetry.io/contrib/instrumentation/runtime v0.59.0/go.mod h1:IO/gfPEcQYpOpPxn1OXFp1DvRY0viP8ONMedXLjjHIU=
15311533
go.opentelemetry.io/otel v1.34.0 h1:zRLXxLCgL1WyKsPVrgbSdMN4c0FMkDAskSTQP+0hdUY=
15321534
go.opentelemetry.io/otel v1.34.0/go.mod h1:OWFPOQ+h4G8xpyjgqo4SxJYdDQ/qmRH+wivy7zzx9oI=
1535+
go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetrichttp v1.34.0 h1:opwv08VbCZ8iecIWs+McMdHRcAXzjAeda3uG2kI/hcA=
1536+
go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetrichttp v1.34.0/go.mod h1:oOP3ABpW7vFHulLpE8aYtNBodrHhMTrvfxUXGvqm7Ac=
1537+
go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.31.0 h1:K0XaT3DwHAcV4nKLzcQvwAgSyisUghWoY20I7huthMk=
1538+
go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.31.0/go.mod h1:B5Ki776z/MBnVha1Nzwp5arlzBbE3+1jk+pGmaP5HME=
1539+
go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp v1.31.0 h1:lUsI2TYsQw2r1IASwoROaCnjdj2cvC2+Jbxvk6nHnWU=
1540+
go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp v1.31.0/go.mod h1:2HpZxxQurfGxJlJDblybejHB6RX6pmExPNe517hREw4=
15331541
go.opentelemetry.io/otel/metric v1.34.0 h1:+eTR3U0MyfWjRDhmFMxe2SsW64QrZ84AOhvqS7Y+PoQ=
15341542
go.opentelemetry.io/otel/metric v1.34.0/go.mod h1:CEDrp0fy2D0MvkXE+dPV7cMi8tWZwX3dmaIhwPOaqHE=
15351543
go.opentelemetry.io/otel/sdk v1.34.0 h1:95zS4k/2GOy069d321O8jWgYsW3MzVV+KuSPKp7Wr1A=
@@ -1539,6 +1547,8 @@ go.opentelemetry.io/otel/sdk/metric v1.34.0/go.mod h1:jQ/r8Ze28zRKoNRdkjCZxfs6Yv
15391547
go.opentelemetry.io/otel/trace v1.34.0 h1:+ouXS2V8Rd4hp4580a8q23bg0azF2nI8cqLYnC8mh/k=
15401548
go.opentelemetry.io/otel/trace v1.34.0/go.mod h1:Svm7lSjQD7kG7KJ/MUHPVXSDGz2OX4h0M2jHBhmSfRE=
15411549
go.opentelemetry.io/proto/otlp v0.7.0/go.mod h1:PqfVotwruBrMGOCsRd/89rSnXhoiJIqeYNgFYFoEGnI=
1550+
go.opentelemetry.io/proto/otlp v1.5.0 h1:xJvq7gMzB31/d406fB8U5CBdyQGw4P399D1aQWU/3i4=
1551+
go.opentelemetry.io/proto/otlp v1.5.0/go.mod h1:keN8WnHxOy8PG0rQZjJJ5A2ebUoafqWp0eVQ4yIXvJ4=
15421552
go.uber.org/atomic v1.3.2/go.mod h1:gD2HeocX3+yG+ygLZcrzQJaqmWj9AIm7n08wl/qW/PE=
15431553
go.uber.org/atomic v1.4.0/go.mod h1:gD2HeocX3+yG+ygLZcrzQJaqmWj9AIm7n08wl/qW/PE=
15441554
go.uber.org/atomic v1.5.0/go.mod h1:sABNBOSYdrvTF6hTgEIbc7YasKWGhgEQZyfxyTvoXHQ=
@@ -2144,10 +2154,10 @@ google.golang.org/genproto v0.0.0-20221014213838-99cd37c6964a/go.mod h1:1vXfmgAz
21442154
google.golang.org/genproto v0.0.0-20221025140454-527a21cfbd71/go.mod h1:9qHF0xnpdSfF6knlcsnpzUu5y+rpwgbvsyGAZPBMg4s=
21452155
google.golang.org/genproto v0.0.0-20240227224415-6ceb2ff114de h1:F6qOa9AZTYJXOUEr4jDysRDLrm4PHePlge4v4TGAlxY=
21462156
google.golang.org/genproto v0.0.0-20240227224415-6ceb2ff114de/go.mod h1:VUhTRKeHn9wwcdrk73nvdC9gF178Tzhmt/qyaFcPLSo=
2147-
google.golang.org/genproto/googleapis/api v0.0.0-20241202173237-19429a94021a h1:OAiGFfOiA0v9MRYsSidp3ubZaBnteRUyn3xB2ZQ5G/E=
2148-
google.golang.org/genproto/googleapis/api v0.0.0-20241202173237-19429a94021a/go.mod h1:jehYqy3+AhJU9ve55aNOaSml7wUXjF9x6z2LcCfpAhY=
2149-
google.golang.org/genproto/googleapis/rpc v0.0.0-20241202173237-19429a94021a h1:hgh8P4EuoxpsuKMXX/To36nOFD7vixReXgn8lPGnt+o=
2150-
google.golang.org/genproto/googleapis/rpc v0.0.0-20241202173237-19429a94021a/go.mod h1:5uTbfoYQed2U9p3KIj2/Zzm02PYhndfdmML0qC3q3FU=
2157+
google.golang.org/genproto/googleapis/api v0.0.0-20250115164207-1a7da9e5054f h1:gap6+3Gk41EItBuyi4XX/bp4oqJ3UwuIMl25yGinuAA=
2158+
google.golang.org/genproto/googleapis/api v0.0.0-20250115164207-1a7da9e5054f/go.mod h1:Ic02D47M+zbarjYYUlK57y316f2MoN0gjAwI3f2S95o=
2159+
google.golang.org/genproto/googleapis/rpc v0.0.0-20250115164207-1a7da9e5054f h1:OxYkA3wjPsZyBylwymxSHa7ViiW1Sml4ToBrncvFehI=
2160+
google.golang.org/genproto/googleapis/rpc v0.0.0-20250115164207-1a7da9e5054f/go.mod h1:+2Yz8+CLJbIfL9z73EW45avw8Lmge3xVElCP9zEKi50=
21512161
google.golang.org/grpc v1.14.0/go.mod h1:yo6s7OP7yaDglbqo1J04qKzAhqBH6lvTonzMVmEdcZw=
21522162
google.golang.org/grpc v1.16.0/go.mod h1:0JHn/cJsOMiMfNA9+DeHDlAU7KAAB5GDlYFpa9MZMio=
21532163
google.golang.org/grpc v1.17.0/go.mod h1:6QZJwpn2B+Zp71q/5VxRsJ6NXXVCE5NRUHRo+f3cWCs=

internal/core/parser.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -36,16 +36,16 @@ type SchemaDefinition struct {
3636
// This includes schema and request parsing, and introspection.
3737
type Parser interface {
3838
// BuildRequestAST builds and return AST for the given request.
39-
BuildRequestAST(request string) (*ast.Document, error)
39+
BuildRequestAST(ctx context.Context, request string) (*ast.Document, error)
4040

4141
// Returns true if the given request ast is an introspection request.
4242
IsIntrospection(*ast.Document) bool
4343

4444
// Executes the given introspection request.
45-
ExecuteIntrospection(request string) *client.RequestResult
45+
ExecuteIntrospection(ctx context.Context, request string) *client.RequestResult
4646

4747
// Parses the given request, returning a strongly typed model of that request.
48-
Parse(*ast.Document, *client.GQLOptions) (*request.Request, []error)
48+
Parse(context.Context, *ast.Document, *client.GQLOptions) (*request.Request, []error)
4949

5050
// NewFilterFromString creates a new filter from a string.
5151
NewFilterFromString(collectionType string, body string) (immutable.Option[request.Filter], error)
@@ -55,7 +55,7 @@ type Parser interface {
5555
// The parsing should validate the syntax, but not validate what that syntax expresses
5656
// is valid or not, i.e. we don't want the parser to make remote calls to verify the
5757
// policy description is valid or not (that is the callers responsiblity).
58-
ParseSDL(sdl string) ([]client.CollectionDefinition, error)
58+
ParseSDL(ctx context.Context, sdl string) ([]client.CollectionDefinition, error)
5959

6060
// Adds the given schema to this parser's model.
6161
//

0 commit comments

Comments
 (0)