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

Attempt to filter out duplicates #1166

Merged
merged 1 commit into from
Feb 15, 2021
Merged

Attempt to filter out duplicates #1166

merged 1 commit into from
Feb 15, 2021

Conversation

paroxp
Copy link
Member

@paroxp paroxp commented Feb 12, 2021

What

Some of the metrics are duplicated at the prometheus level... We can add
some group by closures, to make sure we're finding unique information,
where we need to.

How to review

  • Take te queries and run through grafana
  • Sanity check

Some of the metrics are duplicated at the prometheus level... We can add
some `group by` closures, to make sure we're finding unique information,
where we need to.
@AP-Hunt
Copy link
Member

AP-Hunt commented Feb 12, 2021

I compared the number of series (pre-sum) with and without the group by for cf_service_instance_info metric in Ireland: 485 vs 241. Seems like a good optimisation.

I'm not quite sure how to check the organization metrics. Can you clarify that, please?

@paroxp
Copy link
Member Author

paroxp commented Feb 12, 2021

Sure, if you check the performance page in london now, there are ~280 orgs on record.

  sum by (type) (group by (organization_name,type) (label_replace(
    label_replace(
      cf_organization_info{organization_name!~"(AIVENBACC|BACC|ACC|ASATS|SMOKE).*"},
      "type", "billable", "quota_name", "(gds-non-chargeable|small|medium|large|xlarge|2xlarge|4xlarge|8xlarge)"
    ),
    "type", "trial", "quota_name", "default"
  )))

The above, groups the orgs by organization_name name. But when you do only org name, the type is not being returned. So I group by both. The above results in 139 orgs total. 67 trial and 72 billable.

If you run the previous query

  sum by (type) (label_replace(
    label_replace(
      cf_organization_info{organization_name!~"(AIVENBACC|BACC|ACC|ASATS|SMOKE).*"},
      "type", "billable", "quota_name", "(gds-non-chargeable|small|medium|large|xlarge|2xlarge|4xlarge|8xlarge)"
    ),
    "type", "trial", "quota_name", "default"
  ))

you will see basically the double numbers.

Now, if you're asking about the weird structure of the query...

I use two label_replace functions, to create a dividing line between trial orgs and the billable ones. So, if an org is one of: gds-non-chargeable|small|medium|large|xlarge|2xlarge|4xlarge|8xlarge is set to billable, and then any with default is simply a trial... I don't like the way it's done, as it will need to be updated if and when we change quotas... But seems to be the only way at the moment...

Another weirdness here is: organization_name!~"(AIVENBACC|BACC|ACC|ASATS|SMOKE).*" which essentially filters out orgs where the name starts with any of AIVENBACC|BACC|ACC|ASATS|SMOKE so that we don't over count our tests.

Let me know if that's not ... somehow ... easier xD

Copy link
Member

@AP-Hunt AP-Hunt left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, Rafal. That makes sense.

@paroxp paroxp merged commit da431d9 into main Feb 15, 2021
@paroxp paroxp deleted the performance branch February 15, 2021 11:53
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.

2 participants