Elastic APM tracer implementation

This commit is contained in:
Amine Benseddik 2019-11-27 16:00:07 +01:00 committed by Traefiker Bot
parent c4a38de007
commit fe8b090911
11 changed files with 223 additions and 0 deletions

View file

@ -0,0 +1,88 @@
# Elastic
To enable the Elastic:
```toml tab="File (TOML)"
[tracing]
[tracing.elastic]
```
```yaml tab="File (YAML)"
tracing:
elastic: {}
```
```bash tab="CLI"
--tracing.elastic=true
```
#### `serverURL`
_Optional, Default="http://localhost:8200"_
APM ServerURL is the URL of the Elastic APM server.
```toml tab="File (TOML)"
[tracing]
[tracing.elastic]
serverURL = "http://apm:8200"
```
```yaml tab="File (YAML)"
tracing:
elastic:
serverURL: "http://apm:8200"
```
```bash tab="CLI"
--tracing.elastic.serverurl="http://apm:8200"
```
#### `secretToken`
_Optional, Default=""_
APM Secret Token is the token used to connect to Elastic APM Server.
```toml tab="File (TOML)"
[tracing]
[tracing.elastic]
secretToken = "mytoken"
```
```yaml tab="File (YAML)"
tracing:
elastic:
secretToken: "mytoken"
```
```bash tab="CLI"
--tracing.elastic.secrettoken="mytoken"
```
#### `serviceEnvironment`
_Optional, Default=""_
APM Service Environment is the name of the environment Traefik is deployed in, e.g. `production` or `staging`.
```toml tab="File (TOML)"
[tracing]
[tracing.elastic]
serviceEnvironment = "production"
```
```yaml tab="File (YAML)"
tracing:
elastic:
serviceEnvironment: "production"
```
```bash tab="CLI"
--tracing.elastic.serviceenvironment="production"
```
### Further
Additional configuration of Elastic APM Go agent can be done using environment variables.
See [APM Go agent reference](https://www.elastic.co/guide/en/apm/agent/go/current/configuration.html).

View file

@ -570,6 +570,18 @@ Specifies the header name that will be used to store the sampling priority.
`--tracing.datadog.traceidheadername`:
Specifies the header name that will be used to store the trace ID.
`--tracing.elastic`:
Settings for Elastic. (Default: ```false```)
`--tracing.elastic.secrettoken`:
Set the token used to connect to Elastic APM Server.
`--tracing.elastic.serverurl`:
Set the URL of the Elastic APM server.
`--tracing.elastic.serviceenvironment`:
Set the name of the environment Traefik is deployed in, e.g. 'production' or 'staging'.
`--tracing.haystack`:
Settings for Haystack. (Default: ```false```)

View file

@ -570,6 +570,18 @@ Specifies the header name that will be used to store the sampling priority.
`TRAEFIK_TRACING_DATADOG_TRACEIDHEADERNAME`:
Specifies the header name that will be used to store the trace ID.
`TRAEFIK_TRACING_ELASTIC`:
Settings for Elastic. (Default: ```false```)
`TRAEFIK_TRACING_ELASTIC_SECRETTOKEN`:
Set the token used to connect to Elastic APM Server.
`TRAEFIK_TRACING_ELASTIC_SERVERURL`:
Set the URL of the Elastic APM server.
`TRAEFIK_TRACING_ELASTIC_SERVICEENVIRONMENT`:
Set the name of the environment Traefik is deployed in, e.g. 'production' or 'staging'.
`TRAEFIK_TRACING_HAYSTACK`:
Settings for Haystack. (Default: ```false```)

View file

@ -233,6 +233,10 @@
parentIDHeaderName = "foobar"
spanIDHeaderName = "foobar"
baggagePrefixHeaderName = "foobar"
[tracing.elastic]
serverURL = "foobar"
secretToken = "foobar"
serviceEnvironment = "foobar"
[hostResolver]
cnameFlattening = true

View file

@ -238,6 +238,10 @@ tracing:
parentIDHeaderName: foobar
spanIDHeaderName: foobar
baggagePrefixHeaderName: foobar
elastic:
serverURL: foobar
secretToken: foobar
serviceEnvironment: foobar
hostResolver:
cnameFlattening: true
resolvConfig: foobar