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

[Meta] Improve APM agent instrumentation #78869

Closed
18 tasks
joshdover opened this issue Sep 29, 2020 · 11 comments
Closed
18 tasks

[Meta] Improve APM agent instrumentation #78869

joshdover opened this issue Sep 29, 2020 · 11 comments
Labels
impact:medium Addressing this issue will have a medium level of impact on the quality/strength of our product. loe:small Small Level of Effort performance Team:Core Core services & architecture: plugins, logging, config, saved objects, http, ES client, i18n, etc

Comments

@joshdover
Copy link
Contributor

joshdover commented Sep 29, 2020

This is an issue to track possible improvements we could make to the APM agent instrumentation by adding custom transactions & spans.

Second iteration (7.11)

Backend

  • Number of concurrent users or connections
  • Alerting/Task Manager
    • some existing instrumentation in TM already
    • how this is affecting other operations in the server

Frontend

  • Frontend route changes at the application level (Seems related)
    • Possibly use ApmRoute component, but has some caveats
  • Session length & SPA memory (leaks)

Metadata

  • Kibana CPU & memory size
  • ES Cluster stats / size
  • OS
  • Enabled plugins
  • HTTPS / TLS termination

Future

Backend

  • SavedObjectClient
  • @kbn/optimizer (dev only)
  • HTTP authorization hooks

These are easy to benchmark in dev

  • HTTP request validation
    • how much time do we spend on validation
  • RequestHandlerContext providers
    • how much time do we spend creating the various clients, etc.

Frontend

  • Chrome rendering performance
  • Global search
  • Visualization rendering
  • SearchService
@joshdover joshdover added Team:Core Core services & architecture: plugins, logging, config, saved objects, http, ES client, i18n, etc performance labels Sep 29, 2020
@elasticmachine
Copy link
Contributor

Pinging @elastic/kibana-platform (Team:Platform)

@graphaelli
Copy link
Member

In the frontend service, I was expecting the transaction name to be /apm/services (or /app/apm/services) , not /services

image

More generally, some alignment on transaction names is in order:

/app/apm/*?{query}
/app/apm/services
/services
/services/:serviceName/transactions
/services/:serviceName/transactions/view
GET /api/apm/settings/custom_links
GET /api/apm/traces/71099b2bf2ad4875aee562fcd14237f2
POST /../api/console/proxy
POST /api/ui_metric/report
POST /internal/licensing/feature_usage/register

@TinaHeiligers
Copy link
Contributor

@joshdover I'd love to connect and chat about how we can use APM for Kibana Telemetry since our efforts seem to be somewhat aligned.

@TinaHeiligers
Copy link
Contributor

@joshdover are we still going ahead with this issue during the 7.12 cycle? It's somewhat related to #78792, where we're working with the Node APM agent team.

@joshdover
Copy link
Contributor Author

I'm going to push this one out. I'll pick up the remaining work in #78792 on tuning the agent to minimize overhead. Until we have that ironed out, I don't think it makes sense to spend time adding any additional instrumentation.

@dgieselaar
Copy link
Member

One other thing that might be useful is tagging transactions with a plugin label, e.g. plugin: apm or plugin: ml, so teams can filter on that in the UI.

@mshustov
Copy link
Contributor

APM team added API that allows instrumenting a span with a custom context. #90403
It can be leveraged to add domain-specific context for low-level API. For example, we can use it to create a span UiSettings.read instead of showing an HTTP request to ES endpoint /.kibana/_doc. Which makes the APM results much easier to understand for people without knowledge of the low-level Core API.

@dgieselaar
Copy link
Member

@restrry the utility functions adds a span as a parent of the spans created in its context. It does not currently replace an automatically generated span. That would require some work in the Node.js agent I think, something that would allow us to intercept spans and rename them. I do think something like that would be better in the long run. @elastic/apm-agent-node-js

@mshustov
Copy link
Contributor

mshustov commented May 7, 2021

@exalate-issue-sync exalate-issue-sync bot added impact:medium Addressing this issue will have a medium level of impact on the quality/strength of our product. loe:small Small Level of Effort labels Nov 4, 2021
@lizozom lizozom changed the title Improve APM agent instrumentation [Meta] Improve APM agent instrumentation Nov 10, 2021
@lizozom
Copy link
Contributor

lizozom commented Nov 23, 2021

@mshustov fyi we're already reporting the js heap size\limit\used to fullstory.

If we want to do some quick analytics there, it's available on page load events only since 7.16.

@mshustov mshustov removed their assignment Nov 25, 2021
@lizozom
Copy link
Contributor

lizozom commented Apr 18, 2022

A lot of these things are tracked on #78869

For example #129050 and #114843

Closing this issue in favor of the maintained one.

@lizozom lizozom closed this as completed Apr 18, 2022
@exalate-issue-sync exalate-issue-sync bot reopened this Apr 18, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
impact:medium Addressing this issue will have a medium level of impact on the quality/strength of our product. loe:small Small Level of Effort performance Team:Core Core services & architecture: plugins, logging, config, saved objects, http, ES client, i18n, etc
Projects
None yet
Development

No branches or pull requests

7 participants