-
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
[ECO][Inventory v2] APM changes #202299
Comments
Pinging @elastic/obs-ux-infra_services-team (Team:obs-ux-infra_services) |
I created a draft PR in case the person making these changes wants to continue what I've done. |
I was comparing the results of Before we were using the latestEntityServices query and now I am trying to replace it with
So regarding the cc: @miltonhultgren @klacabane Do you know how to get the agent name there and if we plan to add it in the response? I did some updates in #202497 so both responses are now logged and present |
@jennypavlova how does the searchEntities call looks like ? generally you need to explicitly ask for metadata fields in v2 APIs, so in that case it should be If you want some metadata fields to always be included when you search for entities, you'd need to set them on the source definition (here for services) but you'd have to consider the tradeoff (ie always aggregating a given field even if not used vs only aggregating when needed). If a field is required in all the places a given entity type is manipulated then it may be a good call to set it on the definition source |
One additional note on metadata fields is that you may see different results between v1 and v2 as v1 used a terms aggregation to get n unique values but v2 uses a top aggregation that does not dedupe. For a given time range there's a good chance you won't get all the unique values for a field but only the top result sorted alphabetically. I'm looking into ways to improve this (see #204137) |
@klacabane Good point, this works for the use case here!
I don't think we should add it for now - I am not sure if it will be used everywhere so I think we can add it once we confirm that.
Thanks! |
@rmyz found an issue with duplicate values in the metadata and enviroment and I checked and it's related to the EEM response - I used synthtrace to generate data and I got this response: I handled that on our side to allow only unique values but it might be something you should also take a look, @miltonhultgren , @klacabane |
@jennypavlova this is caused by the |
Thank you for checking that! I already added a logic to pick only unique values so it's not a blocker for the PR |
Closes [202299](#202299) ## Summary This PR replaces the query in `getServiceEntitySummary` with the v2 function (`entityManagerClient.v2.searchEntities`) ## Testing - Verify the response of the summary endpoint in the UI: https://github.com/user-attachments/assets/ba895f7d-57c8-492b-81dd-cf7869ffbc86 - Dev tools query - APM service #### Request: ``` GET kbn:/internal/apm/entities/services/synth-node-0/summary?environment=ENVIRONMENT_ALL ``` #### Response ``` { "serviceName": "synth-node-0", "agentName": "nodejs", "lastSeenTimestamp": "2024-12-13T16:29:19.868Z", "dataStreamTypes": [ "logs", "traces" ], "environments": [ "Synthtrace: simple_trace" ] } ``` - Service from logs #### Request: ``` GET kbn:/internal/apm/entities/services/synth-node/summary?environment=ENVIRONMENT_ALL ``` #### Response: ``` { "serviceName": "synth-node", "agentName": "go", "lastSeenTimestamp": "2024-12-13T16:27:43.461Z", "dataStreamTypes": [ "logs", "traces" ], "environments": [ "Synthtrace: logs_traces_hosts" ] } ``` --------- Co-authored-by: Jenny <[email protected]> Co-authored-by: kibanamachine <[email protected]>
Closes [202299](elastic#202299) ## Summary This PR replaces the query in `getServiceEntitySummary` with the v2 function (`entityManagerClient.v2.searchEntities`) ## Testing - Verify the response of the summary endpoint in the UI: https://github.com/user-attachments/assets/ba895f7d-57c8-492b-81dd-cf7869ffbc86 - Dev tools query - APM service #### Request: ``` GET kbn:/internal/apm/entities/services/synth-node-0/summary?environment=ENVIRONMENT_ALL ``` #### Response ``` { "serviceName": "synth-node-0", "agentName": "nodejs", "lastSeenTimestamp": "2024-12-13T16:29:19.868Z", "dataStreamTypes": [ "logs", "traces" ], "environments": [ "Synthtrace: simple_trace" ] } ``` - Service from logs #### Request: ``` GET kbn:/internal/apm/entities/services/synth-node/summary?environment=ENVIRONMENT_ALL ``` #### Response: ``` { "serviceName": "synth-node", "agentName": "go", "lastSeenTimestamp": "2024-12-13T16:27:43.461Z", "dataStreamTypes": [ "logs", "traces" ], "environments": [ "Synthtrace: logs_traces_hosts" ] } ``` --------- Co-authored-by: Jenny <[email protected]> Co-authored-by: kibanamachine <[email protected]> (cherry picked from commit a66c139)
@jennypavlova fyi #204460 has been merged so the dedup logic is not needed anymore |
Closes [202299](elastic#202299) ## Summary This PR replaces the query in `getServiceEntitySummary` with the v2 function (`entityManagerClient.v2.searchEntities`) ## Testing - Verify the response of the summary endpoint in the UI: https://github.com/user-attachments/assets/ba895f7d-57c8-492b-81dd-cf7869ffbc86 - Dev tools query - APM service #### Request: ``` GET kbn:/internal/apm/entities/services/synth-node-0/summary?environment=ENVIRONMENT_ALL ``` #### Response ``` { "serviceName": "synth-node-0", "agentName": "nodejs", "lastSeenTimestamp": "2024-12-13T16:29:19.868Z", "dataStreamTypes": [ "logs", "traces" ], "environments": [ "Synthtrace: simple_trace" ] } ``` - Service from logs #### Request: ``` GET kbn:/internal/apm/entities/services/synth-node/summary?environment=ENVIRONMENT_ALL ``` #### Response: ``` { "serviceName": "synth-node", "agentName": "go", "lastSeenTimestamp": "2024-12-13T16:27:43.461Z", "dataStreamTypes": [ "logs", "traces" ], "environments": [ "Synthtrace: logs_traces_hosts" ] } ``` --------- Co-authored-by: Jenny <[email protected]> Co-authored-by: kibanamachine <[email protected]>
We're moving away from materialized entities, meaning we won't have the entity-*-latest index anymore. Due to this, these changes need to be made:
Warning
We should NOT call the EEM rest APIs directly, we should use the services exposed on the EEM client plugin.
datastream_type
from a given service name on the entities latest index. We'll need to update it to call the new API instead:API:
GET /internal/apm/entities/services/{serviceName}/summary
GET /internal/apm/entities/services
./link-to/entity/{serviceName}
route:This link is used to link service names shown on
logs explorer
anddiscover
, It also uses the summary APIGET /internal/apm/entities/services/{serviceName}/summary
, and needs to be tested.The text was updated successfully, but these errors were encountered: