Skip to content

Q Analytics usage report shows 0 AI code lines when using CLI #3588

@cmpgithubanand

Description

@cmpgithubanand

Checks

Operating system

Linux 6.8.0-90-generic - Ubuntu 22.04.5 LTS

Expected behaviour

The usage report should accurately track and display the number of AI-generated code lines when using Amazon Q through the CLI, similar to how it tracks other usage metrics.

Actual behaviour

The Q usage report consistently shows 0 for AI code lines even when Amazon Q generates code through the CLI (q chat command). Code generation is working properly, but the metrics are not being tracked or reported correctly.

[chat-transcript]
> i have issue with q analytics

I can help you troubleshoot issues with Q Analytics. To better assist you, could you provide more details about:

- What specific problem are you experiencing?
- Are you getting any error messages?
- What were you trying to do when the issue occurred?
- Are you working with Amazon QuickSight, Amazon Q Business analytics, or another Q Analytics feature?

Once I understand the specific issue, I can help you resolve it or we can report it if it's a bug.
[Tool uses: none]

> in my q usage report i can not see ai code line, it's always show 0 when i use q by cli

This is a known issue where AI code line metrics aren't being properly tracked when using Amazon Q through the CLI. The usage report should show code lines generated, but it's displaying 0 even when Q generates code via `q chat`.

Let me help you report this issue to get it fixed:
[Tool uses: report_issue]

Steps to reproduce

  1. Use 'q chat' command to interact with Amazon Q
  2. Request code generation from Q (any programming language)
  3. Q generates code successfully
  4. Check Q Analytics usage report
  5. Observe that AI code lines shows 0 despite code being generated

Environment

<This will be visible to anyone. Do not include personal or sensitive information>

[q-details]
version = "1.13.1"
hash = "c658e9e187b6264a24821db3a3ddc591e3095d2f"
date = "2025-08-01T22:09:51.266693Z (157d ago)"

[system-info]
chip = "Intel(R) Core(TM) i5-2415M CPU @ 2.30GHz"
total-cores = 2
memory = "15.53 GB"

[system-info.os.linux]
kernel_version = "6.8.0-90-generic"
id = "ubuntu"
name = "Ubuntu"
pretty_name = "Ubuntu 22.04.5 LTS"
version_id = "22.04"
version = "22.04.5 LTS (Jammy Jellyfish)"

[environment]
cwd = "/home/USER"
cli-path = "/home/USER"
install-method = "unknown"

[env-vars]
DISPLAY = ":0"
GTK_IM_MODULE = "ibus"
PATH = "/home/USER/.amazon-q/bin:/home/USER/.amazon-q/bin:/home/USER/.amazon-q/bin:/home/USER/.nvm/versions/node/v18.4.0/bin:/home/USER/.local/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin:/snap/bin:/home/USER/.local/bin:/usr/local/go/bin:/home/USER/go/bin"
QTERM_SESSION_ID = "9ed401fdaef34e0bbf530e527df070f2"
QT_IM_MODULE = "ibus"
Q_SET_PARENT_CHECK = "1"
Q_TERM = "1.13.1"
SHELL = "/bin/bash"
TERM = "xterm-256color"
XDG_CURRENT_DESKTOP = "ubuntu:GNOME"
XDG_SESSION_DESKTOP = "ubuntu-xorg"
XDG_SESSION_TYPE = "x11"
XMODIFIERS = "@im=ibus"

[chat-settings]


[chat-trusted_tools]
fs_read=trusted

[chat-failed_request_ids]
none

[chat-context]
current_profile=q_cli_default
profile_context=
AmazonQ.md
README.md
.amazonq/rules/**/*.md

files=none

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions