Skip to content

fix: Transparent gRPC errors#184

Merged
devsjc merged 4 commits into
mainfrom
devsjc/transparent-logging
Jul 13, 2026
Merged

fix: Transparent gRPC errors#184
devsjc merged 4 commits into
mainfrom
devsjc/transparent-logging

Conversation

@devsjc

@devsjc devsjc commented Jul 13, 2026

Copy link
Copy Markdown
Contributor

Modifies the returned errors to transparently passthrough errors from the database. This was not done initially as there were thoughts that this might be user facing at one point. Since it is entirely internal, we do not have to worry about leaking implementation details via errors.

Contribution Checklist

  • Have you followed the Open Climate Fix Contribution Guidelines?
  • Have you referenced the Issue this PR addresses, where applicable?
  • Have you checked to ensure there aren't other open Pull Requests for the same change?
  • Have you added a summary of the changes?
  • Have you written new tests for your changes, where applicable?
  • Have you successfully run make lint with your changes locally?
  • Have you successfully run make test with your changes locally?

Warning

PRs may be closed if all the above boxes are not checked.

Closes #178

@github-actions

github-actions Bot commented Jul 13, 2026

Copy link
Copy Markdown

Benchmark Results

Benchmark results
?   	github.com/openclimatefix/data-platform/cmd	[no test files]
?   	github.com/openclimatefix/data-platform/internal/gen/ocf/dp	[no test files]
?   	github.com/openclimatefix/data-platform/internal/interceptors	[no test files]
PASS
ok  	github.com/openclimatefix/data-platform/internal/server/dummy	0.005s
{"level":"debug","time":"2026-07-13T15:09:41Z","message":"Completed migrations"}
goos: linux
goarch: amd64
pkg: github.com/openclimatefix/data-platform/internal/server/postgres
cpu: AMD EPYC 7763 64-Core Processor                
BenchmarkPostgresClient/small/GetForecastAsTimeseries-4         	      48	  23848364 ns/op
BenchmarkPostgresClient/small/GetForecastAtTimestamp-4          	     175	   6678612 ns/op
BenchmarkPostgresClient/small/GetObservationsAsTimeseries-4     	     884	   1286456 ns/op
BenchmarkPostgresClient/small/CreateForecast-4                  	     104	  11226799 ns/op
BenchmarkPostgresClient/small/StreamForecastData-4              	      21	  53573524 ns/op
PASS
ok  	github.com/openclimatefix/data-platform/internal/server/postgres	68.828s
?   	github.com/openclimatefix/data-platform/internal/server/postgres/gen	[no test files]
Benchmark vs base branch
goos: linux
goarch: amd64
pkg: github.com/openclimatefix/data-platform/internal/server/postgres
cpu: AMD EPYC 7763 64-Core Processor                
                                                   │ bench-main.txt │ bench-devsjc-transparent-logging.txt │
                                                   │     sec/op     │    sec/op     vs base                │
PostgresClient/small/GetForecastAsTimeseries-4         24.84m ± ∞ ¹   23.85m ± ∞ ¹       ~ (p=1.000 n=1) ²
PostgresClient/small/GetForecastAtTimestamp-4          6.926m ± ∞ ¹   6.679m ± ∞ ¹       ~ (p=1.000 n=1) ²
PostgresClient/small/GetObservationsAsTimeseries-4     1.295m ± ∞ ¹   1.286m ± ∞ ¹       ~ (p=1.000 n=1) ²
PostgresClient/small/CreateForecast-4                  11.49m ± ∞ ¹   11.23m ± ∞ ¹       ~ (p=1.000 n=1) ²
PostgresClient/small/StreamForecastData-4              54.91m ± ∞ ¹   53.57m ± ∞ ¹       ~ (p=1.000 n=1) ²
geomean                                                10.71m         10.43m        -2.60%
¹ need >= 6 samples for confidence interval at level 0.95
² need >= 4 samples to detect a difference at alpha level 0.05

@devsjc
devsjc merged commit f00400a into main Jul 13, 2026
4 checks passed
@devsjc
devsjc deleted the devsjc/transparent-logging branch July 13, 2026 17:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

More verbose errors

1 participant