Projects STRLCPY graphql-engine Commits 8c538f57
🤬
  • Inject trace context headers into requests to the auth hook. (#458)

    This injects trace context headers into requests to the auth hook,
    allowing us to figure out how much time is spent here.
    
    I added a basic tracing setup to the dev-auth-webhook, using
    `tracing-util`, allowing me to verify that this works. This required
    moving the Dockerfile to the root so the context contains the
    `tracing-util` crate too.
    
    I have also fixed the reference agent (by updating it), and patched our
    Docker Compose files to correctly set up connectivity to Jaeger.
    
    V3_GIT_ORIGIN_REV_ID: 2ff930bda4147d00dcc73268a814b08c8a07a359
  • Loading...
  • Samir Talwar committed with hasura-bot 1 month ago
    8c538f57
    1 parent 50f1243a
Revision indexing in progress... (symbol navigation in revisions will be accurate after indexed)
  • ■ ■ ■ ■ ■
    v3/.dockerignore
    1 1  target
     2 +crates/hasura-authn-webhook/dev-auth-webhook/target
    2 3   
  • ■ ■ ■ ■ ■ ■
    v3/crates/engine/bin/engine/main.rs
    skipped 57 lines
    58 58   let server = ServerOptions::parse();
    59 59   
    60 60   let tracer = tracing_util::start_tracer(
    61  - server.otlp_endpoint.clone(),
     61 + server.otlp_endpoint.as_deref(),
    62 62   "graphql-engine",
    63  - env!("CARGO_PKG_VERSION").to_string(),
     63 + env!("CARGO_PKG_VERSION"),
    64 64   )
    65 65   .unwrap();
    66 66   
    skipped 148 lines
    215 215  async fn graphql_request_tracing_middleware<B: Send>(
    216 216   request: Request<B>,
    217 217   next: Next<B>,
    218  -) -> axum::response::Result<axum::response::Response> {
     218 +) -> axum::response::Response {
    219 219   use tracing_util::*;
    220 220   let tracer = global_tracer();
    221 221   let path = "/graphql";
    222  - 
    223  - Ok(tracer
     222 + tracer
    224 223   .in_span_async_with_parent_context(
    225 224   path,
    226 225   SpanVisibility::User,
    skipped 11 lines
    238 237   },
    239 238   )
    240 239   .await
    241  - .response)
     240 + .response
    242 241  }
    243 242   
    244 243  /// Middleware to start tracing of the `/v1/explain` request.
    skipped 3 lines
    248 247  async fn explain_request_tracing_middleware<B: Send>(
    249 248   request: Request<B>,
    250 249   next: Next<B>,
    251  -) -> axum::response::Result<axum::response::Response> {
     250 +) -> axum::response::Response {
    252 251   let tracer = tracing_util::global_tracer();
    253 252   let path = "/v1/explain";
    254  - 
    255  - Ok(tracer
     253 + tracer
    256 254   .in_span_async_with_parent_context(
    257 255   path,
    258 256   SpanVisibility::User,
    skipped 6 lines
    265 263   },
    266 264   )
    267 265   .await
    268  - .response)
     266 + .response
    269 267  }
    270 268   
    271 269  #[derive(Debug, thiserror::Error)]
    skipped 147 lines
  • ■ ■ ■ ■ ■ ■
    v3/crates/hasura-authn-webhook/dev-auth-webhook/Cargo.lock
    skipped 18 lines
    19 19   
    20 20  [[package]]
    21 21  name = "anyhow"
    22  -version = "1.0.81"
     22 +version = "1.0.82"
     23 +source = "registry+https://github.com/rust-lang/crates.io-index"
     24 +checksum = "f538837af36e6f6a9be0faa67f9a314f8119e4e4b5867c6ab40ed60360142519"
     25 + 
     26 +[[package]]
     27 +name = "async-stream"
     28 +version = "0.3.5"
    23 29  source = "registry+https://github.com/rust-lang/crates.io-index"
    24  -checksum = "0952808a6c2afd1aa8947271f3a60f1a6763c7b912d210184c5149b5cf147247"
     30 +checksum = "cd56dd203fef61ac097dd65721a419ddccb106b2d2b70ba60a6b529f03961a51"
     31 +dependencies = [
     32 + "async-stream-impl",
     33 + "futures-core",
     34 + "pin-project-lite",
     35 +]
     36 + 
     37 +[[package]]
     38 +name = "async-stream-impl"
     39 +version = "0.3.5"
     40 +source = "registry+https://github.com/rust-lang/crates.io-index"
     41 +checksum = "16e62a023e7c117e27523144c5d2459f4397fcc3cab0085af8e2224f643a0193"
     42 +dependencies = [
     43 + "proc-macro2",
     44 + "quote",
     45 + "syn 2.0.58",
     46 +]
    25 47   
    26 48  [[package]]
    27 49  name = "async-trait"
    28  -version = "0.1.77"
     50 +version = "0.1.79"
    29 51  source = "registry+https://github.com/rust-lang/crates.io-index"
    30  -checksum = "c980ee35e870bd1a4d2c8294d4c04d0499e67bca1e4b5cefcc693c2fa00caea9"
     52 +checksum = "a507401cad91ec6a857ed5513a2073c82a9b9048762b885bb98655b306964681"
    31 53  dependencies = [
    32 54   "proc-macro2",
    33 55   "quote",
    34  - "syn",
     56 + "syn 2.0.58",
    35 57  ]
    36 58   
    37 59  [[package]]
    38 60  name = "autocfg"
    39  -version = "1.1.0"
     61 +version = "1.2.0"
    40 62  source = "registry+https://github.com/rust-lang/crates.io-index"
    41  -checksum = "d468802bab17cbc0cc575e9b053f41e72aa36bfa6b7f55e3529ffa43161b97fa"
     63 +checksum = "f1fdabc7756949593fe60f30ec81974b613357de856987752631dea1e3394c80"
    42 64   
    43 65  [[package]]
    44 66  name = "axum"
    skipped 46 lines
    91 113   
    92 114  [[package]]
    93 115  name = "backtrace"
    94  -version = "0.3.69"
     116 +version = "0.3.71"
    95 117  source = "registry+https://github.com/rust-lang/crates.io-index"
    96  -checksum = "2089b7e3f35b9dd2d0ed921ead4f6d318c27680d4a5bd167b3ee120edb105837"
     118 +checksum = "26b05800d2e817c8b3b4b54abd461726265fa9789ae34330622f2db9ee696f9d"
    97 119  dependencies = [
    98 120   "addr2line",
    99 121   "cc",
    skipped 5 lines
    105 127  ]
    106 128   
    107 129  [[package]]
     130 +name = "base64"
     131 +version = "0.21.7"
     132 +source = "registry+https://github.com/rust-lang/crates.io-index"
     133 +checksum = "9d297deb1925b89f2ccc13d7635fa0714f12c87adce1c75356b39ca9b7178567"
     134 + 
     135 +[[package]]
    108 136  name = "bitflags"
    109 137  version = "1.3.2"
    110 138  source = "registry+https://github.com/rust-lang/crates.io-index"
    111 139  checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a"
    112 140   
    113 141  [[package]]
     142 +name = "bumpalo"
     143 +version = "3.16.0"
     144 +source = "registry+https://github.com/rust-lang/crates.io-index"
     145 +checksum = "79296716171880943b8470b5f8d03aa55eb2e645a4874bdbb28adb49162e012c"
     146 + 
     147 +[[package]]
    114 148  name = "bytes"
    115  -version = "1.5.0"
     149 +version = "1.6.0"
    116 150  source = "registry+https://github.com/rust-lang/crates.io-index"
    117  -checksum = "a2bd12c1caf447e69cd4528f47f94d203fd2582878ecb9e9465484c4148a8223"
     151 +checksum = "514de17de45fdb8dc022b1a7975556c53c86f9f0aa5f534b98977b171857c2c9"
    118 152   
    119 153  [[package]]
    120 154  name = "cc"
    121  -version = "1.0.89"
     155 +version = "1.0.92"
    122 156  source = "registry+https://github.com/rust-lang/crates.io-index"
    123  -checksum = "a0ba8f7aaa012f30d5b2861462f6708eccd49c3c39863fe083a308035f63d723"
     157 +checksum = "2678b2e3449475e95b0aa6f9b506a28e61b3dc8996592b983695e8ebb58a8b41"
    124 158   
    125 159  [[package]]
    126 160  name = "cfg-if"
    skipped 2 lines
    129 163  checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd"
    130 164   
    131 165  [[package]]
     166 +name = "convert_case"
     167 +version = "0.4.0"
     168 +source = "registry+https://github.com/rust-lang/crates.io-index"
     169 +checksum = "6245d59a3e82a7fc217c5828a6692dbc6dfb63a0c8c90495621f7b9d79704a0e"
     170 + 
     171 +[[package]]
     172 +name = "crossbeam-channel"
     173 +version = "0.5.12"
     174 +source = "registry+https://github.com/rust-lang/crates.io-index"
     175 +checksum = "ab3db02a9c5b5121e1e42fbdb1aeb65f5e02624cc58c43f2884c6ccac0b82f95"
     176 +dependencies = [
     177 + "crossbeam-utils",
     178 +]
     179 + 
     180 +[[package]]
     181 +name = "crossbeam-utils"
     182 +version = "0.8.19"
     183 +source = "registry+https://github.com/rust-lang/crates.io-index"
     184 +checksum = "248e3bacc7dc6baa3b21e405ee045c3047101a49145e7e9eca583ab4c2ca5345"
     185 + 
     186 +[[package]]
     187 +name = "derive_more"
     188 +version = "0.99.17"
     189 +source = "registry+https://github.com/rust-lang/crates.io-index"
     190 +checksum = "4fb810d30a7c1953f91334de7244731fc3f3c10d7fe163338a35b9f640960321"
     191 +dependencies = [
     192 + "convert_case",
     193 + "proc-macro2",
     194 + "quote",
     195 + "rustc_version",
     196 + "syn 1.0.109",
     197 +]
     198 + 
     199 +[[package]]
     200 +name = "either"
     201 +version = "1.10.0"
     202 +source = "registry+https://github.com/rust-lang/crates.io-index"
     203 +checksum = "11157ac094ffbdde99aa67b23417ebdd801842852b500e395a45a9c0aac03e4a"
     204 + 
     205 +[[package]]
     206 +name = "equivalent"
     207 +version = "1.0.1"
     208 +source = "registry+https://github.com/rust-lang/crates.io-index"
     209 +checksum = "5443807d6dff69373d433ab9ef5378ad8df50ca6298caf15de6e52e24aaf54d5"
     210 + 
     211 +[[package]]
    132 212  name = "fnv"
    133 213  version = "1.0.7"
    134 214  source = "registry+https://github.com/rust-lang/crates.io-index"
    skipped 24 lines
    159 239  checksum = "dfc6580bb841c5a68e9ef15c77ccc837b40a7504914d52e47b8b0e9bbda25a1d"
    160 240   
    161 241  [[package]]
     242 +name = "futures-executor"
     243 +version = "0.3.30"
     244 +source = "registry+https://github.com/rust-lang/crates.io-index"
     245 +checksum = "a576fc72ae164fca6b9db127eaa9a9dda0d61316034f33a0a0d4eda41f02b01d"
     246 +dependencies = [
     247 + "futures-core",
     248 + "futures-task",
     249 + "futures-util",
     250 +]
     251 + 
     252 +[[package]]
     253 +name = "futures-macro"
     254 +version = "0.3.30"
     255 +source = "registry+https://github.com/rust-lang/crates.io-index"
     256 +checksum = "87750cf4b7a4c0625b1529e4c543c2182106e4dedc60a2a6455e00d212c489ac"
     257 +dependencies = [
     258 + "proc-macro2",
     259 + "quote",
     260 + "syn 2.0.58",
     261 +]
     262 + 
     263 +[[package]]
     264 +name = "futures-sink"
     265 +version = "0.3.30"
     266 +source = "registry+https://github.com/rust-lang/crates.io-index"
     267 +checksum = "9fb8e00e87438d937621c1c6269e53f536c14d3fbd6a042bb24879e57d474fb5"
     268 + 
     269 +[[package]]
    162 270  name = "futures-task"
    163 271  version = "0.3.30"
    164 272  source = "registry+https://github.com/rust-lang/crates.io-index"
    skipped 6 lines
    171 279  checksum = "3d6401deb83407ab3da39eba7e33987a73c3df0c82b4bb5813ee871c19c41d48"
    172 280  dependencies = [
    173 281   "futures-core",
     282 + "futures-macro",
     283 + "futures-sink",
    174 284   "futures-task",
    175 285   "pin-project-lite",
    176 286   "pin-utils",
     287 + "slab",
     288 +]
     289 + 
     290 +[[package]]
     291 +name = "getrandom"
     292 +version = "0.2.14"
     293 +source = "registry+https://github.com/rust-lang/crates.io-index"
     294 +checksum = "94b22e06ecb0110981051723910cbf0b5f5e09a2062dd7663334ee79a9d1286c"
     295 +dependencies = [
     296 + "cfg-if",
     297 + "libc",
     298 + "wasi",
    177 299  ]
    178 300   
    179 301  [[package]]
    skipped 3 lines
    183 305  checksum = "4271d37baee1b8c7e4b708028c57d816cf9d2434acb33a549475f78c181f6253"
    184 306   
    185 307  [[package]]
     308 +name = "h2"
     309 +version = "0.3.26"
     310 +source = "registry+https://github.com/rust-lang/crates.io-index"
     311 +checksum = "81fe527a889e1532da5c525686d96d4c2e74cdd345badf8dfef9f6b39dd5f5e8"
     312 +dependencies = [
     313 + "bytes",
     314 + "fnv",
     315 + "futures-core",
     316 + "futures-sink",
     317 + "futures-util",
     318 + "http",
     319 + "indexmap 2.2.6",
     320 + "slab",
     321 + "tokio",
     322 + "tokio-util",
     323 + "tracing",
     324 +]
     325 + 
     326 +[[package]]
     327 +name = "hashbrown"
     328 +version = "0.12.3"
     329 +source = "registry+https://github.com/rust-lang/crates.io-index"
     330 +checksum = "8a9ee70c43aaf417c914396645a0fa852624801b24ebb7ae78fe8272889ac888"
     331 + 
     332 +[[package]]
     333 +name = "hashbrown"
     334 +version = "0.14.3"
     335 +source = "registry+https://github.com/rust-lang/crates.io-index"
     336 +checksum = "290f1a1d9242c78d09ce40a5e87e7554ee637af1351968159f4952f028f75604"
     337 + 
     338 +[[package]]
    186 339  name = "hasura-dev-auth-webhook"
    187 340  version = "0.1.0"
    188 341  dependencies = [
    189 342   "anyhow",
    190 343   "axum",
     344 + "http",
    191 345   "serde_json",
    192 346   "tokio",
     347 + "tracing-util",
    193 348  ]
    194 349   
    195 350  [[package]]
    skipped 46 lines
    242 397   "futures-channel",
    243 398   "futures-core",
    244 399   "futures-util",
     400 + "h2",
    245 401   "http",
    246 402   "http-body",
    247 403   "httparse",
    skipped 8 lines
    256 412  ]
    257 413   
    258 414  [[package]]
     415 +name = "hyper-timeout"
     416 +version = "0.4.1"
     417 +source = "registry+https://github.com/rust-lang/crates.io-index"
     418 +checksum = "bbb958482e8c7be4bc3cf272a766a2b0bf1a6755e7a6ae777f017a31d11b13b1"
     419 +dependencies = [
     420 + "hyper",
     421 + "pin-project-lite",
     422 + "tokio",
     423 + "tokio-io-timeout",
     424 +]
     425 + 
     426 +[[package]]
     427 +name = "indexmap"
     428 +version = "1.9.3"
     429 +source = "registry+https://github.com/rust-lang/crates.io-index"
     430 +checksum = "bd070e393353796e801d209ad339e89596eb4c8d430d18ede6a1cced8fafbd99"
     431 +dependencies = [
     432 + "autocfg",
     433 + "hashbrown 0.12.3",
     434 +]
     435 + 
     436 +[[package]]
     437 +name = "indexmap"
     438 +version = "2.2.6"
     439 +source = "registry+https://github.com/rust-lang/crates.io-index"
     440 +checksum = "168fb715dda47215e360912c096649d23d58bf392ac62f73919e831745e40f26"
     441 +dependencies = [
     442 + "equivalent",
     443 + "hashbrown 0.14.3",
     444 +]
     445 + 
     446 +[[package]]
     447 +name = "itertools"
     448 +version = "0.12.1"
     449 +source = "registry+https://github.com/rust-lang/crates.io-index"
     450 +checksum = "ba291022dbbd398a455acf126c1e341954079855bc60dfdda641363bd6922569"
     451 +dependencies = [
     452 + "either",
     453 +]
     454 + 
     455 +[[package]]
    259 456  name = "itoa"
    260  -version = "1.0.10"
     457 +version = "1.0.11"
     458 +source = "registry+https://github.com/rust-lang/crates.io-index"
     459 +checksum = "49f1f14873335454500d59611f1cf4a4b0f786f9ac11f4312a78e4cf2566695b"
     460 + 
     461 +[[package]]
     462 +name = "js-sys"
     463 +version = "0.3.69"
    261 464  source = "registry+https://github.com/rust-lang/crates.io-index"
    262  -checksum = "b1a46d1a171d865aa5f83f92695765caa047a9b4cbae2cbf37dbd613a793fd4c"
     465 +checksum = "29c15563dc2726973df627357ce0c9ddddbea194836909d655df6a75d2cf296d"
     466 +dependencies = [
     467 + "wasm-bindgen",
     468 +]
    263 469   
    264 470  [[package]]
    265 471  name = "libc"
    skipped 25 lines
    291 497   
    292 498  [[package]]
    293 499  name = "memchr"
    294  -version = "2.7.1"
     500 +version = "2.7.2"
    295 501  source = "registry+https://github.com/rust-lang/crates.io-index"
    296  -checksum = "523dc4f511e55ab87b694dc30d0f820d60906ef06413f93d4d7a1385599cc149"
     502 +checksum = "6c8640c5d730cb13ebd907d8d04b52f55ac9a2eec55b440c8892f40d56c76c1d"
    297 503   
    298 504  [[package]]
    299 505  name = "mime"
    skipped 19 lines
    319 525   "libc",
    320 526   "wasi",
    321 527   "windows-sys 0.48.0",
     528 +]
     529 + 
     530 +[[package]]
     531 +name = "num-traits"
     532 +version = "0.2.18"
     533 +source = "registry+https://github.com/rust-lang/crates.io-index"
     534 +checksum = "da0df0e5185db44f69b44f26786fe401b6c293d1907744beaa7fa62b2e5a517a"
     535 +dependencies = [
     536 + "autocfg",
    322 537  ]
    323 538   
    324 539  [[package]]
    skipped 22 lines
    347 562  checksum = "3fdb12b2476b595f9358c5161aa467c2438859caa136dec86c26fdd2efe17b92"
    348 563   
    349 564  [[package]]
     565 +name = "opentelemetry"
     566 +version = "0.22.0"
     567 +source = "registry+https://github.com/rust-lang/crates.io-index"
     568 +checksum = "900d57987be3f2aeb70d385fff9b27fb74c5723cc9a52d904d4f9c807a0667bf"
     569 +dependencies = [
     570 + "futures-core",
     571 + "futures-sink",
     572 + "js-sys",
     573 + "once_cell",
     574 + "pin-project-lite",
     575 + "thiserror",
     576 + "urlencoding",
     577 +]
     578 + 
     579 +[[package]]
     580 +name = "opentelemetry-contrib"
     581 +version = "0.14.0"
     582 +source = "registry+https://github.com/rust-lang/crates.io-index"
     583 +checksum = "1d4c267ff82b3e9e9f548199267c3f722d9cffe3bfe4318b05fcf56fd5357aad"
     584 +dependencies = [
     585 + "once_cell",
     586 + "opentelemetry",
     587 +]
     588 + 
     589 +[[package]]
     590 +name = "opentelemetry-http"
     591 +version = "0.11.1"
     592 +source = "registry+https://github.com/rust-lang/crates.io-index"
     593 +checksum = "7690dc77bf776713848c4faa6501157469017eaf332baccd4eb1cea928743d94"
     594 +dependencies = [
     595 + "async-trait",
     596 + "bytes",
     597 + "http",
     598 + "opentelemetry",
     599 +]
     600 + 
     601 +[[package]]
     602 +name = "opentelemetry-otlp"
     603 +version = "0.15.0"
     604 +source = "registry+https://github.com/rust-lang/crates.io-index"
     605 +checksum = "1a016b8d9495c639af2145ac22387dcb88e44118e45320d9238fbf4e7889abcb"
     606 +dependencies = [
     607 + "async-trait",
     608 + "futures-core",
     609 + "http",
     610 + "opentelemetry",
     611 + "opentelemetry-proto",
     612 + "opentelemetry-semantic-conventions",
     613 + "opentelemetry_sdk",
     614 + "prost",
     615 + "thiserror",
     616 + "tokio",
     617 + "tonic",
     618 +]
     619 + 
     620 +[[package]]
     621 +name = "opentelemetry-proto"
     622 +version = "0.5.0"
     623 +source = "registry+https://github.com/rust-lang/crates.io-index"
     624 +checksum = "3a8fddc9b68f5b80dae9d6f510b88e02396f006ad48cac349411fbecc80caae4"
     625 +dependencies = [
     626 + "opentelemetry",
     627 + "opentelemetry_sdk",
     628 + "prost",
     629 + "tonic",
     630 +]
     631 + 
     632 +[[package]]
     633 +name = "opentelemetry-semantic-conventions"
     634 +version = "0.14.0"
     635 +source = "registry+https://github.com/rust-lang/crates.io-index"
     636 +checksum = "f9ab5bd6c42fb9349dcf28af2ba9a0667f697f9bdcca045d39f2cec5543e2910"
     637 + 
     638 +[[package]]
     639 +name = "opentelemetry_sdk"
     640 +version = "0.22.1"
     641 +source = "registry+https://github.com/rust-lang/crates.io-index"
     642 +checksum = "9e90c7113be649e31e9a0f8b5ee24ed7a16923b322c3c5ab6367469c049d6b7e"
     643 +dependencies = [
     644 + "async-trait",
     645 + "crossbeam-channel",
     646 + "futures-channel",
     647 + "futures-executor",
     648 + "futures-util",
     649 + "once_cell",
     650 + "opentelemetry",
     651 + "ordered-float",
     652 + "percent-encoding",
     653 + "rand",
     654 + "thiserror",
     655 + "tokio",
     656 + "tokio-stream",
     657 +]
     658 + 
     659 +[[package]]
     660 +name = "ordered-float"
     661 +version = "4.2.0"
     662 +source = "registry+https://github.com/rust-lang/crates.io-index"
     663 +checksum = "a76df7075c7d4d01fdcb46c912dd17fba5b60c78ea480b475f2b6ab6f666584e"
     664 +dependencies = [
     665 + "num-traits",
     666 +]
     667 + 
     668 +[[package]]
    350 669  name = "parking_lot"
    351 670  version = "0.12.1"
    352 671  source = "registry+https://github.com/rust-lang/crates.io-index"
    skipped 39 lines
    392 711  dependencies = [
    393 712   "proc-macro2",
    394 713   "quote",
    395  - "syn",
     714 + "syn 2.0.58",
    396 715  ]
    397 716   
    398 717  [[package]]
    399 718  name = "pin-project-lite"
    400  -version = "0.2.13"
     719 +version = "0.2.14"
    401 720  source = "registry+https://github.com/rust-lang/crates.io-index"
    402  -checksum = "8afb450f006bf6385ca15ef45d71d2288452bc3683ce2e2cacc0d18e4be60b58"
     721 +checksum = "bda66fc9667c18cb2758a2ac84d1167245054bcf85d5d1aaa6923f45801bdd02"
    403 722   
    404 723  [[package]]
    405 724  name = "pin-utils"
    skipped 2 lines
    408 727  checksum = "8b870d8c151b6f2fb93e84a13146138f05d02ed11c7e7c54f8826aaaf7c9f184"
    409 728   
    410 729  [[package]]
     730 +name = "ppv-lite86"
     731 +version = "0.2.17"
     732 +source = "registry+https://github.com/rust-lang/crates.io-index"
     733 +checksum = "5b40af805b3121feab8a3c29f04d8ad262fa8e0561883e7653e024ae4479e6de"
     734 + 
     735 +[[package]]
    411 736  name = "proc-macro2"
    412  -version = "1.0.78"
     737 +version = "1.0.79"
    413 738  source = "registry+https://github.com/rust-lang/crates.io-index"
    414  -checksum = "e2422ad645d89c99f8f3e6b88a9fdeca7fabeac836b1002371c4367c8f984aae"
     739 +checksum = "e835ff2298f5721608eb1a980ecaee1aef2c132bf95ecc026a11b7bf3c01c02e"
    415 740  dependencies = [
    416 741   "unicode-ident",
    417 742  ]
    418 743   
    419 744  [[package]]
     745 +name = "prost"
     746 +version = "0.12.4"
     747 +source = "registry+https://github.com/rust-lang/crates.io-index"
     748 +checksum = "d0f5d036824e4761737860779c906171497f6d55681139d8312388f8fe398922"
     749 +dependencies = [
     750 + "bytes",
     751 + "prost-derive",
     752 +]
     753 + 
     754 +[[package]]
     755 +name = "prost-derive"
     756 +version = "0.12.4"
     757 +source = "registry+https://github.com/rust-lang/crates.io-index"
     758 +checksum = "19de2de2a00075bf566bee3bd4db014b11587e84184d3f7a791bc17f1a8e9e48"
     759 +dependencies = [
     760 + "anyhow",
     761 + "itertools",
     762 + "proc-macro2",
     763 + "quote",
     764 + "syn 2.0.58",
     765 +]
     766 + 
     767 +[[package]]
    420 768  name = "quote"
    421  -version = "1.0.35"
     769 +version = "1.0.36"
    422 770  source = "registry+https://github.com/rust-lang/crates.io-index"
    423  -checksum = "291ec9ab5efd934aaf503a6466c5d5251535d108ee747472c3977cc5acc868ef"
     771 +checksum = "0fa76aaf39101c457836aec0ce2316dbdc3ab723cdda1c6bd4e6ad4208acaca7"
    424 772  dependencies = [
    425 773   "proc-macro2",
    426 774  ]
    427 775   
    428 776  [[package]]
     777 +name = "rand"
     778 +version = "0.8.5"
     779 +source = "registry+https://github.com/rust-lang/crates.io-index"
     780 +checksum = "34af8d1a0e25924bc5b7c43c079c942339d8f0a8b57c39049bef581b46327404"
     781 +dependencies = [
     782 + "libc",
     783 + "rand_chacha",
     784 + "rand_core",
     785 +]
     786 + 
     787 +[[package]]
     788 +name = "rand_chacha"
     789 +version = "0.3.1"
     790 +source = "registry+https://github.com/rust-lang/crates.io-index"
     791 +checksum = "e6c10a63a0fa32252be49d21e7709d4d4baf8d231c2dbce1eaa8141b9b127d88"
     792 +dependencies = [
     793 + "ppv-lite86",
     794 + "rand_core",
     795 +]
     796 + 
     797 +[[package]]
     798 +name = "rand_core"
     799 +version = "0.6.4"
     800 +source = "registry+https://github.com/rust-lang/crates.io-index"
     801 +checksum = "ec0be4795e2f6a28069bec0b5ff3e2ac9bafc99e6a9a7dc3547996c5c816922c"
     802 +dependencies = [
     803 + "getrandom",
     804 +]
     805 + 
     806 +[[package]]
    429 807  name = "redox_syscall"
    430 808  version = "0.4.1"
    431 809  source = "registry+https://github.com/rust-lang/crates.io-index"
    skipped 7 lines
    439 817  version = "0.1.23"
    440 818  source = "registry+https://github.com/rust-lang/crates.io-index"
    441 819  checksum = "d626bb9dae77e28219937af045c257c28bfd3f69333c512553507f5f9798cb76"
     820 + 
     821 +[[package]]
     822 +name = "rustc_version"
     823 +version = "0.4.0"
     824 +source = "registry+https://github.com/rust-lang/crates.io-index"
     825 +checksum = "bfa0f585226d2e68097d4f95d113b15b83a82e819ab25717ec0590d9584ef366"
     826 +dependencies = [
     827 + "semver",
     828 +]
    442 829   
    443 830  [[package]]
    444 831  name = "rustversion"
    445  -version = "1.0.14"
     832 +version = "1.0.15"
    446 833  source = "registry+https://github.com/rust-lang/crates.io-index"
    447  -checksum = "7ffc183a10b4478d04cbbbfc96d0873219d962dd5accaff2ffbd4ceb7df837f4"
     834 +checksum = "80af6f9131f277a45a3fba6ce8e2258037bb0477a67e610d3c1fe046ab31de47"
    448 835   
    449 836  [[package]]
    450 837  name = "ryu"
    skipped 6 lines
    457 844  version = "1.2.0"
    458 845  source = "registry+https://github.com/rust-lang/crates.io-index"
    459 846  checksum = "94143f37725109f92c262ed2cf5e59bce7498c01bcc1502d7b9afe439a4e9f49"
     847 + 
     848 +[[package]]
     849 +name = "semver"
     850 +version = "1.0.22"
     851 +source = "registry+https://github.com/rust-lang/crates.io-index"
     852 +checksum = "92d43fe69e652f3df9bdc2b85b2854a0825b86e4fb76bc44d945137d053639ca"
    460 853   
    461 854  [[package]]
    462 855  name = "serde"
    skipped 12 lines
    475 868  dependencies = [
    476 869   "proc-macro2",
    477 870   "quote",
    478  - "syn",
     871 + "syn 2.0.58",
    479 872  ]
    480 873   
    481 874  [[package]]
    482 875  name = "serde_json"
    483  -version = "1.0.114"
     876 +version = "1.0.115"
    484 877  source = "registry+https://github.com/rust-lang/crates.io-index"
    485  -checksum = "c5f09b1bd632ef549eaa9f60a1f8de742bdbc698e6cee2095fc84dde5f549ae0"
     878 +checksum = "12dc5c46daa8e9fdf4f5e71b6cf9a53f2487da0e86e55808e2d35539666497dd"
    486 879  dependencies = [
    487 880   "itoa",
    488 881   "ryu",
    skipped 2 lines
    491 884   
    492 885  [[package]]
    493 886  name = "serde_path_to_error"
    494  -version = "0.1.15"
     887 +version = "0.1.16"
    495 888  source = "registry+https://github.com/rust-lang/crates.io-index"
    496  -checksum = "ebd154a240de39fdebcf5775d2675c204d7c13cf39a4c697be6493c8e734337c"
     889 +checksum = "af99884400da37c88f5e9146b7f1fd0fbcae8f6eec4e9da38b67d05486f814a6"
    497 890  dependencies = [
    498 891   "itoa",
    499 892   "serde",
    skipped 21 lines
    521 914  ]
    522 915   
    523 916  [[package]]
     917 +name = "slab"
     918 +version = "0.4.9"
     919 +source = "registry+https://github.com/rust-lang/crates.io-index"
     920 +checksum = "8f92a496fb766b417c996b9c5e57daf2f7ad3b0bebe1ccfca4856390e3d3bb67"
     921 +dependencies = [
     922 + "autocfg",
     923 +]
     924 + 
     925 +[[package]]
    524 926  name = "smallvec"
    525  -version = "1.13.1"
     927 +version = "1.13.2"
    526 928  source = "registry+https://github.com/rust-lang/crates.io-index"
    527  -checksum = "e6ecd384b10a64542d77071bd64bd7b231f4ed5940fba55e98c3de13824cf3d7"
     929 +checksum = "3c5e1a9a646d36c3599cd173a41282daf47c44583ad367b8e6837255952e5c67"
    528 930   
    529 931  [[package]]
    530 932  name = "socket2"
    skipped 7 lines
    538 940   
    539 941  [[package]]
    540 942  name = "syn"
    541  -version = "2.0.52"
     943 +version = "1.0.109"
     944 +source = "registry+https://github.com/rust-lang/crates.io-index"
     945 +checksum = "72b64191b275b66ffe2469e8af2c1cfe3bafa67b529ead792a6d0160888b4237"
     946 +dependencies = [
     947 + "proc-macro2",
     948 + "quote",
     949 + "unicode-ident",
     950 +]
     951 + 
     952 +[[package]]
     953 +name = "syn"
     954 +version = "2.0.58"
    542 955  source = "registry+https://github.com/rust-lang/crates.io-index"
    543  -checksum = "b699d15b36d1f02c3e7c69f8ffef53de37aefae075d8488d4ba1a7788d574a07"
     956 +checksum = "44cfb93f38070beee36b3fef7d4f5a16f27751d94b187b666a5cc5e9b0d30687"
    544 957  dependencies = [
    545 958   "proc-macro2",
    546 959   "quote",
    skipped 7 lines
    554 967  checksum = "2047c6ded9c721764247e62cd3b03c09ffc529b2ba5b10ec482ae507a4a70160"
    555 968   
    556 969  [[package]]
     970 +name = "thiserror"
     971 +version = "1.0.58"
     972 +source = "registry+https://github.com/rust-lang/crates.io-index"
     973 +checksum = "03468839009160513471e86a034bb2c5c0e4baae3b43f79ffc55c4a5427b3297"
     974 +dependencies = [
     975 + "thiserror-impl",
     976 +]
     977 + 
     978 +[[package]]
     979 +name = "thiserror-impl"
     980 +version = "1.0.58"
     981 +source = "registry+https://github.com/rust-lang/crates.io-index"
     982 +checksum = "c61f3ba182994efc43764a46c018c347bc492c79f024e705f46567b418f6d4f7"
     983 +dependencies = [
     984 + "proc-macro2",
     985 + "quote",
     986 + "syn 2.0.58",
     987 +]
     988 + 
     989 +[[package]]
    557 990  name = "tokio"
    558  -version = "1.36.0"
     991 +version = "1.37.0"
    559 992  source = "registry+https://github.com/rust-lang/crates.io-index"
    560  -checksum = "61285f6515fa018fb2d1e46eb21223fff441ee8db5d0f1435e8ab4f5cdb80931"
     993 +checksum = "1adbebffeca75fcfd058afa480fb6c0b81e165a0323f9c9d39c9697e37c46787"
    561 994  dependencies = [
    562 995   "backtrace",
    563 996   "bytes",
    skipped 6 lines
    570 1003   "socket2",
    571 1004   "tokio-macros",
    572 1005   "windows-sys 0.48.0",
     1006 +]
     1007 + 
     1008 +[[package]]
     1009 +name = "tokio-io-timeout"
     1010 +version = "1.2.0"
     1011 +source = "registry+https://github.com/rust-lang/crates.io-index"
     1012 +checksum = "30b74022ada614a1b4834de765f9bb43877f910cc8ce4be40e89042c9223a8bf"
     1013 +dependencies = [
     1014 + "pin-project-lite",
     1015 + "tokio",
    573 1016  ]
    574 1017   
    575 1018  [[package]]
    skipped 4 lines
    580 1023  dependencies = [
    581 1024   "proc-macro2",
    582 1025   "quote",
    583  - "syn",
     1026 + "syn 2.0.58",
     1027 +]
     1028 + 
     1029 +[[package]]
     1030 +name = "tokio-stream"
     1031 +version = "0.1.15"
     1032 +source = "registry+https://github.com/rust-lang/crates.io-index"
     1033 +checksum = "267ac89e0bec6e691e5813911606935d77c476ff49024f98abcea3e7b15e37af"
     1034 +dependencies = [
     1035 + "futures-core",
     1036 + "pin-project-lite",
     1037 + "tokio",
     1038 +]
     1039 + 
     1040 +[[package]]
     1041 +name = "tokio-util"
     1042 +version = "0.7.10"
     1043 +source = "registry+https://github.com/rust-lang/crates.io-index"
     1044 +checksum = "5419f34732d9eb6ee4c3578b7989078579b7f039cbbb9ca2c4da015749371e15"
     1045 +dependencies = [
     1046 + "bytes",
     1047 + "futures-core",
     1048 + "futures-sink",
     1049 + "pin-project-lite",
     1050 + "tokio",
     1051 + "tracing",
     1052 +]
     1053 + 
     1054 +[[package]]
     1055 +name = "tonic"
     1056 +version = "0.11.0"
     1057 +source = "registry+https://github.com/rust-lang/crates.io-index"
     1058 +checksum = "76c4eb7a4e9ef9d4763600161f12f5070b92a578e1b634db88a6887844c91a13"
     1059 +dependencies = [
     1060 + "async-stream",
     1061 + "async-trait",
     1062 + "axum",
     1063 + "base64",
     1064 + "bytes",
     1065 + "h2",
     1066 + "http",
     1067 + "http-body",
     1068 + "hyper",
     1069 + "hyper-timeout",
     1070 + "percent-encoding",
     1071 + "pin-project",
     1072 + "prost",
     1073 + "tokio",
     1074 + "tokio-stream",
     1075 + "tower",
     1076 + "tower-layer",
     1077 + "tower-service",
     1078 + "tracing",
    584 1079  ]
    585 1080   
    586 1081  [[package]]
    skipped 4 lines
    591 1086  dependencies = [
    592 1087   "futures-core",
    593 1088   "futures-util",
     1089 + "indexmap 1.9.3",
    594 1090   "pin-project",
    595 1091   "pin-project-lite",
     1092 + "rand",
     1093 + "slab",
    596 1094   "tokio",
     1095 + "tokio-util",
    597 1096   "tower-layer",
    598 1097   "tower-service",
    599 1098   "tracing",
    skipped 19 lines
    619 1118  dependencies = [
    620 1119   "log",
    621 1120   "pin-project-lite",
     1121 + "tracing-attributes",
    622 1122   "tracing-core",
    623 1123  ]
    624 1124   
    625 1125  [[package]]
     1126 +name = "tracing-attributes"
     1127 +version = "0.1.27"
     1128 +source = "registry+https://github.com/rust-lang/crates.io-index"
     1129 +checksum = "34704c8d6ebcbc939824180af020566b01a7c01f80641264eba0999f6c2b6be7"
     1130 +dependencies = [
     1131 + "proc-macro2",
     1132 + "quote",
     1133 + "syn 2.0.58",
     1134 +]
     1135 + 
     1136 +[[package]]
    626 1137  name = "tracing-core"
    627 1138  version = "0.1.32"
    628 1139  source = "registry+https://github.com/rust-lang/crates.io-index"
    skipped 3 lines
    632 1143  ]
    633 1144   
    634 1145  [[package]]
     1146 +name = "tracing-util"
     1147 +version = "0.1.0"
     1148 +dependencies = [
     1149 + "derive_more",
     1150 + "http",
     1151 + "opentelemetry",
     1152 + "opentelemetry-contrib",
     1153 + "opentelemetry-http",
     1154 + "opentelemetry-otlp",
     1155 + "opentelemetry-semantic-conventions",
     1156 + "opentelemetry_sdk",
     1157 +]
     1158 + 
     1159 +[[package]]
    635 1160  name = "try-lock"
    636 1161  version = "0.2.5"
    637 1162  source = "registry+https://github.com/rust-lang/crates.io-index"
    skipped 6 lines
    644 1169  checksum = "3354b9ac3fae1ff6755cb6db53683adb661634f67557942dea4facebec0fee4b"
    645 1170   
    646 1171  [[package]]
     1172 +name = "urlencoding"
     1173 +version = "2.1.3"
     1174 +source = "registry+https://github.com/rust-lang/crates.io-index"
     1175 +checksum = "daf8dba3b7eb870caf1ddeed7bc9d2a049f3cfdfae7cb521b087cc33ae4c49da"
     1176 + 
     1177 +[[package]]
    647 1178  name = "want"
    648 1179  version = "0.3.1"
    649 1180  source = "registry+https://github.com/rust-lang/crates.io-index"
    skipped 7 lines
    657 1188  version = "0.11.0+wasi-snapshot-preview1"
    658 1189  source = "registry+https://github.com/rust-lang/crates.io-index"
    659 1190  checksum = "9c8d87e72b64a3b4db28d11ce29237c246188f4f51057d65a7eab63b7987e423"
     1191 + 
     1192 +[[package]]
     1193 +name = "wasm-bindgen"
     1194 +version = "0.2.92"
     1195 +source = "registry+https://github.com/rust-lang/crates.io-index"
     1196 +checksum = "4be2531df63900aeb2bca0daaaddec08491ee64ceecbee5076636a3b026795a8"
     1197 +dependencies = [
     1198 + "cfg-if",
     1199 + "wasm-bindgen-macro",
     1200 +]
     1201 + 
     1202 +[[package]]
     1203 +name = "wasm-bindgen-backend"
     1204 +version = "0.2.92"
     1205 +source = "registry+https://github.com/rust-lang/crates.io-index"
     1206 +checksum = "614d787b966d3989fa7bb98a654e369c762374fd3213d212cfc0251257e747da"
     1207 +dependencies = [
     1208 + "bumpalo",
     1209 + "log",
     1210 + "once_cell",
     1211 + "proc-macro2",
     1212 + "quote",
     1213 + "syn 2.0.58",
     1214 + "wasm-bindgen-shared",
     1215 +]
     1216 + 
     1217 +[[package]]
     1218 +name = "wasm-bindgen-macro"
     1219 +version = "0.2.92"
     1220 +source = "registry+https://github.com/rust-lang/crates.io-index"
     1221 +checksum = "a1f8823de937b71b9460c0c34e25f3da88250760bec0ebac694b49997550d726"
     1222 +dependencies = [
     1223 + "quote",
     1224 + "wasm-bindgen-macro-support",
     1225 +]
     1226 + 
     1227 +[[package]]
     1228 +name = "wasm-bindgen-macro-support"
     1229 +version = "0.2.92"
     1230 +source = "registry+https://github.com/rust-lang/crates.io-index"
     1231 +checksum = "e94f17b526d0a461a191c78ea52bbce64071ed5c04c9ffe424dcb38f74171bb7"
     1232 +dependencies = [
     1233 + "proc-macro2",
     1234 + "quote",
     1235 + "syn 2.0.58",
     1236 + "wasm-bindgen-backend",
     1237 + "wasm-bindgen-shared",
     1238 +]
     1239 + 
     1240 +[[package]]
     1241 +name = "wasm-bindgen-shared"
     1242 +version = "0.2.92"
     1243 +source = "registry+https://github.com/rust-lang/crates.io-index"
     1244 +checksum = "af190c94f2773fdb3729c55b007a722abb5384da03bc0986df4c289bf5567e96"
    660 1245   
    661 1246  [[package]]
    662 1247  name = "windows-sys"
    skipped 130 lines
  • ■ ■ ■ ■ ■ ■
    v3/crates/hasura-authn-webhook/dev-auth-webhook/Cargo.toml
    1 1  # Exclude this crate from the repo workspace
    2 2  [workspace]
     3 +# this does not use the root properties so it can be built standalone
     4 +package.version = "0.1.0"
     5 +package.edition = "2021"
     6 +package.license = "Apache-2.0"
    3 7   
    4 8  [package]
    5 9  name = "hasura-dev-auth-webhook"
    6  -# this does not use the workspace properties so it can be built standalone
    7  -version = "0.1.0"
    8  -edition = "2021"
    9  -license = "Apache-2.0"
     10 +version.workspace = true
     11 +edition.workspace = true
     12 +license.workspace = true
    10 13   
    11 14  [[bin]]
    12 15  name = "hasura-dev-auth-webhook"
    skipped 1 lines
    14 17  bench = false
    15 18   
    16 19  [dependencies]
     20 +tracing-util = { path = "../../tracing-util" }
     21 + 
    17 22  anyhow = "1.0.80"
    18 23  axum = "0.6.20"
     24 +http = "0.2"
    19 25  serde_json = "1.0.108"
    20 26  tokio = { version = "1.34.0", features = ["full"] }
    21 27   
  • ■ ■ ■ ■ ■ ■
    v3/crates/hasura-authn-webhook/dev-auth-webhook/Dockerfile
    1  -# build
    2  -FROM rust:1.77 AS builder
    3  - 
    4  -WORKDIR /app
    5  -COPY Cargo.toml Cargo.lock .
    6  -COPY src ./src
    7  - 
    8  -RUN cargo build --release
    9  - 
    10  -# copy
    11  -FROM debian:bookworm-slim
    12  - 
    13  -COPY --from=builder /app/target/release/hasura-dev-auth-webhook /usr/bin
    14  - 
    15  -EXPOSE 3050
    16  -ENTRYPOINT ["/usr/bin/hasura-dev-auth-webhook"]
    17  - 
  • ■ ■ ■ ■ ■ ■
    v3/crates/hasura-authn-webhook/dev-auth-webhook/src/main.rs
    skipped 8 lines
    9 9   
    10 10  #[tokio::main]
    11 11  async fn main() -> anyhow::Result<()> {
    12  - let app = Router::new().route("/validate-request", post(validate_request));
     12 + if let Ok(otlp_endpoint) = env::var("OTLP_ENDPOINT") {
     13 + let _ = tracing_util::start_tracer(
     14 + Some(&otlp_endpoint),
     15 + env!("CARGO_PKG_NAME"),
     16 + env!("CARGO_PKG_VERSION"),
     17 + );
     18 + }
     19 + 
     20 + let app = Router::new()
     21 + .route("/validate-request", post(validate_request))
     22 + .layer(axum::middleware::from_fn(
     23 + graphql_request_tracing_middleware,
     24 + ));
    13 25   
    14 26   let host = net::IpAddr::V4(net::Ipv4Addr::UNSPECIFIED);
    15 27   let port = env::var("PORT")
    skipped 43 lines
    59 71   Json(serde_json::to_value(payload.get("headers").unwrap()).unwrap())
    60 72  }
    61 73   
     74 +async fn graphql_request_tracing_middleware<B: Send>(
     75 + request: http::Request<B>,
     76 + next: axum::middleware::Next<B>,
     77 +) -> axum::response::Result<axum::response::Response> {
     78 + use tracing_util::*;
     79 + let traceable = global_tracer()
     80 + .in_span_async_with_parent_context(
     81 + "request",
     82 + SpanVisibility::User,
     83 + &request.headers().clone(),
     84 + || {
     85 + Box::pin(async move {
     86 + let mut response = next.run(request).await;
     87 + TraceContextResponsePropagator::new()
     88 + .inject(&mut HeaderInjector(response.headers_mut()));
     89 + TraceableHttpResponse::new(response, "")
     90 + })
     91 + },
     92 + )
     93 + .await;
     94 + Ok(traceable.response)
     95 +}
     96 + 
  • ■ ■ ■ ■ ■
    v3/crates/hasura-authn-webhook/src/webhook.rs
    skipped 168 lines
    169 169   let tracer = tracing_util::global_tracer();
    170 170   let http_request_builder = match auth_hook_config.method {
    171 171   AuthHookMethod::Get => {
    172  - let mut auth_hook_headers = HeaderMap::new();
     172 + let mut auth_hook_headers = tracing_util::get_trace_headers();
    173 173   for (header_name, header_value) in client_headers.iter() {
    174 174   if !COMMON_CLIENT_HEADERS_TO_IGNORE.contains(header_name.as_str()) {
    175 175   auth_hook_headers.insert(header_name, header_value.clone());
    skipped 23 lines
    199 199   };
    200 200   http_client
    201 201   .post(auth_hook_config.url.clone())
     202 + .headers(tracing_util::get_trace_headers())
    202 203   .json(&request_body)
    203 204   .timeout(Duration::from_secs(60))
    204 205   }
    skipped 541 lines
  • ■ ■ ■ ■ ■ ■
    v3/crates/tracing-util/src/lib.rs
    1 1  mod http;
     2 +mod request;
    2 3  mod setup;
    3 4  mod traceable;
    4 5  mod tracer;
    5 6   
    6 7  // Avoid conflicts with `http` crate
    7 8  pub use crate::http::TraceableHttpResponse;
     9 +pub use request::get_trace_headers;
    8 10  pub use setup::{shutdown_tracer, start_tracer};
    9 11  pub use traceable::{ErrorVisibility, Traceable, TraceableError};
    10 12  pub use tracer::{
    skipped 13 lines
  • ■ ■ ■ ■ ■ ■
    v3/crates/tracing-util/src/request.rs
     1 +//! Functions to provide the appropriate headers when making a HTTP request.
     2 + 
     3 +// Extract the headers required to propagate the trace context across services from the current
     4 +// context.
     5 +pub fn get_trace_headers() -> http::HeaderMap {
     6 + let mut headers_map = http::HeaderMap::new();
     7 + let mut header_injector = opentelemetry_http::HeaderInjector(&mut headers_map);
     8 + opentelemetry::global::get_text_map_propagator(|propagator| {
     9 + propagator.inject(&mut header_injector);
     10 + });
     11 + headers_map
     12 +}
     13 + 
  • ■ ■ ■ ■ ■ ■
    v3/crates/tracing-util/src/setup.rs
    skipped 8 lines
    9 9  use opentelemetry_semantic_conventions as semcov;
    10 10   
    11 11  pub fn start_tracer(
    12  - endpoint: Option<String>,
     12 + endpoint: Option<&str>,
    13 13   service_name: &'static str,
    14  - service_version: String,
     14 + service_version: &'static str,
    15 15  ) -> Result<Tracer, TraceError> {
    16 16   global::set_text_map_propagator(TraceContextPropagator::new());
    17 17   let tracer = opentelemetry_otlp::new_pipeline()
    skipped 1 lines
    19 19   .with_exporter(
    20 20   opentelemetry_otlp::new_exporter()
    21 21   .tonic()
    22  - .with_endpoint(endpoint.unwrap_or(OTEL_EXPORTER_OTLP_ENDPOINT_DEFAULT.into())),
     22 + .with_endpoint(endpoint.unwrap_or(OTEL_EXPORTER_OTLP_ENDPOINT_DEFAULT)),
    23 23   )
    24 24   .with_trace_config(opentelemetry_sdk::trace::config().with_resource(
    25 25   opentelemetry_sdk::Resource::new(vec![
    skipped 12 lines
  • ■ ■ ■ ■ ■ ■
    v3/dev-auth-webhook.Dockerfile
     1 +# build
     2 +FROM rust:1.77 AS builder
     3 + 
     4 +WORKDIR /app
     5 +COPY ./Cargo.toml ./Cargo.toml
     6 +COPY ./crates/tracing-util ./crates/tracing-util
     7 +COPY ./crates/hasura-authn-webhook/dev-auth-webhook ./crates/hasura-authn-webhook/dev-auth-webhook
     8 + 
     9 +WORKDIR /app/crates/hasura-authn-webhook/dev-auth-webhook
     10 +RUN cargo build --release
     11 + 
     12 +# copy
     13 +FROM debian:bookworm-slim
     14 + 
     15 +COPY --from=builder /app/crates/hasura-authn-webhook/dev-auth-webhook/target/release/hasura-dev-auth-webhook /usr/bin
     16 + 
     17 +EXPOSE 3050
     18 +ENTRYPOINT ["/usr/bin/hasura-dev-auth-webhook"]
     19 + 
  • ■ ■ ■ ■ ■
    v3/docker-compose.yaml
    skipped 31 lines
    32 32   retries: 20
    33 33   
    34 34   reference_agent:
    35  - build: https://github.com/hasura/ndc-spec.git#v0.1.0-rc.18
     35 + build: https://github.com/hasura/ndc-spec.git#v0.1.2
    36 36   ports:
    37 37   - 8102:8100
    38 38   
    39 39   auth_hook:
    40  - build: ./crates/hasura-authn-webhook/dev-auth-webhook
     40 + build:
     41 + dockerfile: dev-auth-webhook.Dockerfile
     42 + environment:
     43 + OTLP_ENDPOINT: "http://jaeger:4317"
    41 44   ports:
    42 45   - "3050:3050"
     46 + depends_on:
     47 + jaeger:
     48 + condition: service_started
    43 49   
    44 50   jaeger:
    45 51   image: jaegertracing/all-in-one:1.55
    skipped 20 lines
    66 72   - 8100:8080
    67 73   environment:
    68 74   CONNECTION_URI: "postgresql://postgres:password@postgres"
    69  - OLTP_ENDPOINT: "http://jaeger:4317"
     75 + OTEL_EXPORTER_OTLP_TRACES_ENDPOINT: "http://jaeger:4317"
     76 + OTEL_SERVICE_NAME: "ndc-postgres"
    70 77   volumes:
    71 78   - type: bind
    72 79   source: ./crates/engine/tests/ndc-postgres-configuration
    skipped 2 lines
    75 82   depends_on:
    76 83   postgres:
    77 84   condition: service_healthy
     85 + jaeger:
     86 + condition: service_started
    78 87   
    79 88   custom_connector:
    80 89   build:
    skipped 19 lines
    100 109   environment:
    101 110   - METADATA_PATH
    102 111   - AUTHN_CONFIG_PATH
    103  - - OLTP_ENDPOINT=http://jaeger:4317
     112 + - OTLP_ENDPOINT=http://jaeger:4317
    104 113   ports:
    105 114   # Binding to localhost:3001 avoids conflict with dev_setup
    106 115   - 3001:3000
    skipped 36 lines
Please wait...
Page is in error, reload to recover