商业信号 · EndPoint

业务信号 EndPoint

您的网站已经知道有多少用户,今天注册了谁,有多少文章或个人资料,多少支付成功以及等待审核的内容。将这些数字发送到一个 EndPoint,并在一个仪表板中查看您运行的每个站点——带有异常警报、目标和投资组合基准。这是一个 EndPoint,而不是一个小部件:服务器到服务器,没有个人数据,仅仅是计数。

01

您可以发送的内容

您命名的任何计数器。将其分组到一个类别中,我们将为您绘制图表,分解并监控它。

用户

总用户、按天注册、订阅者、删除

内容

任何类型的材料——文章、视频、个人资料、列表

收入

支付尝试、成功支付、退款——加上派生转化

审核

等待删除的个人资料、报告的项目、审核队列

反馈

联系表单消息、支持票、NPS

其他任何内容

命名一个指标,它就会出现——我们这边无需配置

02

EndPoint

POSThttps://astrina.io/endpoint/ingest推送一批信号。认证:在 X-Astrina-Key 头中使用您的站点密钥。
GEThttps://astrina.io/endpoint/ping心跳——返回待处理的命令而不发送数据。
GEThttps://astrina.io/endpoint/insights提取此站点的计算健康:当前值、增量、目标、警报以及您其他站点的中位数。
POSThttps://astrina.io/endpoint/ack通过其 ID 确认已交付的命令。
03

示例

curl -X POST https://astrina.io/endpoint/ingest \
  -H "X-Astrina-Key: YOUR_SITE_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "signals": [
      { "metric": "users",              "kind": "gauge", "value": 15230, "category": "users" },
      { "metric": "registrations",      "value": 42,     "category": "users" },
      { "metric": "materials", "kind": "gauge", "value": 842, "dim": "article", "category": "content" },
      { "metric": "materials", "kind": "gauge", "value": 301, "dim": "video",   "category": "content" },
      { "metric": "payment_requests",   "value": 18,     "category": "revenue" },
      { "metric": "payment_success",    "value": 11,     "category": "revenue", "unit": "EUR" },
      { "metric": "feedback",           "value": 3,      "category": "feedback" },
      { "metric": "profiles_to_delete", "kind": "gauge", "value": 5, "category": "moderation",
        "good_dir": "down", "attention": true }
    ]
  }'
<?php
// Run this daily (cron) on your own site. Sends only counts — never personal data.
$key = 'YOUR_SITE_KEY';
$payload = ['signals' => [
    ['metric' => 'users',         'kind' => 'gauge', 'value' => usersTotal(),          'category' => 'users'],
    ['metric' => 'registrations', 'value' => registrationsToday(),                     'category' => 'users'],
    ['metric' => 'payment_requests', 'value' => paymentAttemptsToday(),               'category' => 'revenue'],
    ['metric' => 'payment_success',  'value' => paymentsPaidToday(), 'unit' => 'EUR',  'category' => 'revenue'],
    ['metric' => 'feedback',      'value' => feedbackToday(),                          'category' => 'feedback'],
    ['metric' => 'profiles_to_delete', 'kind' => 'gauge', 'value' => deletionQueue(),
        'category' => 'moderation', 'good_dir' => 'down', 'attention' => true],
]];
$ch = curl_init('https://astrina.io/endpoint/ingest');
curl_setopt_array($ch, [
    CURLOPT_POST => true,
    CURLOPT_HTTPHEADER => ['X-Astrina-Key: YOUR_SITE_KEY', 'Content-Type: application/json'],
    CURLOPT_POSTFIELDS => json_encode($payload),
    CURLOPT_RETURNTRANSFER => true,
]);
$resp = json_decode(curl_exec($ch), true);
// Two-way: act on anything Astrina asks for (e.g. a fresh full snapshot).
foreach ($resp['requests'] ?? [] as $cmd) {
    if ($cmd['cmd'] === 'full_snapshot') { /* push your whole history, then: */ }
    // acknowledge so it is not re-sent:
    // curl https://astrina.io/endpoint/ack  -d '{"id": ' . $cmd['id'] . '}'
}
<?php
// One-off: backfill a year of daily registrations so the charts start full.
$signals = [];
foreach (registrationsByDay('-365 days') as $day => $n) {   // 'YYYY-MM-DD' => int
    $signals[] = ['metric' => 'registrations', 'value' => $n, 'day' => $day, 'category' => 'users'];
}
// up to 2000 points per request
foreach (array_chunk($signals, 2000) as $chunk) {
    postJson('https://astrina.io/endpoint/ingest', ['signals' => $chunk], 'YOUR_SITE_KEY');
}
# Pull this site's computed health BACK (current values, 30-day deltas, target
# progress, open alerts, and the median across YOUR OTHER sites) to show it in-app:
curl "https://astrina.io/endpoint/insights" -H "X-Astrina-Key: YOUR_SITE_KEY"

将 YOUR_SITE_KEY 替换为您仪表板上的密钥。每个站点都有自己的密钥;它只会授权推送该站点的数字。

04

信号字段

字段含义
metric必填Any key you choose — users, registrations, materials, payment_success… Stored under this key forever.
value必填The number. For a gauge it is the current total; for a count it is that period's amount.
kind可选"gauge" (a snapshot total, e.g. total users now) or "count" (per-day amount, the default).
day可选YYYY-MM-DD. Defaults to today. Send past days to backfill; re-sending a day overwrites it.
dim可选A breakdown value, e.g. the material type "article"/"video". One series per dimension.
category可选users · content · revenue · moderation · feedback · engagement · custom — groups the metric.
unit可选A short unit shown next to the number, e.g. "EUR", "GB".
good_dir可选"up" (default), "down" (lower is better, e.g. a deletion queue) or "none".
attention可选true pins the metric to the cross-site cockpit as a "needs clearing" number.
event可选true + a count with no day increments today instead of overwriting it.
05

设计为双向

命令返回

每次推送都会返回您在仪表板中排队的任何命令 — 例如“推送完整快照”。您的站点运行这些命令并确认。

洞察返回

调用 /endpoint/insights 以在您的管理面板中显示您自己的实时数字、目标和警报。

投资组合基准

我们返回您其他站点每个指标的中位数,以便一个站点可以显示它与其他站点的比较。

异常监控

我们监控急剧下降、峰值、静默集成和停止转化的支付漏斗 — 并标记它们。

业务信号 EndPoint

此页面回答的问题

  • 业务信号 EndPoint
  • 业务信号 EndPoint 指南
  • 业务信号 EndPoint 解释
  • 业务信号 EndPoint 教程
  • 开始使用 业务信号 EndPoint
  • 业务信号 EndPoint 最佳实践
  • 业务信号 EndPoint 逐步
  • 什么是 业务信号 EndPoint
  • 业务信号 EndPoint 适合初学者
  • 业务信号 EndPoint 清单
  • 业务信号 EndPoint 示例
  • 为什么 业务信号 EndPoint 重要