Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Number of AWS accounts is wrong on stats view #460

Open
timurista opened this issue Aug 21, 2020 · 0 comments
Open

Number of AWS accounts is wrong on stats view #460

timurista opened this issue Aug 21, 2020 · 0 comments
Assignees

Comments

@timurista
Copy link

timurista commented Aug 21, 2020

Summary

Latest version has a problem when you add multiple AWS accounts.
It shows this
image
We have 3 accounts registered, but it only shows one.

Reproduce steps

Add multiple AWS accounts

Expected Results

3 account should show up

Actual Results

1 shows up

Fix

The problem is the query in the StatsRep (accountname.keyword)

GET _search
{"query":{"bool":{}},"aggs":{"accounts":{"terms":{"field":"accountname.keyword","size":10000}}}}

in ES if you run the query you get this:

...
  "aggregations": {
    "accounts": {
      "doc_count_error_upper_bound": 0,
      "sum_other_doc_count": 0,
      "buckets": [
        {
          "key": "",
          "doc_count": 49867
        }
      ]
    }

However if you change the accountname to accountid (since not all accounts have a name)
you get the following:
Query

GET _search
{"query":{"bool":{}},"aggs":{"accounts":{"terms":{"field":"accountid.keyword","size":10000}}}}

Result:

...
"aggregations": {
    "accounts": {
      "doc_count_error_upper_bound": 0,
      "sum_other_doc_count": 0,
      "buckets": [
        {
          "key": "xxx",
          "doc_count": 61542
        },
        {
          "key": "xxx3",
          "doc_count": 11758
        },
        {
          "key": "xxx4",
          "doc_count": 1860
        }
      ]
    }
  }

So this file: StatisticsRepositoryImpl.java needs to call accountid. See the associated PR

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

No branches or pull requests

2 participants