-
Notifications
You must be signed in to change notification settings - Fork 525
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
Introduce configuration for specifying service-specific source maps #5002
Comments
Excepting cache management, is it sufficient to make a request to https://github.com/elastic/fleet-server/blob/d72fcdd6d9c0707fef43918c2398b741cef77130/cmd/fleet/router.go#L72-L74 |
@stuartnelson3 yes that should be sufficient - it should be enough to perform a GET request with the configured URL, with the API Key in the Authorization header. |
Looking at the way the apm-server is currently being reloaded when a config changed is pushed down, it's creating a new server on each reload. Unless I'm missing something, I think we would have to implement the reload differently in order to maintain still-valid sourcemaps in the cache edit: it appears https://pkg.go.dev/github.com/patrickmn/go-cache?utm_source=godoc#NewFrom |
Is there coordination around applying sourcemaps? It looks like if multiple stacktraces come in at once that all perform a lookup on the same service name/version/bundlepath, there could be a storm of requests to the fleet-server (or, currently, elasticsearch). Is this a concern? |
Right, that's the current state of affair. A while back I opened #5039 to improve things.
I think that would be sensible, but let's leave it to a followup. |
I don't recall what we have already, but I think it would be a good idea to to introduce to add some synchronisation: fetch it once, have others wait for the result. |
As part of the move to Fleet we will need to move away from fetching source maps directly from (and indexing source maps into) Elasticsearch, as the privileges APM Server is given does not cover this. Instead, source maps should be uploaded to Kibana, stored as a Fleet Artifact, with references to Fleet Artifact download URLs pushed down to APM Server via the server's policy.
In order to make the above possible, we will add configuration to APM Server to specify zero or more source maps, including:
For example:
The server will fetch and cache these like today: fetch on first access, cache in memory with an expiration time. We might make improvements to caching later, but that can be done separately. If the list of source maps is dynamically updated, then the cache will be invalidated for (service name, service version, bundle filepath) tuples that are added, changed, or removed.
Configuring a list of source maps will disable fetching source maps from Elasticsearch. It will be an error to specify Elasticsearch configuration under
apm-server.rum.source_mapping
if thesource_maps
property is non-null.Fleet Server requires auth for fetching artifacts. If a source map URL points to Fleet Server, then APM Server must pass its Fleet API access key in download requests.
The text was updated successfully, but these errors were encountered: