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

[ECO][Inventory v2] APM changes #202497

Merged
merged 22 commits into from
Dec 17, 2024

Conversation

cauemarcondes
Copy link
Contributor

@cauemarcondes cauemarcondes commented Dec 2, 2024

Closes 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:
apm_v2.mov
  • 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"
        ]
      }
      

@jennypavlova jennypavlova self-assigned this Dec 13, 2024
@jennypavlova jennypavlova added release_note:skip Skip the PR/issue when compiling release notes backport:prev-minor Backport to (8.x) the previous minor version (i.e. one version back from main) Team:obs-ux-infra_services Observability Infrastructure & Services User Experience Team labels Dec 13, 2024
@jennypavlova jennypavlova marked this pull request as ready for review December 13, 2024 16:57
@jennypavlova jennypavlova requested review from a team as code owners December 13, 2024 16:57
@elasticmachine
Copy link
Contributor

Pinging @elastic/obs-ux-infra_services-team (Team:obs-ux-infra_services)

@jennypavlova jennypavlova changed the title Eco apm new eem api [ECO][Inventory v2] APM changes Dec 13, 2024
@botelastic botelastic bot added the ci:project-deploy-observability Create an Observability project label Dec 13, 2024
Copy link
Contributor

🤖 GitHub comments

Expand to view the GitHub comments

Just comment with:

  • /oblt-deploy : Deploy a Kibana instance using the Observability test environments.
  • run docs-build : Re-trigger the docs validation. (use unformatted text in the comment!)

Copy link
Member

@afharo afharo left a comment

Choose a reason for hiding this comment

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

kibana.jsonc changes LGTM

Copy link
Contributor

@rmyz rmyz left a comment

Choose a reason for hiding this comment

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

Some nits, LGTM

@jennypavlova
Copy link
Member

@rmyz Thank you for reviewing and testing the PR! I fixed the things you mentioned, also I added a comment about the issue you found with the duplicate values (as it was part of the EEM response) but I still added a fix (3d07ff8) to filter for unique values

@jennypavlova jennypavlova enabled auto-merge (squash) December 16, 2024 17:35
@elasticmachine
Copy link
Contributor

elasticmachine commented Dec 16, 2024

💚 Build Succeeded

  • Buildkite Build
  • Commit: 09b1905
  • Kibana Serverless Image: docker.elastic.co/kibana-ci/kibana-serverless:pr-202497-09b19052e376

Metrics [docs]

Public APIs missing comments

Total count of every public API that lacks a comment. Target amount is 0. Run node scripts/build_api_docs --plugin [yourplugin] --stats comments for more detailed information.

id before after diff
observabilityShared 516 517 +1

Page load bundle

Size of the bundles that are downloaded on every page load. Target size is below 100kb

id before after diff
observabilityShared 93.7KB 93.8KB +117.0B
Unknown metric groups

API count

id before after diff
observabilityShared 522 523 +1

History

cc @jennypavlova

Copy link
Contributor

@iblancof iblancof left a comment

Choose a reason for hiding this comment

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

LGTM!


interface Params {
entitiesESClient: EntitiesESClient;
entityManagerClient: EntityClient;
Copy link
Contributor

Choose a reason for hiding this comment

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

Why not keep the name as entityClient to match the type EntityClient?

@jennypavlova jennypavlova merged commit a66c139 into elastic:main Dec 17, 2024
8 checks passed
@kibanamachine
Copy link
Contributor

Starting backport for target branches: 8.x

https://github.com/elastic/kibana/actions/runs/12370031803

kibanamachine pushed a commit to kibanamachine/kibana that referenced this pull request Dec 17, 2024
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)
@kibanamachine
Copy link
Contributor

💚 All backports created successfully

Status Branch Result
8.x

Note: Successful backport PRs will be merged automatically after passing CI.

Questions ?

Please refer to the Backport tool documentation

kibanamachine added a commit that referenced this pull request Dec 17, 2024
# Backport

