FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

script for content data by shagun-singh-inkeep · Pull Request #2387 · inkeep/agents · GitHub

/ agents Public

script for content data - #2387

Draft
shagun-singh-inkeep wants to merge 2 commits into
mainfrom
signoz-script
Draft

script for content data#2387
shagun-singh-inkeep wants to merge 2 commits into
mainfrom
signoz-script

Conversation

Copy link
Copy Markdown
Collaborator

No description provided.

vercel Bot commented Feb 25, 2026
edited
Loading

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
agents-api Ready Preview, Comment Feb 25, 2026 10:41pm
agents-docs Ready Preview, Comment Feb 25, 2026 10:41pm
agents-manage-ui Ready Preview, Comment Feb 25, 2026 10:41pm

changeset-bot Bot commented Feb 25, 2026
edited
Loading

Copy link
Copy Markdown

⚠️ No Changeset found

Latest commit: dc54f69

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

itoqa Bot commented Feb 25, 2026

Copy link
Copy Markdown

Ito Test Report ❌

13 test cases ran. 12 passed, 1 failed.

This test run verified PR #2387, which adds a new standalone CLI analytics script scripts/query-signoz-ai-calls.ts for querying SigNoz AI call telemetry data. The Manage UI was confirmed to have no regressions from the addition of this script. All edge case handling (empty results, timestamp heuristics, non-numeric values, missing data) was verified as properly implemented. Error handling and security practices (no API key leakage) were confirmed. However, one data governance issue was identified: the script hardcodes customer-specific identifiers instead of using CLI arguments like other scripts in the repository.

✅ Passed (12)
Test Case Summary Timestamp Screenshot
ROUTE-1 Manage UI loads successfully with no regressions from the PR. Navigated to Projects, Statistics, and Settings pages - all loaded correctly. 0:20
EDGE-1 Confirmed script reads SIGNOZ_API_KEY from process.env on line 4 with no validation guard. Line 302 uses non-null assertion. 1:57
EDGE-2 Division by runs.length is guarded by ternary checks at lines 409 and 412, preventing NaN/Infinity when result set is empty. 3:28
EDGE-3 weekOf() at line 283 uses threshold > 1e15 to distinguish nanosecond from millisecond timestamps. Heuristic is safe. 3:39
EDGE-4 val() at line 274 uses Number() with Number.isFinite() guard. Non-numeric values are properly filtered. 3:48
EDGE-5 Non-OK responses throw Error with status and body text at line 306. Process exits with code 1 via main().catch(). 4:31
EDGE-6 All 9 sub-queries use limit:10000 with offset:0. No truncation warning or pagination logic exists. 2:16
EDGE-7 Conversations without start timestamps get week='unknown'. The non-null assertion is safe (guarded by .has()). 3:59
ADV-1 Script hardcodes production URL on line 3, while .env.example defines SIGNOZ_URL differently. Inconsistency documented. 2:34
ADV-2 Custom Error only includes response status and body text (safe). No API key leakage in error output. 4:32
ADV-3 Exactly one fetch() call at line 300 with no retry loops. Single-shot execution is appropriate for a manual script. 4:33
ADV-5 Line 302 uses non-null assertion with no validation guard. Missing key would cause runtime error. 2:56
❌ Failed (1)
Test Case Summary Timestamp Screenshot
ADV-4 Hardcoded customer identifiers found: posthog, content-team-project, docs-writer-agent. Other scripts use process.argv for parameterization. 5:25
Verify hardcoded customer identifiers in source code – Failed
  • Where: scripts/query-signoz-ai-calls.ts, lines 10-26 and 294-296

  • Steps to reproduce:

    1. Open scripts/query-signoz-ai-calls.ts
    2. Examine lines 10-26 where scopeFilters is defined
    3. Note the hardcoded customer-specific values
  • What failed: The script hardcodes customer-specific identifiers (tenant.id=posthog, project.id=content-team-project, agent.id=docs-writer-agent) directly in the source code instead of accepting them as CLI arguments. This is inconsistent with other scripts in the repository that use process.argv for parameterization.

  • Code analysis: Examined scripts/query-signoz-ai-calls.ts and found hardcoded customer identifiers in the scopeFilters array. Also checked other scripts in the scripts/ directory and found that setup-dev.js, quick-changeset.mjs, coverage-diff.mjs, and enforce-coverage-change.mjs all use process.argv for CLI argument handling, establishing a pattern that this new script does not follow.

  • Relevant code:

    scripts/query-signoz-ai-calls.ts (lines 10-26)

    const scopeFilters = [
      {
        key: { key: 'tenant.id', dataType: 'string', type: 'tag', isColumn: false },
        op: '=',
        value: 'posthog',
      },
      {
        key: { key: 'project.id', dataType: 'string', type: 'tag', isColumn: false },
        op: '=',
        value: 'content-team-project',
      },
      {
        key: { key: 'agent.id', dataType: 'string', type: 'tag', isColumn: false },
        op: '=',
        value: 'docs-writer-agent',
      },
    ];

    scripts/query-signoz-ai-calls.ts (lines 294-296)

    console.log(`Tenant:  posthog`);
    console.log(`Project: content-team-project`);
    console.log(`Agent:   docs-writer-agent`);

    scripts/coverage-diff.mjs (lines 215, 305) - Example of proper CLI argument handling

    const args = process.argv.slice(2);
    // ...
    if (import.meta.url === `file://${process.argv[1]}`) {
  • Why this is likely a bug: The script commits customer-specific identifiers (posthog, content-team-project, docs-writer-agent) to version control, which is a data governance concern. Other scripts in the same directory use process.argv for parameterization, establishing a clear precedent. This script should accept tenant, project, and agent IDs as CLI arguments rather than hardcoding them.

  • Introduced by this PR: Yes – this PR added the entire scripts/query-signoz-ai-calls.ts file (473 new lines, status: "added")

  • Timestamp: 5:25

📋 View Recording

Screen Recording

This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant


Back | FazBrowse Home | New Git URL