-
Notifications
You must be signed in to change notification settings - Fork 8.3k
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
[APM] Collect total number of service groups #142768
[APM] Collect total number of service groups #142768
Conversation
Pinging @elastic/apm-ui (Team:APM) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM! Thanks for adding tests
@@ -1134,7 +1135,7 @@ export const tasks: TelemetryTask[] = [ | |||
const response = await savedObjectsClient.find<SavedServiceGroup>({ | |||
type: APM_SERVICE_GROUP_SAVED_OBJECT_TYPE, | |||
page: 1, | |||
perPage: 50, | |||
perPage: MAX_NUMBER_OF_SERVICE_GROUPS, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It looks like this is actually retrieving the service groups instead of doing a count. Is that not possible with saved objects?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah.. I see we retrieve the kuery
field. Are we able to reduce the response from ES to just this field then?
(Ideally we'd do a terms agg on kuery
to avoid retrieving duplicates).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Doing a terms agg with a size of 500 will also return more unique results (up to 500 to be exact) since it does not include duplicates.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For the kuery
I think we don't want to avoid duplicates. We want to collect all the possible kuery_fields
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What is the added value of two kuery
strings that are the same? Are you counting the number of times a field is being used?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
One question though, does this collect telemetry for all spaces?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't understand why you don't want to avoid kuery duplicates
In order to see which fields are most often used.
there's really no point in having service groups with the exact same kuery as others
that's right but there might be service groups that use same fields but different kuery.
For example 2 service groups
{
...
"groupName": "production java",
"kuery": "service.environement: 'production' or agent.name:'java' ",
...
},
{
...
"groupName": "stage envs",
"kuery": "service.environement: 'stage' ",
...
},
we'll collect
kuery_fields: ['service.environement', 'service.environement', 'agent.name',]
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@kpatticha Elasticsearch essentially deduplicates non-unique values anyway. I don't think there's a point in storing a single value multiple times.
But more importantly, can you make sure this telemetry is collected for all spaces?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
oh! I wasn't aware about this.
😱 that's good catch.
savedObjectsClient.find
searches in the default space. Let me fix it in a follow up
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
follow up PR - #142856
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks ok. I added a comment but it might be more of an issue with saved objects than anything else.
…icha/kibana into telemetry-total-num-service-groups
💚 Build Succeeded
Metrics [docs]
History
To update your PR or re-run it, just comment with: |
* [APM] Collect the total number of service groups * Add unit tests * Update telemetry mapping * [CI] Auto-commit changed files from 'node scripts/eslint --no-cache --fix' * update snapshots Co-authored-by: kibanamachine <[email protected]>
* [APM] Collect the total number of service groups * Add unit tests * Update telemetry mapping * [CI] Auto-commit changed files from 'node scripts/eslint --no-cache --fix' * update snapshots Co-authored-by: kibanamachine <[email protected]>
Summary
part of #128621
Collects the total number of service groups.
total
field is added in theservice_groups
objectHow to test locally
GET {KIBANA_HOST}/internal/apm/debug-telemetry