This will backport the following commits from `main` to `8.x`:
- [[ECO][Inventory v2] APM changes
(#202497)](#202497)

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

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

<!--BACKPORT [{"author":{"name":"Cauê
Marcondes","email":"[email protected]"},"sourceCommit":{"committedDate":"2024-12-17T09:24:33Z","message":"[ECO][Inventory
v2] APM changes (#202497)\n\nCloses
[202299](https://github.com/elastic/kibana/issues/202299)\r\n\r\n##
Summary\r\n\r\nThis PR replaces the query in `getServiceEntitySummary`
with the v2\r\nfunction
(`entityManagerClient.v2.searchEntities`)\r\n\r\n## Testing\r\n- Verify
the response of the summary endpoint in the
UI:\r\n\r\n\r\n\r\nhttps://github.com/user-attachments/assets/ba895f7d-57c8-492b-81dd-cf7869ffbc86\r\n\r\n\r\n\r\n-
Dev tools query\r\n - APM service\r\n #### Request:\r\n
```\r\nGET\r\nkbn:/internal/apm/entities/services/synth-node-0/summary?environment=ENVIRONMENT_ALL\r\n
```\r\n #### Response\r\n ```\r\n {\r\n \"serviceName\":
\"synth-node-0\",\r\n \"agentName\": \"nodejs\",\r\n
\"lastSeenTimestamp\": \"2024-12-13T16:29:19.868Z\",\r\n
\"dataStreamTypes\": [\r\n \"logs\",\r\n \"traces\"\r\n ],\r\n
\"environments\": [\r\n \"Synthtrace: simple_trace\"\r\n ]\r\n }\r\n
```\r\n\r\n - Service from logs\r\n #### Request:\r\n
```\r\nGET\r\nkbn:/internal/apm/entities/services/synth-node/summary?environment=ENVIRONMENT_ALL\r\n
```\r\n #### Response: \r\n ```\r\n {\r\n \"serviceName\":
\"synth-node\",\r\n \"agentName\": \"go\",\r\n \"lastSeenTimestamp\":
\"2024-12-13T16:27:43.461Z\",\r\n \"dataStreamTypes\": [\r\n
\"logs\",\r\n \"traces\"\r\n ],\r\n \"environments\": [\r\n
\"Synthtrace: logs_traces_hosts\"\r\n ]\r\n }\r\n
```\r\n\r\n---------\r\n\r\nCo-authored-by: Jenny
<[email protected]>\r\nCo-authored-by: kibanamachine
<[email protected]>","sha":"a66c1399e60b184c338fc99c9550539bd2ecf68b","branchLabelMapping":{"^v9.0.0$":"main","^v8.18.0$":"8.x","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["release_note:skip","v9.0.0","backport:prev-minor","ci:project-deploy-observability","Team:obs-ux-infra_services"],"title":"[ECO][Inventory
v2] APM
changes","number":202497,"url":"https://github.com/elastic/kibana/pull/202497","mergeCommit":{"message":"[ECO][Inventory
v2] APM changes (#202497)\n\nCloses
[202299](https://github.com/elastic/kibana/issues/202299)\r\n\r\n##
Summary\r\n\r\nThis PR replaces the query in `getServiceEntitySummary`
with the v2\r\nfunction
(`entityManagerClient.v2.searchEntities`)\r\n\r\n## Testing\r\n- Verify
the response of the summary endpoint in the
UI:\r\n\r\n\r\n\r\nhttps://github.com/user-attachments/assets/ba895f7d-57c8-492b-81dd-cf7869ffbc86\r\n\r\n\r\n\r\n-
Dev tools query\r\n - APM service\r\n #### Request:\r\n
```\r\nGET\r\nkbn:/internal/apm/entities/services/synth-node-0/summary?environment=ENVIRONMENT_ALL\r\n
```\r\n #### Response\r\n ```\r\n {\r\n \"serviceName\":
\"synth-node-0\",\r\n \"agentName\": \"nodejs\",\r\n
\"lastSeenTimestamp\": \"2024-12-13T16:29:19.868Z\",\r\n
\"dataStreamTypes\": [\r\n \"logs\",\r\n \"traces\"\r\n ],\r\n
\"environments\": [\r\n \"Synthtrace: simple_trace\"\r\n ]\r\n }\r\n
```\r\n\r\n - Service from logs\r\n #### Request:\r\n
```\r\nGET\r\nkbn:/internal/apm/entities/services/synth-node/summary?environment=ENVIRONMENT_ALL\r\n
```\r\n #### Response: \r\n ```\r\n {\r\n \"serviceName\":
\"synth-node\",\r\n \"agentName\": \"go\",\r\n \"lastSeenTimestamp\":
\"2024-12-13T16:27:43.461Z\",\r\n \"dataStreamTypes\": [\r\n
\"logs\",\r\n \"traces\"\r\n ],\r\n \"environments\": [\r\n
\"Synthtrace: logs_traces_hosts\"\r\n ]\r\n }\r\n
```\r\n\r\n---------\r\n\r\nCo-authored-by: Jenny
<[email protected]>\r\nCo-authored-by: kibanamachine
<[email protected]>","sha":"a66c1399e60b184c338fc99c9550539bd2ecf68b"}},"sourceBranch":"main","suggestedTargetBranches":[],"targetPullRequestStates":[{"branch":"main","label":"v9.0.0","branchLabelMappingKey":"^v9.0.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/202497","number":202497,"mergeCommit":{"message":"[ECO][Inventory
v2] APM changes (#202497)\n\nCloses
[202299](https://github.com/elastic/kibana/issues/202299)\r\n\r\n##
Summary\r\n\r\nThis PR replaces the query in `getServiceEntitySummary`
with the v2\r\nfunction
(`entityManagerClient.v2.searchEntities`)\r\n\r\n## Testing\r\n- Verify
the response of the summary endpoint in the
UI:\r\n\r\n\r\n\r\nhttps://github.com/user-attachments/assets/ba895f7d-57c8-492b-81dd-cf7869ffbc86\r\n\r\n\r\n\r\n-
Dev tools query\r\n - APM service\r\n #### Request:\r\n
```\r\nGET\r\nkbn:/internal/apm/entities/services/synth-node-0/summary?environment=ENVIRONMENT_ALL\r\n
```\r\n #### Response\r\n ```\r\n {\r\n \"serviceName\":
\"synth-node-0\",\r\n \"agentName\": \"nodejs\",\r\n
\"lastSeenTimestamp\": \"2024-12-13T16:29:19.868Z\",\r\n
\"dataStreamTypes\": [\r\n \"logs\",\r\n \"traces\"\r\n ],\r\n
\"environments\": [\r\n \"Synthtrace: simple_trace\"\r\n ]\r\n }\r\n
```\r\n\r\n - Service from logs\r\n #### Request:\r\n
```\r\nGET\r\nkbn:/internal/apm/entities/services/synth-node/summary?environment=ENVIRONMENT_ALL\r\n
```\r\n #### Response: \r\n ```\r\n {\r\n \"serviceName\":
\"synth-node\",\r\n \"agentName\": \"go\",\r\n \"lastSeenTimestamp\":
\"2024-12-13T16:27:43.461Z\",\r\n \"dataStreamTypes\": [\r\n
\"logs\",\r\n \"traces\"\r\n ],\r\n \"environments\": [\r\n
\"Synthtrace: logs_traces_hosts\"\r\n ]\r\n }\r\n
```\r\n\r\n---------\r\n\r\nCo-authored-by: Jenny
<[email protected]>\r\nCo-authored-by: kibanamachine
<[email protected]>","sha":"a66c1399e60b184c338fc99c9550539bd2ecf68b"}}]}]
BACKPORT-->

Co-authored-by: Cauê Marcondes <[email protected]>
JoseLuisGJ pushed a commit to JoseLuisGJ/kibana that referenced this pull request Dec 19, 2024
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]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport:prev-minor Backport to (8.x) the previous minor version (i.e. one version back from main) ci:project-deploy-observability Create an Observability project release_note:skip Skip the PR/issue when compiling release notes Team:obs-ux-infra_services Observability Infrastructure & Services User Experience Team v8.18.0 v9.0.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[ECO][Inventory v2] APM changes
7 participants