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

Create APM data access plugin #161906

Closed
Tracked by #161875
neptunian opened this issue Jul 13, 2023 · 5 comments · Fixed by #162367
Closed
Tracked by #161875

Create APM data access plugin #161906

neptunian opened this issue Jul 13, 2023 · 5 comments · Fixed by #162367
Labels
Team:APM All issues that need APM UI Team support

Comments

@neptunian
Copy link
Contributor

neptunian commented Jul 13, 2023

Infra needs a way to access APM data so we can provide a list of related services and metrics in the Hosts UI. Infra plans to get a list of APM services via the Assets API but the Assets plugin needs access to APM data so we aren't hardcoding the source config. At that point Infra will need to query for APM metrics and also get access to APM data. We can't depend directly on the APM plugin as they already depend on Infra. I've added this as part of #161875 because I think our circular dependency problem aligns with the problem and solution outlined there.

Acceptance Criteria

  • A new plugin exists in Kibana called "obs_traces_data" or similar
  • This plugin becomes the owner of any user configuration around where traces data are stored (saved objects, advanced settings, etc.)
  • This plugin exposes a method or methods that tells the caller where traces data are stored
  • The existing APM UI plugin could this plugin's method to determine where data is stored (optional)
  • The asset_manager plugin uses this plugin's method to determine where traces data are stored

Blocks:
#160294
APM services component

@botelastic botelastic bot added the needs-team Issues missing a team label label Jul 13, 2023
@nreese nreese added the Team:APM All issues that need APM UI Team support label Jul 14, 2023
@elasticmachine
Copy link
Contributor

Pinging @elastic/apm-ui (Team:APM)

@botelastic botelastic bot removed the needs-team Issues missing a team label label Jul 14, 2023
@roshan-elastic
Copy link

@sqren ping

@sorenlouv
Copy link
Member

Thanks @roshan-elastic. I'll discuss this with the team at our refinement session later today.

sorenlouv added a commit that referenced this issue Aug 22, 2023
Closes #161906
Related to:
elastic/observability-dev#2787
(_internal_)

This add a new plugin `apm_data_access` that contains the APM query
targets (indices to query for APM data).
This plugin can be consumed by apm and any other plugin, making it
possible for other plugins to know about the configured APM query
targets.



## Example:

APM query targets can be specified in kibana[.dev].yml using
`xpack.apm.indices.{dataset}: some-index-*` for instances:

```yml
xpack.apm.indices.transaction: apm-*
```

See all config options on:
https://www.elastic.co/guide/en/kibana/current/apm-settings-kb.html#general-apm-settings-kb

Query targets can also be specified via the UI (and persisted in a saved
object) via the settings page: `/app/apm/settings/apm-indices`

**Retrieving the query targets**
Query targets can be retrieved from other plugins via `getApmIndices`:
```ts
const apmIndices = await plugins.apmDataAccess.setup.getApmIndices(savedObjects.client); 
```

TODO:

- [x] Add SO client and fetch space aware index config (see
https://github.com/sqren/kibana/blob/4d7f626da020c156500f8bf52bf8861cde54b4f1/x-pack/plugins/apm/server/routes/settings/apm_indices/get_apm_indices.ts#L32-L44)
- [ ] Add simple APM client for querying apm data

---------

Co-authored-by: kibanamachine <[email protected]>
@roshan-elastic
Copy link

Thanks @sqren !

@sorenlouv
Copy link
Member

You are welcome! Let me know when you start consuming this, and if it works for your use case.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Team:APM All issues that need APM UI Team support
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants