Skip to content

[agents] Read docker container id from filesystem #22

@roncohen

Description

@roncohen

Agents should try to read the current container ID from the local filesystem. Elasticsearch already does this.

There's previously been discussion around issues that could arise because the agent could be blocked while fetching this information. I'm not too concerned about blocking the agent startup for a little bit while we check if the file exists and read/parse it. It should only take a few milliseconds. If we start supporting AWS Lambda and similar we could skip the check outright based on an environment variable that is automatically set by the provider.

There are some complications involved in parsing the file so it would be nice if one of the agents buildt a reference implementation that others can take model their own implementation on.

Pleas add the field to metadata as system.container.id.

The field will end up in Elasticsearch as container.id: https://github.com/elastic/ecs/blob/master/schemas/container.yml#L19-L23

@elastic/apm-agent-devs Please link your issue or PR and then mark the checkbox when the implementation is merged:

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions