[8.x] [Inventory] Removes environment from Service type identity fields (#194451) (#194688)

# Backport

This will backport the following commits from `main` to `8.x`:
- [[Inventory] Removes environment from Service type identity fields
(#194451)](https://github.com/elastic/kibana/pull/194451)

<!--- Backport version: 9.4.3 -->

### Questions ?
Please refer to the [Backport tool
documentation](https://github.com/sqren/backport)

<!--BACKPORT [{"author":{"name":"Cauê
Marcondes","email":"55978943+cauemarcondes@users.noreply.github.com"},"sourceCommit":{"committedDate":"2024-10-02T11:51:40Z","message":"[Inventory]
Removes environment from Service type identity fields (#194451)\n\nWhen
we started working with EEM, we were focusing on the APM UI
pages,\r\nthus we added the service environment as an identifier field.
Now that\r\nwe are moving away from it, we no longer need it listed on
the Service\r\ntype definition.\r\n\r\n<img width=\"1579\"
alt=\"Screenshot 2024-09-30 at 16 29
02\"\r\nsrc=\"https://github.com/user-attachments/assets/1b8f8835-f083-44fc-b7f8-2142c48ed8e3\">","sha":"229b574aefa36370e889e0a080dfe79ff0c651d6","branchLabelMapping":{"^v9.0.0$":"main","^v8.16.0$":"8.x","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["release_note:skip","v9.0.0","backport:prev-minor","v8.16.0"],"title":"[Inventory]
Removes environment from Service type identity
fields","number":194451,"url":"https://github.com/elastic/kibana/pull/194451","mergeCommit":{"message":"[Inventory]
Removes environment from Service type identity fields (#194451)\n\nWhen
we started working with EEM, we were focusing on the APM UI
pages,\r\nthus we added the service environment as an identifier field.
Now that\r\nwe are moving away from it, we no longer need it listed on
the Service\r\ntype definition.\r\n\r\n<img width=\"1579\"
alt=\"Screenshot 2024-09-30 at 16 29
02\"\r\nsrc=\"https://github.com/user-attachments/assets/1b8f8835-f083-44fc-b7f8-2142c48ed8e3\">","sha":"229b574aefa36370e889e0a080dfe79ff0c651d6"}},"sourceBranch":"main","suggestedTargetBranches":["8.x"],"targetPullRequestStates":[{"branch":"main","label":"v9.0.0","branchLabelMappingKey":"^v9.0.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/194451","number":194451,"mergeCommit":{"message":"[Inventory]
Removes environment from Service type identity fields (#194451)\n\nWhen
we started working with EEM, we were focusing on the APM UI
pages,\r\nthus we added the service environment as an identifier field.
Now that\r\nwe are moving away from it, we no longer need it listed on
the Service\r\ntype definition.\r\n\r\n<img width=\"1579\"
alt=\"Screenshot 2024-09-30 at 16 29
02\"\r\nsrc=\"https://github.com/user-attachments/assets/1b8f8835-f083-44fc-b7f8-2142c48ed8e3\">","sha":"229b574aefa36370e889e0a080dfe79ff0c651d6"}},{"branch":"8.x","label":"v8.16.0","branchLabelMappingKey":"^v8.16.0$","isSourceBranch":false,"state":"NOT_CREATED"}]}]
BACKPORT-->

Co-authored-by: Cauê Marcondes <55978943+cauemarcondes@users.noreply.github.com>
This commit is contained in:
Kibana Machine 2024-10-02 23:35:23 +10:00 committed by GitHub
parent c24fee09bc
commit 5c4afedd16
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -20,7 +20,7 @@ const serviceTransactionFilter = (additionalFilters: string[] = []) => {
export const builtInServicesFromLogsEntityDefinition: EntityDefinition =
entityDefinitionSchema.parse({
version: '1.0.3',
version: '0.2.0',
id: `${BUILT_IN_ID_PREFIX}services_from_ecs_data`,
name: 'Services from ECS data',
description:
@ -42,8 +42,8 @@ export const builtInServicesFromLogsEntityDefinition: EntityDefinition =
syncDelay: '2m',
},
},
identityFields: ['service.name', { field: 'service.environment', optional: true }],
displayNameTemplate: '{{service.name}}{{#service.environment}}:{{.}}{{/service.environment}}',
identityFields: ['service.name'],
displayNameTemplate: '{{service.name}}',
metadata: [
{ source: '_index', destination: 'sourceIndex' },
{ source: 'agent.name', aggregation: { type: 'terms', limit: 100 } },