Compare

3 min read

On this page3 sections
GET /api/v1/sources/{id}/compare

Is the canary worse than the baseline? Two queries on one source, counted over the same window up to now, with a verdict a rollout tool can gate on. It's the Compare page as one call. Requires the logs:read ability.

Query parameters#

Parameter Type Default Notes
baseline string none Required. A query for the version you trust, e.g. -host:canary-*.
canary string none Required. A query for the new version, e.g. host:canary-*.
minutes integer 15 The window, from 1 to 1440 (24 hours), ending now.

A query the parser can't read is a 422 with the parser's message, which names the character where it got lost. URL-encode both queries: -host:canary-* is -host%3Acanary-%2A, or let curl --data-urlencode do it.

Example#

curl -G https://tailcove.dev/api/v1/sources/src_01jbx5q8k7m3n2p4r6s8t0v1w3/compare \
  -H "Authorization: Bearer YOUR_API_TOKEN" \
  --data-urlencode "baseline=-host:canary-*" \
  --data-urlencode "canary=host:canary-*" \
  --data-urlencode "minutes=15"
{
    "data": {
        "verdict": "worse",
        "reason": "The canary logged 1 kind of error the baseline didn't log once in the window. Errors are 5% of 400 lines on the canary against 1% of 1,000 on the baseline, over the limit of 2%.",
        "window": {
            "from": "2026-11-30T11:45:00.000Z",
            "to": "2026-11-30T12:00:00.000Z"
        },
        "baseline": {
            "lines": 1000,
            "errors": 10,
            "errors_per_minute": 0.67,
            "error_share": 0.01
        },
        "canary": {
            "lines": 400,
            "errors": 20,
            "errors_per_minute": 1.33,
            "error_share": 0.05
        },
        "new_patterns": [
            {
                "id": "14385320318112430177",
                "count": 7,
                "example": "Order 4411 has no customer"
            }
        ]
    },
    "meta": {
        "source_id": "src_01jbx5q8k7m3n2p4r6s8t0v1w3",
        "minutes": 15,
        "baseline": "-host:canary-*",
        "canary": "host:canary-*",
        "new_pattern_count": 1,
        "rule": {
            "min_lines": 50,
            "share_factor": 1.5,
            "share_margin": 0.01,
            "min_canary_errors": 5,
            "new_pattern_min_lines": 3
        }
    }
}

Fields#

  • verdict is worse, ok or not_enough_data. The rule, in order: not_enough_data when the baseline has under 50 lines; worse when the canary logged an error pattern 3 times or more that the baseline didn't log at all; not_enough_data when the canary has under 50 lines; worse when the canary's error share is above both 1.5 times the baseline's and the baseline's plus one point, with at least 5 error lines; ok otherwise. The reasoning is on the canary comparison page.
  • reason says the same in words, fit for a pipeline's log.
  • errors counts lines at error, critical, alert and emergency. error_share is errors / lines, a fraction from 0 to 1 (0.05 is 5%). errors_per_minute is over the whole window.
  • new_patterns are the canary's error patterns with no line on the baseline, busiest first, at most 10; meta.new_pattern_count is how many there were. A pattern id is a number written as text, because it can be larger than a JSON number holds safely. example is the first line of it, cut at 300 characters.
  • meta.rule holds the thresholds the verdict used, so a tool can log them next to the answer.

A token from another team, or a source outside your client groups, gets a 404, the same as a source that doesn't exist. The usual rate limits apply.

Still stuck?

Email us and we will help you get it working.

Contact support