Skip to content

"GET /" version sniffing request to APM server sets "content-encoding: gzip" #1634

@trentm

Description

@trentm

Describe the bug:

On startup the Python APM agent's version-sniffing request to APM server looks like this:

    GET / HTTP/1.1
    host: localhost:8200
    accept-encoding: identity
    content-type: application/x-ndjson
    content-encoding: gzip
    user-agent: apm-agent-python/6.12.0 (unknown-python-service)
    accept: text/plain

I think the "content-encoding" and "content-type" are inappropriate. Clearly the real APM server is fine with this, but at least my lame-o "mockapmserver.js" crashed on this. I definitely need to make my mockapmserver code more bulletproof, but it might be work removing those headers from the version sniffing request.

vs. this from the Go agent:

    GET / HTTP/1.1
    host: localhost:8200
    user-agent: apm-agent-go/2.1.0 (trace-redis)
    accept-encoding: gzip

and this from the Node.js agent:

    GET / HTTP/1.1
    accept: application/json
    user-agent: apm-agent-nodejs/3.38.0 (all-the-rediss-nodejs 1.0.0)
    host: localhost:8200
    connection: close

To Reproduce

% cat foo.py
import elasticapm
client = elasticapm.Client()
elasticapm.instrument()

% python foo.py

Environment (please complete the following information)

  • OS: macOS
  • Python version: 3.10.2
  • Framework and version [e.g. Django 2.1]: N/A
  • APM Server version: mockapmserver.js ;)
  • Agent version: elastic-apm 6.12.0

Metadata

Metadata

Assignees

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions