Push alerts as interactive cards to a Lark group via the Lark group's custom robot (Webhook). Beginners can finish the setup step by step.

Overview

The Lark Card notification channel pushes alert events from Nightingale to a designated Lark group via the Lark Group Custom Robot (Webhook). Messages are rendered as rich interactive cards — with a colored header, title, separator and body. triggered is red and recovered is green, far more intuitive than plain Markdown messages.

  • Use case: teams using Lark (Larksuite, the international edition of Feishu) want alerts delivered as polished cards, with @ mentions of specific members.
  • Prerequisites: a Lark group, plus permission to “Add Robot” in that group.
  • The whole setup has three steps: ① Add a robot in the Lark group → ② Create a Lark Card notification channel in Nightingale → ③ Fill the token in the notification rule.

Step 1: Add a custom robot in the Lark group

  1. In the target Lark group: Group settings → Bots → Add Bot → Custom Bot.

  2. Set the robot name (e.g. Nightingale Alert) and description, then click “Next”.

  3. Security settings (at least one is required; “Custom Keywords” is recommended — Nightingale currently only supports the two below):

    Type Description Use case
    Custom Keywords Robot only accepts messages containing the specified keyword(s); up to 3 Recommended, simplest. Use a word that always appears in alert titles, such as Alert or n9e
    IP Allowlist Only accept requests from the specified IP range Suitable when deployed behind a fixed public egress

    Lark also offers “Signature Verification”. Nightingale’s default request body does not include timestamp/sign; if you choose signing, you’ll need to fill the complete signed URL in the token field yourself — not recommended for beginners.

  4. Accept the terms and click “Finish”.

  5. Copy the Webhook URL that pops up, in the form of:

    https://open.larksuite.com/open-apis/bot/v2/hook/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx
    

    The string after /hook/ is the Token to fill in Nightingale (in fact a UUID). Save it.

Lark official limit: a single robot can send at most 100 messages per minute and 5 per second; beyond that requests are throttled. For high-volume alerts, split notifications across multiple groups/robots, or set up sensible suppression in the rule.

Step 2: Create a Lark Card notification channel in Nightingale

  1. Sign in to Nightingale → left menu Notify → Notification Channels.

  2. Click Lark Card in the channel-type panel on the left to enter the create page (URL /notification-channels/add?ident=larkcard).

    Channel entry

  3. Most fields are pre-filled. Just change the “Name”:

    Lark Card channel form

    Section Field Change? Notes
    Basic Name Yes e.g. Lark Group Card Robot — what you see when picking the channel in a rule.
    Basic Enable Keep on When off, this channel will not send.
    Variables Contact method Optional Used for @-mentioning; if selected, the user’s Lark open_id/phone/email is injected into the body.
    Variables Parameter config Keep defaults, do not delete Pre-populated with token and bot_name; the actual Token is filled per rule (Step 3).
    HTTP URL Keep default https://open.larksuite.com/open-apis/bot/v2/hook/{{$params.token}}; {{$params.token}} is replaced with the rule’s value.
    HTTP Method POST Lark Webhook only accepts POST.
    HTTP Headers Content-Type: application/json Pre-filled.
  4. Scroll down to “Request body” — this is the heart of the card message; keep the default:

    HTTP config and body

    The default body is the Lark interactive card structure (msg_type: interactive):

    {
      "msg_type": "interactive",
      "card": {
        "config": { "wide_screen_mode": true },
        "header": {
          "title": { "content": "{{$tpl.title}}", "tag": "plain_text" },
          "template": "{{if $event.IsRecovered}}green{{else}}red{{end}}"
        },
        "elements": [
          { "tag": "markdown", "content": "{{$tpl.content}}" }
        ]
      }
    }
    
    • header.title.content comes from the title field of the LarkCard message template — typically 🔔 <rule name>.
    • header.template flips color based on IsRecovered: green for recovered / red for triggered — status visible at a glance.
    • elements[0].content comes from the content field of the LarkCard template — the Markdown body of the card.
  5. Click Save at the bottom-left — a “Lark Card” channel is created.

Note: Nightingale v8 no longer stores the Token on the channel itself. One Lark Card channel can be reused by many groups/robots, each rule filling its own token.

Step 3: Fill token in the notification rule

The UUID after /hook/ in the Lark robot’s Webhook URL is filled in the notification rule:

  1. Left menu Notify → Notification Rules → Add (or edit an existing rule).

  2. In the “Notification config” section:

    Filling Token in the rule

    • Channel: pick the Lark Card channel you just created.
    • Message template: pick LarkCard (built-in; if missing, import the default template under “Message Templates”).
    • Token: paste the Token from Step 1 (only the UUID after /hook/, no URL).
    • Bot Name: optional, e.g. Nightingale, for your own labeling.
    • Severity / time window / labels: filter which events get notified.
  3. After saving, click “Notification test” — your Lark group should immediately receive an alert card.

One Lark Card channel + multiple robots

If you need different rules to push to different groups, don’t create new channels — just add another notification rule and fill a different token.

FAQ

Q1: Error "msg":"Key Words Not Found" / "code":19024 (keyword mismatch)?

A: The Lark robot has “Custom Keywords” enabled but the alert title/content doesn’t contain any keyword. Either include the keyword in the alert rule name, or relax the robot’s keyword (e.g. Alert).

Q2: Error "code":19021 / "msg":"sign match fail" (signature error)?

A: The robot is in “Signature Verification” mode but Nightingale’s default body does not include sign/timestamp. Switch to “Custom Keywords”; if you must use signing, fill the fully signed URL directly in the rule’s token field (https://open.larksuite.com/open-apis/bot/v2/hook/xxx?timestamp=yyy&sign=zzz).

Q3: Cards are always red — recovered events don’t turn green?

A: Card color is controlled by {{if $event.IsRecovered}}green{{else}}red{{end}} in the template. Make sure the alert rule has a recovery condition; for aggregated alerts containing both triggered and recovered events, customize as {{if $event.IsRecovered}}green{{else if ...}}orange{{else}}red{{end}}.

Q4: Throttled by too many messages?

A: Lark official limit per robot is 100/minute, 5/second. Suggestions:

  • Enable suppression / aggregation in alert rules;
  • Split alerts across multiple groups by business line;
  • Send only Critical/Warning alerts to Lark; route Info to async channels like email.

Q5: How do I choose between larkcard and feishucard?

A: They share the same card protocol — only the domain differs:

  • feishucardopen.feishu.cn, Feishu (China);
  • larkcardopen.larksuite.com, Lark (international).

Pick the one that matches the version you actually use; the form fields are identical.

Q6: Can I embed alert screenshots in the card?

A: The group-robot mode does not support screenshots by default. To embed images, use the Lark Application path: register a self-built Lark application → fill app_id/app_secret on the Lark Card channel → Nightingale will call https://open.larksuite.com/open-apis/im/v1/images to upload the image and inject image_key into the card. The flow is the same as Feishu Application, with domain/credentials swapped to Larksuite.

References

快猫星云 联系方式 快猫星云 联系方式
快猫星云 联系方式
快猫星云 联系方式
快猫星云 联系方式
快猫星云