Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

update otel api library #91

Merged
merged 4 commits into from
Nov 13, 2024
Merged
Show file tree
Hide file tree
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
2 changes: 1 addition & 1 deletion .github/workflows/ct.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ jobs:
runs-on: ${{ matrix.os }}
strategy:
matrix:
otp_version: ['25']
otp_version: ['25', '26', '27']
rebar3_version: ['3.23']
os: [ubuntu-22.04]
env:
Expand Down
2 changes: 1 addition & 1 deletion docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ version: '3.7'

services:
postgres:
image: cimg/postgres:14.2
image: postgres:17
environment:
- POSTGRES_USER=test
- POSTGRES_DB=test
Expand Down
2 changes: 1 addition & 1 deletion rebar.config
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

{deps, [{backoff, "~> 1.1.6"},
{pg_types, "~> 0.4.0"},
{opentelemetry_api, "~> 1.3.1"}]}.
{opentelemetry_api, "~> 1.4.0"}]}.

{profiles, [{test, [{erl_opts, [nowarn_export_all]},
{deps, [jsone,
Expand Down
14 changes: 3 additions & 11 deletions rebar.lock
Original file line number Diff line number Diff line change
@@ -1,19 +1,11 @@
{"1.2.0",
[{<<"backoff">>,{pkg,<<"backoff">>,<<"1.1.6">>},0},
{<<"opentelemetry_api">>,{pkg,<<"opentelemetry_api">>,<<"1.3.1">>},0},
{<<"opentelemetry_semantic_conventions">>,
{pkg,<<"opentelemetry_semantic_conventions">>,<<"0.2.0">>},
1},
{<<"pg_types">>,{pkg,<<"pg_types">>,<<"0.4.0">>},0}]}.
{<<"opentelemetry_api">>,{pkg,<<"opentelemetry_api">>,<<"1.4.0">>},0}]}.
[
{pkg_hash,[
{<<"backoff">>, <<"83B72ED2108BA1EE8F7D1C22E0B4A00CFE3593A67DBC792799E8CCE9F42F796B">>},
{<<"opentelemetry_api">>, <<"83B4713593F80562D9643C4AB0B6F80F3C5FA4C6D0632C43E11B2CCB6B04DFA7">>},
{<<"opentelemetry_semantic_conventions">>, <<"B67FE459C2938FCAB341CB0951C44860C62347C005ACE1B50F8402576F241435">>},
{<<"pg_types">>, <<"3CE365C92903C5BB59C0D56382D842C8C610C1B6F165E20C4B652C96FA7E9C14">>}]},
{<<"opentelemetry_api">>, <<"63CA1742F92F00059298F478048DFB826F4B20D49534493D6919A0DB39B6DB04">>}]},
{pkg_hash_ext,[
{<<"backoff">>, <<"CF0CFFF8995FB20562F822E5CC47D8CCF664C5ECDC26A684CBE85C225F9D7C39">>},
{<<"opentelemetry_api">>, <<"9E8A5CC38671E3AC61BE48ABE5F6B3AFDBBB50A1DC08B7950C56F169611505C1">>},
{<<"opentelemetry_semantic_conventions">>, <<"D61FA1F5639EE8668D74B527E6806E0503EFC55A42DB7B5F39939D84C07D6895">>},
{<<"pg_types">>, <<"B02EFA785CAECECF9702C681C80A9CA12A39F9161A846CE17B01FB20AEEED7EB">>}]}
{<<"opentelemetry_api">>, <<"3DFBBFAA2C2ED3121C5C483162836C4F9027DEF469C41578AF5EF32589FCFC58">>}]}
].
2 changes: 1 addition & 1 deletion src/pgo_handler.erl
Original file line number Diff line number Diff line change
Expand Up @@ -339,7 +339,7 @@ setup_finish(Conn=#conn{socket_module=SocketModule,
%% set_succeeded_or_within_failed_transaction({error, {error, _} = Error}) ->
%% error:is_in_failed_sql_transaction(Error).

-spec extended_query(#conn{}, iodata(), list(), pgo:decode_aopts(), any(), list()) -> pgo:result().
-spec extended_query(#conn{}, iodata(), list(), pgo:decode_opts(), any(), list()) -> pgo:result().
extended_query(Conn=#conn{socket=Socket,
socket_module=SocketModule,
pool=Pool}, Query, Parameters, DecodeOptions, PerRowFun, Acc0) ->
Expand Down
30 changes: 0 additions & 30 deletions test/certs/privkey.pem

This file was deleted.

94 changes: 19 additions & 75 deletions test/certs/server.crt
Original file line number Diff line number Diff line change
@@ -1,77 +1,21 @@
Certificate:
Data:
Version: 3 (0x2)
Serial Number:
3d:d1:d2:30:e7:90:e5:f4:2d:ab:b9:40:85:8a:b2:f4:48:74:6b:48
Signature Algorithm: sha256WithRSAEncryption
Issuer: CN = localhost
Validity
Not Before: May 23 14:00:36 2019 GMT
Not After : Jun 22 14:00:36 2019 GMT
Subject: CN = localhost
Subject Public Key Info:
Public Key Algorithm: rsaEncryption
RSA Public-Key: (2048 bit)
Modulus:
00:b2:e4:16:2a:8f:ae:34:86:10:48:87:07:aa:32:
6f:b0:e3:c9:87:bc:cf:82:2a:97:49:aa:00:18:6f:
a5:1a:26:d7:96:04:22:f7:d8:8e:6c:24:66:89:09:
8c:e9:03:28:0b:c8:97:4a:1f:3e:76:83:c5:13:a1:
b6:a2:53:0d:71:74:4a:fb:f4:2f:99:b7:5c:ff:43:
2b:9d:dd:3f:93:77:05:2c:7a:7a:5f:78:0f:26:85:
b1:44:7b:ce:41:f4:0e:6c:9e:d9:32:bd:68:f7:2f:
67:58:59:38:62:9a:47:06:97:af:f6:34:3d:f6:3e:
45:23:64:81:bf:fd:76:13:11:7a:86:11:d6:46:ac:
9c:6e:23:56:70:c8:b3:27:87:e9:8f:d5:de:55:e9:
4a:0c:19:78:a0:9e:7d:6c:74:0f:6e:e2:60:36:14:
40:47:54:b4:f7:8a:df:63:95:02:f0:29:52:ad:ea:
ca:39:cd:2d:6b:8d:61:a7:80:aa:49:33:d0:16:ba:
e4:50:df:7d:54:c3:ab:32:f1:11:de:1b:72:19:5a:
72:c8:0b:3a:1d:03:d7:ba:6e:b4:2a:fc:ce:a0:7b:
4a:78:38:9a:11:80:33:71:c1:fd:47:00:f0:c7:dd:
72:e7:94:da:75:8e:02:42:39:c0:31:dc:d3:24:04:
9d:7f
Exponent: 65537 (0x10001)
X509v3 extensions:
X509v3 Subject Key Identifier:
3A:BB:47:90:72:ED:8E:63:37:2F:C8:FA:C3:DF:46:27:C3:FC:8B:0A
X509v3 Authority Key Identifier:
keyid:3A:BB:47:90:72:ED:8E:63:37:2F:C8:FA:C3:DF:46:27:C3:FC:8B:0A

X509v3 Basic Constraints: critical
CA:TRUE
Signature Algorithm: sha256WithRSAEncryption
01:87:cc:b8:1a:ec:cd:f5:5a:b3:63:ab:b3:cd:f2:96:12:44:
da:04:79:6b:9f:ae:14:1c:c7:5f:6f:c1:85:99:66:68:5f:a6:
89:54:0f:36:78:d7:b9:2c:30:68:7d:9c:f6:89:3c:df:33:ba:
c7:46:2e:ca:76:10:73:22:e1:2c:0d:8e:bc:98:b7:95:8c:f2:
67:d9:60:58:ab:c4:b9:07:8c:a1:c0:85:67:10:a6:a0:26:81:
75:c8:9c:e7:45:93:f0:f3:d9:14:f4:23:49:b3:75:39:08:25:
18:56:42:e9:ec:6a:50:d1:da:68:e4:1d:f1:77:84:25:a4:6b:
9e:4f:f7:e6:ca:f7:9c:bf:61:69:19:89:a9:d5:df:df:5d:31:
b6:0e:ac:c7:35:47:0f:f3:7f:75:f9:51:03:88:15:dd:44:13:
ef:1f:e9:3f:58:ae:77:3a:b6:cb:15:cb:54:80:90:73:40:34:
1c:50:ba:c7:c7:43:4d:bf:c1:72:16:03:60:85:72:00:77:3e:
8a:36:3a:18:e2:d6:13:8d:e2:58:80:a7:49:07:05:33:8e:32:
1c:f0:ae:65:a8:58:eb:03:d8:1a:9a:97:91:a2:c8:23:de:42:
3e:5c:01:77:fb:ae:dc:7b:e6:ce:bb:0e:d4:bc:ef:03:97:a1:
74:9f:75:cc
-----BEGIN CERTIFICATE-----
MIIDCTCCAfGgAwIBAgIUPdHSMOeQ5fQtq7lAhYqy9Eh0a0gwDQYJKoZIhvcNAQEL
BQAwFDESMBAGA1UEAwwJbG9jYWxob3N0MB4XDTE5MDUyMzE0MDAzNloXDTE5MDYy
MjE0MDAzNlowFDESMBA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55 changes: 28 additions & 27 deletions test/certs/server.key
Original file line number Diff line number Diff line change
@@ -1,27 +1,28 @@
-----BEGIN RSA PRIVATE KEY-----
MIIEogIBAAKCAQEAsuQWKo+uNIYQSIcHqjJvsOPJh7zPgiqXSaoAGG+lGibXlgQi
99iObCRmiQmM6QMoC8iXSh8+doPFE6G2olMNcXRK+/Qvmbdc/0Mrnd0/k3cFLHp6
X3gPJoWxRHvOQfQObJ7ZMr1o9y9nWFk4YppHBpev9jQ99j5FI2SBv/12ExF6hhHW
RqycbiNWcMizJ4fpj9XeVelKDBl4oJ59bHQPbuJgNhRAR1S094rfY5UC8ClSrerK
Oc0ta41hp4CqSTPQFrrkUN99VMOrMvER3htyGVpyyAs6HQPXum60KvzOoHtKeDia
EYAzccH9RwDwx91y55TadY4CQjnAMdzTJASdfwIDAQABAoIBAECjKV83izpvNnL+
V0an8rN3mtnw3wmpWgDD7EToEj/gyQTrebcUCGIKxQG+8as/+LhJQmEF6QvpkMwH
InaEi9byriVbldd06aVSH/BqgQ5HcxcfKhhUySSiKesU0PIDvTKCMviid8rY1f6W
PklidUdsh6fuOHVBCro/FqLIcmFw1Ch+CYg4S9GqIALdMNexNBWdAwgRLmlF2N0r
p02fzjzepCUDMgomsB2Da87JI7NVJx9OrtScE34cophcKHFMehhdL0TXx7nrZI6U
a37veyggjE1gXWoTdh6UqMBDRylEKzQV7+StadGD07ygtGhnl4kpJ4qhgyXfa/Ny
82FDWAECgYEA6FpC3acwgmikWfSCwVC+47WES+YH/zqONgFvX7qAu5LLh/Ne664u
m7TBLr41irM8LjUBXi1ZOwN3x/lw9hlWD/D7+0ClFANaG74ij0vFNS4lbX+gYKyO
0lv69Vb4HSXd7FxKq31COLSZetSd9XrAmqhKH/mCCgocCAldKfKR9UcCgYEAxRju
QeVYmTjOBE1BO/3a4n4cuMg5Q/WmOI6HoTotJTFmDjBLOMc8/jtP0PfT2oZYGYbc
H48aQmIHaKyw5+7yuufqasVtebtpOxxSCJbjcqGRKtcn9x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SQPvcQPgynLBTa6iSGbVkp1kCXvM
mPyeNqjcWfh4Gay+fnRjDolc4NZoNVCB0aoyaH+wCZQyPIbGnqspm1piDz0jN7Pp
In+OPiiumI/4hRHC5ZqB5NA=
-----END PRIVATE KEY-----
60 changes: 0 additions & 60 deletions test/certs/server.req

This file was deleted.

13 changes: 12 additions & 1 deletion test/pgo_basic_SUITE.erl
Original file line number Diff line number Diff line change
Expand Up @@ -49,10 +49,21 @@ init_per_group(clear, Config) ->
Config;
init_per_group(ssl, Config) ->
application:ensure_all_started(pgo),

{ok, _} = pgo_sup:start_child(default, #{pool_size => 1,
port => 5434,
ssl => true,
ssl_options => [{verify_type, verify_peer},
{cacertfile, "../../../../test/certs/server.crt"},
{verify_fun, {fun (_, valid, U) ->
{valid, U};
(_, valid_peer, U) ->
{valid, U};
(_, {bad_cert, selfsigned_peer}, U) ->
{valid, U};
(_, Reason, _U) ->
{fail, Reason}
end, []}}
],
database => "test",
user => "test",
password => "password"}),
Expand Down
4 changes: 2 additions & 2 deletions test/pgo_geometric_SUITE.erl
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ end_per_suite(_Config) ->

select(_Config) ->
?assertMatch(#{command := select,
rows := [{#{y := 2.0, x := 0.0}}]},
rows := [{#{y := 2.0, x := +0.0}}]},
pgo:query("select '(0,2.0)'::point")).

insert(_Config) ->
Expand All @@ -46,5 +46,5 @@ insert(_Config) ->
?assertMatch(#{command := select,
rows := [{#{x := 1.1, y := 74.9}},
{#{x := 3.2, y := 4.5}},
{#{x := 0.0, y := 5.0}}]},
{#{x := +0.0, y := 5.0}}]},
pgo:query("select a_point from points")).
Loading