You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
> Downgrade to SDK v1.x If you are using Go v1.21+
20
+
> Downgrade to SDK v1.x If you are using Go v1.21+ or NDC Spec v0.1.
20
21
21
22
## Quick start
22
23
@@ -102,44 +103,10 @@ Flags:
102
103
103
104
Please refer to the [NDC Spec](https://hasura.github.io/ndc-spec/) for details on implementing the Connector interface, or see [examples](./example).
104
105
105
-
## Observability
106
+
## Documentation
106
107
107
-
### OpenTelemetry
108
-
109
-
OpenTelemetry exporter is disabled by default unless one of `--otlp-endpoint`, `--otlp-traces-endpoint` or `--otlp-metrics-endpoint` argument is set. By default, the SDK treats port `4318` as HTTP protocol and gRPC protocol for others.
110
-
111
-
If `--otlp-*insecure` flags are not set, the SDK can also detect TLS connections via http(s).
112
-
113
-
Other configurations are inherited from the [OpenTelemetry Go SDK](https://github.com/open-telemetry/opentelemetry-go). Currently the SDK supports `traces` and `metrics`. See [Environment Variable Specification](https://opentelemetry.io/docs/specs/otel/configuration/sdk-environment-variables/) and [OTLP Exporter Configuration](https://opentelemetry.io/docs/languages/sdk-configuration/otlp-exporter/).
114
-
115
-
### Metrics
116
-
117
-
The SDK supports OTLP and Prometheus metrics exporters that is enabled by `--metrics-exporter` (`OTEL_METRICS_EXPORTER`) flag. Supported values:
118
-
119
-
- `none` (default): disable the exporter
120
-
- `otlp`: OTLP exporter
121
-
- `prometheus`: Prometheus exporter via the `/metrics` endpoint.
122
-
123
-
Prometheus exporter is served in the same HTTP server with the connector. If you want to run it on another port, configure the `--prometheus-port` (`OTEL_EXPORTER_PROMETHEUS_PORT`) flag.
| _(<prefix\>)_\_query_total | Counter | Total number of query requests |
130
-
| _(<prefix\>)_\_query_total_time | Histogram | Total time taken to plan and execute a query |
131
-
| _(<prefix\>)_\_query_explain_total | Counter | Total number of explain query requests |
132
-
| _(<prefix\>)_\_query_explain_total_time | Histogram | Total time taken to plan and execute an explain query request, in seconds |
133
-
| _(<prefix\>)_\_mutation_total | Counter | Total number of mutation requests |
134
-
| _(<prefix\>)_\_query_mutation_total_time | Histogram | Total time taken to plan and execute a mutation request, in seconds |
135
-
| _(<prefix\>)_\_mutation_explain_total | Counter | Total number of explain mutation requests |
136
-
| _(<prefix\>)_\_query_mutation_explain_total_time | Histogram | Total time taken to plan and execute an explain mutation request, in seconds |
137
-
138
-
The prefix is empty by default. You can set the prefix for your connector by `WithMetricsPrefix` option.
139
-
140
-
### Logging
141
-
142
-
NDC Go SDK uses the standard [log/slog](https://pkg.go.dev/log/slog) that provides highly customizable and structured logging. By default, the logger is printed in JSON format and configurable level with `--log-level` (HASURA_LOG_LEVEL) flag. You can also replace it with different logging libraries that can wrap the `slog.Handler` interface, and set the logger with the `WithLogger` or `WithLoggerFunc` option.
108
+
- [Observability](./docs/observability.md)
109
+
- [Migrate from v1 to v2](./docs/migrate-v1-to-v2.md)
0 commit comments