Failed to resolve queue webhook.log_hook

I’m trying to publish messages via a webhook. Here’s the code in init.lua:

local log_hooks = require 'policy-extras.log_hooks'

-- other imports and functions...

log_hooks:new_json {
  name = "webhook",
  -- log_parameters are combined with the name and
  -- passed through to kumo.configure_log_hook
  log_parameters = {
    headers = { 'Subject', 'X-TENANT', 'X-CUSTOMER-ID' },
  },
  -- queue config are passed to kumo.make_queue_config.
  -- You can use these to override the retry parameters
  -- if you wish.
  -- The defaults are shown below.
  queue_config = {
    retry_interval = "1m",
    max_retry_interval = "20m",
  },
  -- The URL to POST the JSON to
  url = "http://192.168.0.100:4242/log",
}

I can successfully inject messages via the HTTP API, getting this response:

{"success_count":1,"fail_count":0,"failed_recipients":[],"errors":[]}

but I’m not receiving the webhook call and see this error in the logs:

{"type":"TransientFailure","id":"f84ac11192bd11ee8c4b080027be1609","sender":"noreply@example.com","recipient":"recipient@example.com","queue":"webhook.log_hook","site":"","size":680,"response":{"code":451,"enhanced_code":{"class":4,"subject":4,"detail":4},"content":"failed to resolve queue webhook.log_hook: MX lookup for webhook.log_hook failed: NXDOMAIN","command":null},"peer_address":null,"timestamp":1701705910,"created":1701705510,"num_attempts":0,"bounce_classification":"RoutingErrors","egress_pool":null,"egress_source":null,"feedback_report":null,"meta":{},"headers":{},"delivery_protocol":null,"reception_protocol":"LogRecord","nodeid":"6c48c1dc-5f6a-487c-ab67-c3e6f426d6a6"}

Can you put your log_hooks:new_json call ahead of the more general queue helper?

assuming that you are using that

the underlying get_queue_config events can be registered multiple times, and they are called in the order of registration. You should have webhooks (and tsa hooks) fire before the queue helper or your own get_queue_config event handler

Thanks, placing the log_hooks:new_json call before shaping:setup_with_automation seems to fix this issue.