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 client with apm go agent #3359

Merged
merged 9 commits into from
Feb 25, 2020

Conversation

simitt
Copy link
Contributor

@simitt simitt commented Feb 19, 2020

Motivation/summary

This adds elastic apm instrumentation to the kibana client, and adds context passing to all client methods.

This change allows to gain more insights into outgoing requests to Kibana, as part of the Agent Configuration endpoint. For the moment it adds instrumentation to the APM Server code only, but once the instrumentation is also added to beats, the apmhttp auto-instrumentation can be leveraged for outgoing calls.

closes #3185

Checklist

- [ ] I have signed the Contributor License Agreement.

  • My code follows the style guidelines of this project (run make check-full for static code checks and linting)
  • I have rebased my changes on top of the latest master branch

- [ ] I have made corresponding changes to the documentation

  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes

How to test these changes

Start APM Server with rum and kibana enabled, and start the Elastic Stack. Make a request to the agent config endpoint, e.g. curl -i "http://localhost:8200/config/v1/agents?service.name=123" and ensure the outgoing request to Kibana is recorded.

Screenshot 2020-02-19 at 17 14 28

Related issues

closes #3185

@Bamieh
Copy link
Member

Bamieh commented Feb 19, 2020

Codecov Report

Merging #3359 into master will decrease coverage by 0.39%.
The diff coverage is n/a.

@@            Coverage Diff             @@
##           master    #3359      +/-   ##
==========================================
- Coverage   79.36%   78.96%   -0.40%     
==========================================
  Files         108      107       -1     
  Lines        5698     5582     -116     
==========================================
- Hits         4522     4408     -114     
+ Misses       1176     1174       -2     
Impacted Files Coverage Δ
kibana/connecting_client.go 67.74% <0.00%> (-7.26%) ⬇️

Copy link
Member

@axw axw left a comment

Choose a reason for hiding this comment

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

Nice work!

@simitt
Copy link
Contributor Author

simitt commented Feb 25, 2020

Sorry for all the noise on this PR. I updated to the latest beats framework that now includes passing the context around. This is ready for final review/merge now.

@simitt simitt merged commit 2555eb3 into elastic:master Feb 25, 2020
simitt added a commit to simitt/apm-server that referenced this pull request Feb 25, 2020
Add elastic apm instrumentation to kibana client,
and add context passing to all client methods.

closes elastic#3185
simitt added a commit that referenced this pull request Feb 26, 2020
Add elastic apm instrumentation to kibana client,
and add context passing to all client methods.

closes #3185
@simitt simitt deleted the instrument-kibana branch March 18, 2020 16:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[self instrumentation] Instrument Kibana client
4 participants