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

Elastic Agent is not attempting to restart APM Server #4801

Closed
simitt opened this issue May 23, 2024 · 7 comments
Closed

Elastic Agent is not attempting to restart APM Server #4801

simitt opened this issue May 23, 2024 · 7 comments
Assignees
Labels
bug Something isn't working Team:Elastic-Agent-Control-Plane Label for the Agent Control Plane team

Comments

@simitt
Copy link
Contributor

simitt commented May 23, 2024

We observed that the Elastic Agent is not aiming to restart the APM Server when the server stops, due to a sourcemap issue. There is a dedicated bug issue filed to avoid the APM Server being stopped in the first place elastic/kibana#149660 (comment)). However, this also uncovered that the Elastic Agent does not attempt to restart the APM Server, which is confirmed by @ycombinator as unexpected behaviour. We would expect the Agent to try restarting the APM Server.

If possible, it would also be helpful if Elastic Agent logs contained information about subprocess uptime to help with investigations of failures.

Logs:
Screenshot 2024-05-23 at 12 07 01

@simitt simitt added the bug Something isn't working label May 23, 2024
@pierrehilbert pierrehilbert added the Team:Elastic-Agent-Control-Plane Label for the Agent Control Plane team label May 23, 2024
@elasticmachine
Copy link
Contributor

Pinging @elastic/elastic-agent-control-plane (Team:Elastic-Agent-Control-Plane)

@cmacknz
Copy link
Member

cmacknz commented May 23, 2024

Seeing the reproduction attached to the use of service_version=${VERSION} which I assume can't be substituted, this makes me think this is #2261 and we are dropping apm-server from the set of running components.

@blakerouse
Copy link
Contributor

I think this has two related issues:

The main one is #2177 which needs to be solved to allow passing in $${foo} which will then become ${foo}. The second issue would be to determine if Fleet or the integration should escape it automatically so the user doesn't need to do the escape themselves.

@ycombinator
Copy link
Contributor

Thanks for the investigation, @blakerouse. Let's put this issue on hold for now as it depends on #2177 and work on #2177 first instead. Accordingly, I've brought #2177 into the current sprint and moved this issue into the next one. If #2177 turns out to be a somewhat quick fix, we can consider bringing this issue back into the current sprint.

@blakerouse
Copy link
Contributor

I was able to reproduce this issue on 8.15. The issue is that once a source map is uploaded, Kibana creates a new policy revision with the follow in it:

rum:
        enabled: true
        allow_headers: null
        allow_origins:
          - '*'
        exclude_from_grouping: ^/webpack
        library_pattern: node_modules|bower_components|~
        response_headers: null
        source_mapping:
          metadata:
            - service.name: foo
              service.version: '${VERSION}'
              bundle.filepath: /test/e2e/general-usecase/bundle.js
              sourcemap.url: >-
                /api/fleet/artifacts/foo-${VERSION}/9824f1486e9362e9b083a979ec4cc462eea6fafff53e2511503ec96dc9bb2ba7
          elasticsearch:
            api_key: 'PgTw6pABgMVqePbnEstb:uo8CHX5jToSMZjDdoYiYrA'

See the source.version: '${VERSION}'. That needs to be escaped by Kibana before being placed into the policy as source.version: '$${VERSION}'.

@ycombinator
Copy link
Contributor

Thanks @blakerouse for the investigation.

That needs to be escaped by Kibana before being placed into the policy as source.version: '$${VERSION}'.

This appears to be elastic/kibana#188377. cc: @kpollich

@ycombinator
Copy link
Contributor

With elastic/kibana#188377 resolved, I'm now closing this issue as well.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working Team:Elastic-Agent-Control-Plane Label for the Agent Control Plane team
Projects
None yet
Development

No branches or pull requests

6 participants