-
Notifications
You must be signed in to change notification settings - Fork 524
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
feat: add reload listener for apm tracing config #13514
feat: add reload listener for apm tracing config #13514
Conversation
This pull request does not have a backport label. Could you fix it @kyungeunni? 🙏
NOTE: |
This pull request is now in conflicts. Could you fix it @kyungeunni? 🙏
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM. Let's follow up with some manual testing before closing the issue please.
There's a couple of fields in APMConfig which I don't think we'll honour (tls
, global_labels
), but those should probably be handled in libbeat: https://github.com/elastic/elastic-agent-client/blob/dd646033eae6ef77cf6ff5d297e0d5513d08ac7f/pkg/proto/elastic-agent-client.pb.go#L1200-L1205
Yes, |
Follow up: Manual testingI've done the manual testing by running a locally built elastic-agent image with the APM server binary that contains #13514 which subscribes to the APMConfig reload and applies the given APMConfig for the self-instrumentation. Setup
paste below, with replaced value for highlighted texts ( version: '3.9'
services:
elastic-agent:
image: **$LOCAL_IMAGE**
networks:
- network1
ports:
- 8220:8220
- 8200:8200
user: root
environment:
FLEET_SERVER_ENABLE: 'true'
FLEET_SERVER_ELASTICSEARCH_HOST: http://elasticsearch:9200
FLEET_SERVER_SERVICE_TOKEN: **Enrollment token**
FLEET_SERVER_POLICY_ID: **fleet-server-policy**
networks:
network1:
name: apm-server_default
external: true
Check for the Self InstrumentationI recommend using docker-desktop, and I'm sharing this instructions based on the session I've done with docker-desktop.
ObservationI was observing some auth error when enabled the self instrumentation with above config with the error message showing apm-server/internal/beater/tracing.go Line 40 in 7f18ad5
ConclusionAuth error prevented me from seeing the ingested traces. However, it is out of the scope for this PR and should be addressed separately. I was able to see the APMConfig is received in the APM Server successfully via reloader and the instrumentation is turned on. |
Motivation/summary
depending on elastic/beats#40030Subscribe to the APMConfig changes from the reloader and hot-reload the runner with the updated tracing configuration.
This will enable self-instrumentation for APM Server in managed mode.
Checklist
elastic-agent.yml
=> will be done in separatelyFor functional changes, consider:
How to test these changes
Follow instructions in
Building an Elastic Agent container image with a locally built APM Server
andRunning an Elastic Agent container with a locally built APM Server
section inTESTING.md
, update theelastic-agnet.yml
to see the config is received and it's passed down to tracing correctly.Related issues