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

Instrument Kibana with APM #32491

Closed
danielyahn opened this issue Mar 5, 2019 · 10 comments · Fixed by #43548
Closed

Instrument Kibana with APM #32491

danielyahn opened this issue Mar 5, 2019 · 10 comments · Fixed by #43548
Labels
enhancement New value added to drive a business result Team:APM All issues that need APM UI Team support Team:Core Core services & architecture: plugins, logging, config, saved objects, http, ES client, i18n, etc

Comments

@danielyahn
Copy link

Describe the feature:

  • High level idea: since Kibana is nodejs app, can it be instrumented by Elastic's APM feature?
  • Is Kibana distribution compiled with APM agent?

Describe a specific use case for the feature:

@lukeelmers lukeelmers added Team:Core Core services & architecture: plugins, logging, config, saved objects, http, ES client, i18n, etc enhancement New value added to drive a business result labels Mar 5, 2019
@elasticmachine
Copy link
Contributor

Pinging @elastic/kibana-platform

@watson
Copy link
Contributor

watson commented Mar 11, 2019

Hi @danielyahn

Thanks for opening this issue. I've been looking into which changes would be required in order to support this use-case, and there's currently a few things we need to add to the Node.js APM Agent in order for this to be properly supported:

The latter is not strictly needed, but would give a much better experience as a lot of queries in Kibana are performed using _msearch instead of _search.

@zumo64
Copy link
Contributor

zumo64 commented Jun 4, 2019

Analysing Kibana APM information (queries) would help us troubleshoot a lot of clusters performance issues , identify toxic visualisations and "bad" Kibana users

@watson
Copy link
Contributor

watson commented Jun 11, 2019

Status update:

We released support for _msearch back in v2.9.0 of the Node.js agent. This just leaves missing support for "late configuration" of the agent: elastic/apm-agent-nodejs#877.

The latter feature is needed to give users a good experience by allowing them to keep the APM configuration inside the Kibana config file. However, if the user is ok with using environment variables to configure the APM agent, then the agent can be used to monitor Kibana already today.

All config options for the APM agent can be set via environment variables. You can see the names of these environment variables listed next to each config option in the documentation. E.g. the most important one is probably serverUrl, which can be set via the environment variable ELASTIC_APM_SERVER_URL.

For a guide on how to install the agent, see the introduction docs:
https://www.elastic.co/guide/en/apm/agent/nodejs/current/intro.html

@lreuven
Copy link

lreuven commented Jun 23, 2019

@danielyahn @zumo64 did you have a chance to instrument Kibana with the workaround @watson suggested? would you like assistance?

@watson
Copy link
Contributor

watson commented Jul 3, 2019

I'd like to propose that we add the Node.js agent to the Kibana source code, but in a deactivated state. A user can then activate it using environment variables. This should be an undocumented feature intended for internal debugging and testing, but external users are of course welcome to use it if they know how.

The benefit of adding the agent to the Kibana source code is that it's going to be easier for us internally to use it if we want to. Today, each person who wants to use it would first have to figure out where to install it, then install it etc. If it was already in there, it would hopefully be used much more frequently.

If this is ok with the Kibana team, we can make a PR to the project.

@epixa
Copy link
Contributor

epixa commented Jul 3, 2019

I have no objections to that in theory, so long as late configuration is still the gameplan for getting this to GA. I think Kibana should come orchestrated out of the box for apm, so I don't see any way around shipping the agent along with Kibana itself. It's an oss license, so there isn't a conflict there.

@watson
Copy link
Contributor

watson commented Jul 4, 2019

Yes, late configuration is still the plan. And I agree we can't GA it before that's possible so that the agent config can be part of the regular Kibana config

@watson watson added the Team:APM All issues that need APM UI Team support label Aug 1, 2019
@elasticmachine
Copy link
Contributor

Pinging @elastic/apm-ui

@watson
Copy link
Contributor

watson commented Aug 1, 2019

I've just added this issue to the roadmap of the Node.js APM agent. To scope it, we'll implement an optimistic version that is only configurable via environment variables, as opposed to via the Kibana config file (as described in #32491 (comment))

If we afterward find that we would like to proceed with supporting "late config" which allows configuring the agent via the Kibana config file, we can create another issue for that enhancement specifically.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New value added to drive a business result Team:APM All issues that need APM UI Team support Team:Core Core services & architecture: plugins, logging, config, saved objects, http, ES client, i18n, etc
Projects
None yet
Development

Successfully merging a pull request may close this issue.

8 participants