Add resourceAttributes option to OTel metrics
Co-authored-by: Romain <rtribotte@users.noreply.github.com>
This commit is contained in:
parent
8c23eb6833
commit
7b78128d4e
14 changed files with 256 additions and 105 deletions
|
|
@ -340,6 +340,54 @@ accesslog:
|
||||||
|
|
||||||
The OpenTelemetry Logger exporter will export access logs to the collector using HTTPS by default to https://localhost:4318/v1/logs, see the [gRPC Section](#grpc-configuration) to use gRPC.
|
The OpenTelemetry Logger exporter will export access logs to the collector using HTTPS by default to https://localhost:4318/v1/logs, see the [gRPC Section](#grpc-configuration) to use gRPC.
|
||||||
|
|
||||||
|
### `serviceName`
|
||||||
|
|
||||||
|
_Optional, Default="traefik"_
|
||||||
|
|
||||||
|
Defines the service name resource attribute.
|
||||||
|
|
||||||
|
```yaml tab="File (YAML)"
|
||||||
|
accesslog:
|
||||||
|
otlp:
|
||||||
|
serviceName: name
|
||||||
|
```
|
||||||
|
|
||||||
|
```toml tab="File (TOML)"
|
||||||
|
[accesslog]
|
||||||
|
[accesslog.otlp]
|
||||||
|
serviceName = "name"
|
||||||
|
```
|
||||||
|
|
||||||
|
```bash tab="CLI"
|
||||||
|
--accesslog.otlp.serviceName=name
|
||||||
|
```
|
||||||
|
|
||||||
|
### `ressourceAttributes`
|
||||||
|
|
||||||
|
_Optional, Default=empty_
|
||||||
|
|
||||||
|
Defines additional resource attributes to be sent to the collector.
|
||||||
|
|
||||||
|
```yaml tab="File (YAML)"
|
||||||
|
accesslog:
|
||||||
|
otlp:
|
||||||
|
resourceAttributes:
|
||||||
|
attr1: foo
|
||||||
|
attr2: bar
|
||||||
|
```
|
||||||
|
|
||||||
|
```toml tab="File (TOML)"
|
||||||
|
[accesslog]
|
||||||
|
[accesslog.otlp.resourceAttributes]
|
||||||
|
attr1 = "foo"
|
||||||
|
attr2 = "bar"
|
||||||
|
```
|
||||||
|
|
||||||
|
```bash tab="CLI"
|
||||||
|
--accesslog.otlp.resourceAttributes.attr1=foo
|
||||||
|
--accesslog.otlp.resourceAttributes.attr2=bar
|
||||||
|
```
|
||||||
|
|
||||||
### HTTP configuration
|
### HTTP configuration
|
||||||
|
|
||||||
_Optional_
|
_Optional_
|
||||||
|
|
|
||||||
|
|
@ -219,6 +219,54 @@ log:
|
||||||
|
|
||||||
The OpenTelemetry Logger exporter will export logs to the collector using HTTPS by default to https://localhost:4318/v1/logs, see the [gRPC Section](#grpc-configuration) to use gRPC.
|
The OpenTelemetry Logger exporter will export logs to the collector using HTTPS by default to https://localhost:4318/v1/logs, see the [gRPC Section](#grpc-configuration) to use gRPC.
|
||||||
|
|
||||||
|
### `serviceName`
|
||||||
|
|
||||||
|
_Optional, Default="traefik"_
|
||||||
|
|
||||||
|
Defines the service name resource attribute.
|
||||||
|
|
||||||
|
```yaml tab="File (YAML)"
|
||||||
|
log:
|
||||||
|
otlp:
|
||||||
|
serviceName: name
|
||||||
|
```
|
||||||
|
|
||||||
|
```toml tab="File (TOML)"
|
||||||
|
[log]
|
||||||
|
[log.otlp]
|
||||||
|
serviceName = "name"
|
||||||
|
```
|
||||||
|
|
||||||
|
```bash tab="CLI"
|
||||||
|
--log.otlp.serviceName=name
|
||||||
|
```
|
||||||
|
|
||||||
|
### `ressourceAttributes`
|
||||||
|
|
||||||
|
_Optional, Default=empty_
|
||||||
|
|
||||||
|
Defines additional resource attributes to be sent to the collector.
|
||||||
|
|
||||||
|
```yaml tab="File (YAML)"
|
||||||
|
log:
|
||||||
|
otlp:
|
||||||
|
resourceAttributes:
|
||||||
|
attr1: foo
|
||||||
|
attr2: bar
|
||||||
|
```
|
||||||
|
|
||||||
|
```toml tab="File (TOML)"
|
||||||
|
[log]
|
||||||
|
[log.otlp.resourceAttributes]
|
||||||
|
attr1 = "foo"
|
||||||
|
attr2 = "bar"
|
||||||
|
```
|
||||||
|
|
||||||
|
```bash tab="CLI"
|
||||||
|
--log.otlp.resourceAttributes.attr1=foo
|
||||||
|
--log.otlp.resourceAttributes.attr2=bar
|
||||||
|
```
|
||||||
|
|
||||||
### HTTP configuration
|
### HTTP configuration
|
||||||
|
|
||||||
_Optional_
|
_Optional_
|
||||||
|
|
|
||||||
|
|
@ -143,7 +143,7 @@ metrics:
|
||||||
|
|
||||||
_Optional, Default="traefik"_
|
_Optional, Default="traefik"_
|
||||||
|
|
||||||
OTEL service name to use.
|
Defines the service name resource attribute.
|
||||||
|
|
||||||
```yaml tab="File (YAML)"
|
```yaml tab="File (YAML)"
|
||||||
metrics:
|
metrics:
|
||||||
|
|
@ -160,6 +160,31 @@ metrics:
|
||||||
```bash tab="CLI"
|
```bash tab="CLI"
|
||||||
--metrics.otlp.serviceName=name
|
--metrics.otlp.serviceName=name
|
||||||
```
|
```
|
||||||
|
#### `ressourceAttributes`
|
||||||
|
|
||||||
|
_Optional, Default=empty_
|
||||||
|
|
||||||
|
Defines additional resource attributes to be sent to the collector.
|
||||||
|
|
||||||
|
```yaml tab="File (YAML)"
|
||||||
|
metrics:
|
||||||
|
otlp:
|
||||||
|
resourceAttributes:
|
||||||
|
attr1: foo
|
||||||
|
attr2: bar
|
||||||
|
```
|
||||||
|
|
||||||
|
```toml tab="File (TOML)"
|
||||||
|
[metrics]
|
||||||
|
[metrics.otlp.resourceAttributes]
|
||||||
|
attr1 = "foo"
|
||||||
|
attr2 = "bar"
|
||||||
|
```
|
||||||
|
|
||||||
|
```bash tab="CLI"
|
||||||
|
--metrics.otlp.resourceAttributes.attr1=foo
|
||||||
|
--metrics.otlp.resourceAttributes.attr2=bar
|
||||||
|
```
|
||||||
|
|
||||||
### HTTP configuration
|
### HTTP configuration
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -97,8 +97,10 @@ log:
|
||||||
#### Configuration Options
|
#### Configuration Options
|
||||||
|
|
||||||
| Field | Description | Default | Required |
|
| Field | Description | Default | Required |
|
||||||
|:-----------|:-----------------------------------------------------------------------------|:--------|:---------|
|
|:---------------------------------------|:---------------------------------------------------------------------------------------------------------------------------------------|:---------------------------------|:---------|
|
||||||
| `log.otlp.http` | This instructs the exporter to send logs to the OpenTelemetry Collector using HTTP.| | No |
|
| `log.otlp.serviceName` | Service name used in selected backend. | "traefik" | No |
|
||||||
|
| `log.otlp.resourceAttributes` | Defines additional resource attributes to be sent to the collector. | [] | No |
|
||||||
|
| `log.otlp.http` | This instructs the exporter to send logs to the OpenTelemetry Collector using HTTP. | | No |
|
||||||
| `log.otlp.http.endpoint` | The endpoint of the OpenTelemetry Collector. (format=`<scheme>://<host>:<port><path>`) | `https://localhost:4318/v1/logs` | No |
|
| `log.otlp.http.endpoint` | The endpoint of the OpenTelemetry Collector. (format=`<scheme>://<host>:<port><path>`) | `https://localhost:4318/v1/logs` | No |
|
||||||
| `log.otlp.http.headers` | Additional headers sent with logs by the exporter to the OpenTelemetry Collector. | [ ] | No |
|
| `log.otlp.http.headers` | Additional headers sent with logs by the exporter to the OpenTelemetry Collector. | [ ] | No |
|
||||||
| `log.otlp.http.tls` | Defines the Client TLS configuration used by the exporter to send logs to the OpenTelemetry Collector. | | No |
|
| `log.otlp.http.tls` | Defines the Client TLS configuration used by the exporter to send logs to the OpenTelemetry Collector. | | No |
|
||||||
|
|
@ -106,7 +108,7 @@ log:
|
||||||
| `log.otlp.http.tls.cert` | The path to the certificate to use for the OpenTelemetry Collector. | | No |
|
| `log.otlp.http.tls.cert` | The path to the certificate to use for the OpenTelemetry Collector. | | No |
|
||||||
| `log.otlp.http.tls.key` | The path to the key to use for the OpenTelemetry Collector. | | No |
|
| `log.otlp.http.tls.key` | The path to the key to use for the OpenTelemetry Collector. | | No |
|
||||||
| `log.otlp.http.tls.insecureSkipVerify` | Instructs the OpenTelemetry Collector to accept any certificate presented by the server regardless of the hostname in the certificate. | false | No |
|
| `log.otlp.http.tls.insecureSkipVerify` | Instructs the OpenTelemetry Collector to accept any certificate presented by the server regardless of the hostname in the certificate. | false | No |
|
||||||
| `log.otlp.grpc` | This instructs the exporter to send logs to the OpenTelemetry Collector using gRPC.| | No |
|
| `log.otlp.grpc` | This instructs the exporter to send logs to the OpenTelemetry Collector using gRPC. | | No |
|
||||||
| `log.otlp.grpc.endpoint` | The endpoint of the OpenTelemetry Collector. (format=`<host>:<port>`) | `localhost:4317` | No |
|
| `log.otlp.grpc.endpoint` | The endpoint of the OpenTelemetry Collector. (format=`<host>:<port>`) | `localhost:4317` | No |
|
||||||
| `log.otlp.grpc.headers` | Additional headers sent with logs by the exporter to the OpenTelemetry Collector. | [ ] | No |
|
| `log.otlp.grpc.headers` | Additional headers sent with logs by the exporter to the OpenTelemetry Collector. | [ ] | No |
|
||||||
| `log.otlp.grpc.insecure` | Instructs the exporter to send logs to the OpenTelemetry Collector using an insecure protocol. | false | No |
|
| `log.otlp.grpc.insecure` | Instructs the exporter to send logs to the OpenTelemetry Collector using an insecure protocol. | false | No |
|
||||||
|
|
@ -257,8 +259,10 @@ accesslog:
|
||||||
#### Configuration Options
|
#### Configuration Options
|
||||||
|
|
||||||
| Field | Description | Default | Required |
|
| Field | Description | Default | Required |
|
||||||
|:-----------|:--------------------------|:--------|:---------|
|
|:---------------------------------------------|:---------------------------------------------------------------------------------------------------------------------------------------|:---------------------------------|:---------|
|
||||||
| `accesslog.otlp.http` | This instructs the exporter to send access logs to the OpenTelemetry Collector using HTTP.| | No |
|
| `accesslog.otlp.serviceName` | Defines the service name resource attribute. | "traefik" | No |
|
||||||
|
| `accesslog.otlp.resourceAttributes` | Defines additional resource attributes to be sent to the collector. | [] | No |
|
||||||
|
| `accesslog.otlp.http` | This instructs the exporter to send access logs to the OpenTelemetry Collector using HTTP. | | No |
|
||||||
| `accesslog.otlp.http.endpoint` | The endpoint of the OpenTelemetry Collector. (format=`<scheme>://<host>:<port><path>`) | `https://localhost:4318/v1/logs` | No |
|
| `accesslog.otlp.http.endpoint` | The endpoint of the OpenTelemetry Collector. (format=`<scheme>://<host>:<port><path>`) | `https://localhost:4318/v1/logs` | No |
|
||||||
| `accesslog.otlp.http.headers` | Additional headers sent with access logs by the exporter to the OpenTelemetry Collector. | [ ] | No |
|
| `accesslog.otlp.http.headers` | Additional headers sent with access logs by the exporter to the OpenTelemetry Collector. | [ ] | No |
|
||||||
| `accesslog.otlp.http.tls` | Defines the Client TLS configuration used by the exporter to send access logs to the OpenTelemetry Collector. | | No |
|
| `accesslog.otlp.http.tls` | Defines the Client TLS configuration used by the exporter to send access logs to the OpenTelemetry Collector. | | No |
|
||||||
|
|
@ -266,7 +270,7 @@ accesslog:
|
||||||
| `accesslog.otlp.http.tls.cert` | The path to the certificate to use for the OpenTelemetry Collector. | | No |
|
| `accesslog.otlp.http.tls.cert` | The path to the certificate to use for the OpenTelemetry Collector. | | No |
|
||||||
| `accesslog.otlp.http.tls.key` | The path to the key to use for the OpenTelemetry Collector. | | No |
|
| `accesslog.otlp.http.tls.key` | The path to the key to use for the OpenTelemetry Collector. | | No |
|
||||||
| `accesslog.otlp.http.tls.insecureSkipVerify` | Instructs the OpenTelemetry Collector to accept any certificate presented by the server regardless of the hostname in the certificate. | false | No |
|
| `accesslog.otlp.http.tls.insecureSkipVerify` | Instructs the OpenTelemetry Collector to accept any certificate presented by the server regardless of the hostname in the certificate. | false | No |
|
||||||
| `accesslog.otlp.grpc` | This instructs the exporter to send access logs to the OpenTelemetry Collector using gRPC.| | No |
|
| `accesslog.otlp.grpc` | This instructs the exporter to send access logs to the OpenTelemetry Collector using gRPC. | | No |
|
||||||
| `accesslog.otlp.grpc.endpoint` | The endpoint of the OpenTelemetry Collector. (format=`<host>:<port>`) | `localhost:4317` | No |
|
| `accesslog.otlp.grpc.endpoint` | The endpoint of the OpenTelemetry Collector. (format=`<host>:<port>`) | `localhost:4317` | No |
|
||||||
| `accesslog.otlp.grpc.headers` | Additional headers sent with access logs by the exporter to the OpenTelemetry Collector. | [ ] | No |
|
| `accesslog.otlp.grpc.headers` | Additional headers sent with access logs by the exporter to the OpenTelemetry Collector. | [ ] | No |
|
||||||
| `accesslog.otlp.grpc.insecure` | Instructs the exporter to send access logs to the OpenTelemetry Collector using an insecure protocol. | false | No |
|
| `accesslog.otlp.grpc.insecure` | Instructs the exporter to send access logs to the OpenTelemetry Collector using an insecure protocol. | false | No |
|
||||||
|
|
|
||||||
|
|
@ -61,11 +61,13 @@ metrics:
|
||||||
### Configuration Options
|
### Configuration Options
|
||||||
|
|
||||||
| Field | Description | Default | Required |
|
| Field | Description | Default | Required |
|
||||||
|:-----------|---------------|:--------|:---------|
|
|:-------------------------------------------|------------------------------------------------------------------------------------------------------------------------------------------------------------------|:---------------------------------------------------|:---------|
|
||||||
| `metrics.addInternals` | Enables metrics for internal resources (e.g.: `ping@internal`). | false | No |
|
| `metrics.addInternals` | Enables metrics for internal resources (e.g.: `ping@internal`). | false | No |
|
||||||
|
| `metrics.otlp.serviceName` | Defines the service name resource attribute. | "traefik" | No |
|
||||||
|
| `metrics.otlp.resourceAttributes` | Defines additional resource attributes to be sent to the collector. | [] | No |
|
||||||
| `metrics.otlp.addEntryPointsLabels` | Enable metrics on entry points. | true | No |
|
| `metrics.otlp.addEntryPointsLabels` | Enable metrics on entry points. | true | No |
|
||||||
| `metrics.otlp.addRoutersLabels` | Enable metrics on routers. | false | No |
|
| `metrics.otlp.addRoutersLabels` | Enable metrics on routers. | false | No |
|
||||||
| `metrics.otlp.addServicesLabels` | Enable metrics on services.| true | No |
|
| `metrics.otlp.addServicesLabels` | Enable metrics on services. | true | No |
|
||||||
| `metrics.otlp.explicitBoundaries` | Explicit boundaries for Histogram data points. | ".005, .01, .025, .05, .1, .25, .5, 1, 2.5, 5, 10" | No |
|
| `metrics.otlp.explicitBoundaries` | Explicit boundaries for Histogram data points. | ".005, .01, .025, .05, .1, .25, .5, 1, 2.5, 5, 10" | No |
|
||||||
| `metrics.otlp.pushInterval` | Interval at which metrics are sent to the OpenTelemetry Collector. | 10s | No |
|
| `metrics.otlp.pushInterval` | Interval at which metrics are sent to the OpenTelemetry Collector. | 10s | No |
|
||||||
| `metrics.otlp.http` | This instructs the exporter to send the metrics to the OpenTelemetry Collector using HTTP.<br /> Setting the sub-options with their default values. | null/false | No |
|
| `metrics.otlp.http` | This instructs the exporter to send the metrics to the OpenTelemetry Collector using HTTP.<br /> Setting the sub-options with their default values. | null/false | No |
|
||||||
|
|
@ -78,7 +80,7 @@ metrics:
|
||||||
| `metrics.otlp.grpc` | This instructs the exporter to send metrics to the OpenTelemetry Collector using gRPC. | null/false | No |
|
| `metrics.otlp.grpc` | This instructs the exporter to send metrics to the OpenTelemetry Collector using gRPC. | null/false | No |
|
||||||
| `metrics.otlp.grpc.endpoint` | Address of the OpenTelemetry Collector to send metrics to.<br /> Format="`<host>:<port>`" | "localhost:4317" | Yes |
|
| `metrics.otlp.grpc.endpoint` | Address of the OpenTelemetry Collector to send metrics to.<br /> Format="`<host>:<port>`" | "localhost:4317" | Yes |
|
||||||
| `metrics.otlp.grpc.headers` | Additional headers sent with metrics by the exporter to the OpenTelemetry Collector. | - | No |
|
| `metrics.otlp.grpc.headers` | Additional headers sent with metrics by the exporter to the OpenTelemetry Collector. | - | No |
|
||||||
| `metrics.otlp.http.grpc.insecure` |Allows exporter to send metrics to the OpenTelemetry Collector without using a secured protocol. | false | Yes |
|
| `metrics.otlp.http.grpc.insecure` | Allows exporter to send metrics to the OpenTelemetry Collector without using a secured protocol. | false | Yes |
|
||||||
| `metrics.otlp.grpc.tls.ca` | Path to the certificate authority used for the secure connection to the OpenTelemetry Collector,<br />it defaults to the system bundle. | - | No |
|
| `metrics.otlp.grpc.tls.ca` | Path to the certificate authority used for the secure connection to the OpenTelemetry Collector,<br />it defaults to the system bundle. | - | No |
|
||||||
| `metrics.otlp.grpc.tls.cert` | Path to the public certificate used for the secure connection to the OpenTelemetry Collector.<br />When using this option, setting the `key` option is required. | - | No |
|
| `metrics.otlp.grpc.tls.cert` | Path to the public certificate used for the secure connection to the OpenTelemetry Collector.<br />When using this option, setting the `key` option is required. | - | No |
|
||||||
| `metrics.otlp.grpc.tls.key` | This instructs the exporter to send the metrics to the OpenTelemetry Collector using HTTP.<br /> Setting the sub-options with their default values. | null/false | No |
|
| `metrics.otlp.grpc.tls.key` | This instructs the exporter to send the metrics to the OpenTelemetry Collector using HTTP.<br /> Setting the sub-options with their default values. | null/false | No |
|
||||||
|
|
|
||||||
|
|
@ -37,13 +37,13 @@ tracing: {}
|
||||||
## Configuration Options
|
## Configuration Options
|
||||||
|
|
||||||
| Field | Description | Default | Required |
|
| Field | Description | Default | Required |
|
||||||
|:-------------------------------------------|:--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|:-----------------------------------|:---------|
|
|:-------------------------------------------|:----------------------------------------------------------------------------------------------------------------------------------------------------------------------------|:-----------------------------------|:---------|
|
||||||
| `tracing.addInternals` | Enables tracing for internal resources (e.g.: `ping@internal`). | false | No |
|
| `tracing.addInternals` | Enables tracing for internal resources (e.g.: `ping@internal`). | false | No |
|
||||||
| `tracing.serviceName` | Service name used in selected backend. | "traefik" | No |
|
| `tracing.serviceName` | Defines the service name resource attribute. | "traefik" | No |
|
||||||
| `tracing.sampleRate` | The proportion of requests to trace, specified between 0.0 and 1.0. | 1.0 | No |
|
|
||||||
| `tracing.resourceAttributes` | Defines additional resource attributes to be sent to the collector. | [] | No |
|
| `tracing.resourceAttributes` | Defines additional resource attributes to be sent to the collector. | [] | No |
|
||||||
| `tracing.capturedRequestHeaders` | Defines the list of request headers to add as attributes.<br />It applies to client and server kind spans.| [] | No |
|
| `tracing.sampleRate` | The proportion of requests to trace, specified between 0.0 and 1.0. | 1.0 | No |
|
||||||
| `tracing.capturedResponseHeaders` | Defines the list of response headers to add as attributes.<br />It applies to client and server kind spans.| [] |False |
|
| `tracing.capturedRequestHeaders` | Defines the list of request headers to add as attributes.<br />It applies to client and server kind spans. | [] | No |
|
||||||
|
| `tracing.capturedResponseHeaders` | Defines the list of response headers to add as attributes.<br />It applies to client and server kind spans. | [] | False |
|
||||||
| `tracing.safeQueryParams` | By default, all query parameters are redacted.<br />Defines the list of query parameters to not redact. | [] | No |
|
| `tracing.safeQueryParams` | By default, all query parameters are redacted.<br />Defines the list of query parameters to not redact. | [] | No |
|
||||||
| `tracing.otlp.http` | This instructs the exporter to send the tracing to the OpenTelemetry Collector using HTTP.<br /> Setting the sub-options with their default values. | null/false | No |
|
| `tracing.otlp.http` | This instructs the exporter to send the tracing to the OpenTelemetry Collector using HTTP.<br /> Setting the sub-options with their default values. | null/false | No |
|
||||||
| `tracing.otlp.http.endpoint` | URL of the OpenTelemetry Collector to send tracing to.<br /> Format="`<scheme>://<host>:<port><path>`" | "http://localhost:4318/v1/tracing" | Yes |
|
| `tracing.otlp.http.endpoint` | URL of the OpenTelemetry Collector to send tracing to.<br /> Format="`<scheme>://<host>:<port><path>`" | "http://localhost:4318/v1/tracing" | Yes |
|
||||||
|
|
@ -51,12 +51,12 @@ tracing: {}
|
||||||
| `tracing.otlp.http.tls.ca` | Path to the certificate authority used for the secure connection to the OpenTelemetry Collector, it defaults to the system bundle. | "" | No |
|
| `tracing.otlp.http.tls.ca` | Path to the certificate authority used for the secure connection to the OpenTelemetry Collector, it defaults to the system bundle. | "" | No |
|
||||||
| `tracing.otlp.http.tls.cert` | Path to the public certificate used for the secure connection to the OpenTelemetry Collector. When using this option, setting the `key` option is required. | "" | No |
|
| `tracing.otlp.http.tls.cert` | Path to the public certificate used for the secure connection to the OpenTelemetry Collector. When using this option, setting the `key` option is required. | "" | No |
|
||||||
| `tracing.otlp.http.tls.key` | This instructs the exporter to send the tracing to the OpenTelemetry Collector using HTTP.<br /> Setting the sub-options with their default values. | ""null/false "" | No |
|
| `tracing.otlp.http.tls.key` | This instructs the exporter to send the tracing to the OpenTelemetry Collector using HTTP.<br /> Setting the sub-options with their default values. | ""null/false "" | No |
|
||||||
| `tracing.otlp.http.tls.insecureskipverify` |If `insecureSkipVerify` is `true`, the TLS connection to the OpenTelemetry Collector accepts any certificate presented by the server regardless of the hostnames it covers. | false | Yes |
|
| `tracing.otlp.http.tls.insecureskipverify` | If `insecureSkipVerify` is `true`, the TLS connection to the OpenTelemetry Collector accepts any certificate presented by the server regardless of the hostnames it covers. | false | Yes |
|
||||||
| `tracing.otlp.grpc` | This instructs the exporter to send tracing to the OpenTelemetry Collector using gRPC. | false | No |
|
| `tracing.otlp.grpc` | This instructs the exporter to send tracing to the OpenTelemetry Collector using gRPC. | false | No |
|
||||||
| `tracing.otlp.grpc.endpoint` | Address of the OpenTelemetry Collector to send tracing to.<br /> Format="`<host>:<port>`" | "localhost:4317" | Yes |
|
| `tracing.otlp.grpc.endpoint` | Address of the OpenTelemetry Collector to send tracing to.<br /> Format="`<host>:<port>`" | "localhost:4317" | Yes |
|
||||||
| `tracing.otlp.grpc.headers` | Additional headers sent with tracing by the exporter to the OpenTelemetry Collector. | [] | No |
|
| `tracing.otlp.grpc.headers` | Additional headers sent with tracing by the exporter to the OpenTelemetry Collector. | [] | No |
|
||||||
| `tracing.otlp.grpc.insecure` |Allows exporter to send tracing to the OpenTelemetry Collector without using a secured protocol. | false | Yes |
|
| `tracing.otlp.grpc.insecure` | Allows exporter to send tracing to the OpenTelemetry Collector without using a secured protocol. | false | Yes |
|
||||||
| `tracing.otlp.grpc.tls.ca` | Path to the certificate authority used for the secure connection to the OpenTelemetry Collector, it defaults to the system bundle. | "" | No |
|
| `tracing.otlp.grpc.tls.ca` | Path to the certificate authority used for the secure connection to the OpenTelemetry Collector, it defaults to the system bundle. | "" | No |
|
||||||
| `tracing.otlp.grpc.tls.cert` | Path to the public certificate used for the secure connection to the OpenTelemetry Collector. When using this option, setting the `key` option is required. | "" | No |
|
| `tracing.otlp.grpc.tls.cert` | Path to the public certificate used for the secure connection to the OpenTelemetry Collector. When using this option, setting the `key` option is required. | "" | No |
|
||||||
| `tracing.otlp.grpc.tls.key` | This instructs the exporter to send the tracing to the OpenTelemetry Collector using HTTP.<br /> Setting the sub-options with their default values. | ""null/false "" | No |
|
| `tracing.otlp.grpc.tls.key` | This instructs the exporter to send the tracing to the OpenTelemetry Collector using HTTP.<br /> Setting the sub-options with their default values. | ""null/false "" | No |
|
||||||
| `tracing.otlp.grpc.tls.insecureskipverify` |If `insecureSkipVerify` is `true`, the TLS connection to the OpenTelemetry Collector accepts any certificate presented by the server regardless of the hostnames it covers. | false | Yes |
|
| `tracing.otlp.grpc.tls.insecureskipverify` | If `insecureSkipVerify` is `true`, the TLS connection to the OpenTelemetry Collector accepts any certificate presented by the server regardless of the hostnames it covers. | false | Yes |
|
||||||
|
|
|
||||||
|
|
@ -91,7 +91,7 @@ TLS key
|
||||||
Defines additional resource attributes (key:value).
|
Defines additional resource attributes (key:value).
|
||||||
|
|
||||||
`--accesslog.otlp.servicename`:
|
`--accesslog.otlp.servicename`:
|
||||||
Set the name for this service. (Default: ```traefik```)
|
Defines the service name resource attribute. (Default: ```traefik```)
|
||||||
|
|
||||||
`--api`:
|
`--api`:
|
||||||
Enable api/dashboard. (Default: ```false```)
|
Enable api/dashboard. (Default: ```false```)
|
||||||
|
|
@ -481,7 +481,7 @@ TLS key
|
||||||
Defines additional resource attributes (key:value).
|
Defines additional resource attributes (key:value).
|
||||||
|
|
||||||
`--log.otlp.servicename`:
|
`--log.otlp.servicename`:
|
||||||
Set the name for this service. (Default: ```traefik```)
|
Defines the service name resource attribute. (Default: ```traefik```)
|
||||||
|
|
||||||
`--metrics.addinternals`:
|
`--metrics.addinternals`:
|
||||||
Enables metrics for internal services (ping, dashboard, etc...). (Default: ```false```)
|
Enables metrics for internal services (ping, dashboard, etc...). (Default: ```false```)
|
||||||
|
|
@ -600,8 +600,11 @@ TLS key
|
||||||
`--metrics.otlp.pushinterval`:
|
`--metrics.otlp.pushinterval`:
|
||||||
Period between calls to collect a checkpoint. (Default: ```10```)
|
Period between calls to collect a checkpoint. (Default: ```10```)
|
||||||
|
|
||||||
|
`--metrics.otlp.resourceattributes.<name>`:
|
||||||
|
Defines additional resource attributes (key:value).
|
||||||
|
|
||||||
`--metrics.otlp.servicename`:
|
`--metrics.otlp.servicename`:
|
||||||
OTEL service name to use. (Default: ```traefik```)
|
Defines the service name resource attribute. (Default: ```traefik```)
|
||||||
|
|
||||||
`--metrics.prometheus`:
|
`--metrics.prometheus`:
|
||||||
Prometheus metrics exporter type. (Default: ```false```)
|
Prometheus metrics exporter type. (Default: ```false```)
|
||||||
|
|
@ -1414,4 +1417,4 @@ Query params to not redact.
|
||||||
Sets the rate between 0.0 and 1.0 of requests to trace. (Default: ```1.000000```)
|
Sets the rate between 0.0 and 1.0 of requests to trace. (Default: ```1.000000```)
|
||||||
|
|
||||||
`--tracing.servicename`:
|
`--tracing.servicename`:
|
||||||
Sets the name for this service. (Default: ```traefik```)
|
Defines the service name resource attribute. (Default: ```traefik```)
|
||||||
|
|
|
||||||
|
|
@ -91,7 +91,7 @@ TLS key
|
||||||
Defines additional resource attributes (key:value).
|
Defines additional resource attributes (key:value).
|
||||||
|
|
||||||
`TRAEFIK_ACCESSLOG_OTLP_SERVICENAME`:
|
`TRAEFIK_ACCESSLOG_OTLP_SERVICENAME`:
|
||||||
Set the name for this service. (Default: ```traefik```)
|
Defines the service name resource attribute. (Default: ```traefik```)
|
||||||
|
|
||||||
`TRAEFIK_API`:
|
`TRAEFIK_API`:
|
||||||
Enable api/dashboard. (Default: ```false```)
|
Enable api/dashboard. (Default: ```false```)
|
||||||
|
|
@ -481,7 +481,7 @@ TLS key
|
||||||
Defines additional resource attributes (key:value).
|
Defines additional resource attributes (key:value).
|
||||||
|
|
||||||
`TRAEFIK_LOG_OTLP_SERVICENAME`:
|
`TRAEFIK_LOG_OTLP_SERVICENAME`:
|
||||||
Set the name for this service. (Default: ```traefik```)
|
Defines the service name resource attribute. (Default: ```traefik```)
|
||||||
|
|
||||||
`TRAEFIK_METRICS_ADDINTERNALS`:
|
`TRAEFIK_METRICS_ADDINTERNALS`:
|
||||||
Enables metrics for internal services (ping, dashboard, etc...). (Default: ```false```)
|
Enables metrics for internal services (ping, dashboard, etc...). (Default: ```false```)
|
||||||
|
|
@ -600,8 +600,11 @@ TLS key
|
||||||
`TRAEFIK_METRICS_OTLP_PUSHINTERVAL`:
|
`TRAEFIK_METRICS_OTLP_PUSHINTERVAL`:
|
||||||
Period between calls to collect a checkpoint. (Default: ```10```)
|
Period between calls to collect a checkpoint. (Default: ```10```)
|
||||||
|
|
||||||
|
`TRAEFIK_METRICS_OTLP_RESOURCEATTRIBUTES_<NAME>`:
|
||||||
|
Defines additional resource attributes (key:value).
|
||||||
|
|
||||||
`TRAEFIK_METRICS_OTLP_SERVICENAME`:
|
`TRAEFIK_METRICS_OTLP_SERVICENAME`:
|
||||||
OTEL service name to use. (Default: ```traefik```)
|
Defines the service name resource attribute. (Default: ```traefik```)
|
||||||
|
|
||||||
`TRAEFIK_METRICS_PROMETHEUS`:
|
`TRAEFIK_METRICS_PROMETHEUS`:
|
||||||
Prometheus metrics exporter type. (Default: ```false```)
|
Prometheus metrics exporter type. (Default: ```false```)
|
||||||
|
|
@ -1414,4 +1417,4 @@ Query params to not redact.
|
||||||
Sets the rate between 0.0 and 1.0 of requests to trace. (Default: ```1.000000```)
|
Sets the rate between 0.0 and 1.0 of requests to trace. (Default: ```1.000000```)
|
||||||
|
|
||||||
`TRAEFIK_TRACING_SERVICENAME`:
|
`TRAEFIK_TRACING_SERVICENAME`:
|
||||||
Sets the name for this service. (Default: ```traefik```)
|
Defines the service name resource attribute. (Default: ```traefik```)
|
||||||
|
|
|
||||||
|
|
@ -388,6 +388,9 @@
|
||||||
[metrics.otlp.http.headers]
|
[metrics.otlp.http.headers]
|
||||||
name0 = "foobar"
|
name0 = "foobar"
|
||||||
name1 = "foobar"
|
name1 = "foobar"
|
||||||
|
[metrics.otlp.resourceAttributes]
|
||||||
|
name0 = "foobar"
|
||||||
|
name1 = "foobar"
|
||||||
|
|
||||||
[ping]
|
[ping]
|
||||||
entryPoint = "foobar"
|
entryPoint = "foobar"
|
||||||
|
|
|
||||||
|
|
@ -429,6 +429,9 @@ metrics:
|
||||||
- 42
|
- 42
|
||||||
pushInterval: 42s
|
pushInterval: 42s
|
||||||
serviceName: foobar
|
serviceName: foobar
|
||||||
|
resourceAttributes:
|
||||||
|
name0: foobar
|
||||||
|
name1: foobar
|
||||||
ping:
|
ping:
|
||||||
entryPoint: foobar
|
entryPoint: foobar
|
||||||
manualRouting: true
|
manualRouting: true
|
||||||
|
|
|
||||||
|
|
@ -205,7 +205,7 @@ func (a *LifeCycle) SetDefaults() {
|
||||||
|
|
||||||
// Tracing holds the tracing configuration.
|
// Tracing holds the tracing configuration.
|
||||||
type Tracing struct {
|
type Tracing struct {
|
||||||
ServiceName string `description:"Sets the name for this service." json:"serviceName,omitempty" toml:"serviceName,omitempty" yaml:"serviceName,omitempty" export:"true"`
|
ServiceName string `description:"Defines the service name resource attribute." json:"serviceName,omitempty" toml:"serviceName,omitempty" yaml:"serviceName,omitempty" export:"true"`
|
||||||
ResourceAttributes map[string]string `description:"Defines additional resource attributes (key:value)." json:"resourceAttributes,omitempty" toml:"resourceAttributes,omitempty" yaml:"resourceAttributes,omitempty" export:"true"`
|
ResourceAttributes map[string]string `description:"Defines additional resource attributes (key:value)." json:"resourceAttributes,omitempty" toml:"resourceAttributes,omitempty" yaml:"resourceAttributes,omitempty" export:"true"`
|
||||||
CapturedRequestHeaders []string `description:"Request headers to add as attributes for server and client spans." json:"capturedRequestHeaders,omitempty" toml:"capturedRequestHeaders,omitempty" yaml:"capturedRequestHeaders,omitempty" export:"true"`
|
CapturedRequestHeaders []string `description:"Request headers to add as attributes for server and client spans." json:"capturedRequestHeaders,omitempty" toml:"capturedRequestHeaders,omitempty" yaml:"capturedRequestHeaders,omitempty" export:"true"`
|
||||||
CapturedResponseHeaders []string `description:"Response headers to add as attributes for server and client spans." json:"capturedResponseHeaders,omitempty" toml:"capturedResponseHeaders,omitempty" yaml:"capturedResponseHeaders,omitempty" export:"true"`
|
CapturedResponseHeaders []string `description:"Response headers to add as attributes for server and client spans." json:"capturedResponseHeaders,omitempty" toml:"capturedResponseHeaders,omitempty" yaml:"capturedResponseHeaders,omitempty" export:"true"`
|
||||||
|
|
|
||||||
|
|
@ -206,15 +206,26 @@ func newOpenTelemetryMeterProvider(ctx context.Context, config *types.OTLP) (*sd
|
||||||
return nil, fmt.Errorf("creating exporter: %w", err)
|
return nil, fmt.Errorf("creating exporter: %w", err)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
var resAttrs []attribute.KeyValue
|
||||||
|
for k, v := range config.ResourceAttributes {
|
||||||
|
resAttrs = append(resAttrs, attribute.String(k, v))
|
||||||
|
}
|
||||||
|
|
||||||
res, err := resource.New(ctx,
|
res, err := resource.New(ctx,
|
||||||
resource.WithAttributes(semconv.ServiceNameKey.String(config.ServiceName)),
|
|
||||||
resource.WithAttributes(semconv.ServiceVersionKey.String(version.Version)),
|
|
||||||
resource.WithContainer(),
|
resource.WithContainer(),
|
||||||
resource.WithFromEnv(),
|
|
||||||
resource.WithHost(),
|
resource.WithHost(),
|
||||||
resource.WithOS(),
|
resource.WithOS(),
|
||||||
resource.WithProcess(),
|
resource.WithProcess(),
|
||||||
resource.WithTelemetrySDK(),
|
resource.WithTelemetrySDK(),
|
||||||
|
// The following order allows the user to override the service name and version,
|
||||||
|
// as well as any other attributes set by the above detectors.
|
||||||
|
resource.WithAttributes(
|
||||||
|
semconv.ServiceName(config.ServiceName),
|
||||||
|
semconv.ServiceVersion(version.Version),
|
||||||
|
),
|
||||||
|
resource.WithAttributes(resAttrs...),
|
||||||
|
// Use the environment variables to allow overriding above resource attributes.
|
||||||
|
resource.WithFromEnv(),
|
||||||
)
|
)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, fmt.Errorf("building resource: %w", err)
|
return nil, fmt.Errorf("building resource: %w", err)
|
||||||
|
|
|
||||||
|
|
@ -150,7 +150,7 @@ func checkFieldHeaderValue(value, defaultValue string) string {
|
||||||
|
|
||||||
// OTelLog provides configuration settings for the open-telemetry logger.
|
// OTelLog provides configuration settings for the open-telemetry logger.
|
||||||
type OTelLog struct {
|
type OTelLog struct {
|
||||||
ServiceName string `description:"Set the name for this service." json:"serviceName,omitempty" toml:"serviceName,omitempty" yaml:"serviceName,omitempty" export:"true"`
|
ServiceName string `description:"Defines the service name resource attribute." json:"serviceName,omitempty" toml:"serviceName,omitempty" yaml:"serviceName,omitempty" export:"true"`
|
||||||
ResourceAttributes map[string]string `description:"Defines additional resource attributes (key:value)." json:"resourceAttributes,omitempty" toml:"resourceAttributes,omitempty" yaml:"resourceAttributes,omitempty"`
|
ResourceAttributes map[string]string `description:"Defines additional resource attributes (key:value)." json:"resourceAttributes,omitempty" toml:"resourceAttributes,omitempty" yaml:"resourceAttributes,omitempty"`
|
||||||
GRPC *OTelGRPC `description:"gRPC configuration for the OpenTelemetry collector." json:"grpc,omitempty" toml:"grpc,omitempty" yaml:"grpc,omitempty" label:"allowEmpty" file:"allowEmpty" export:"true"`
|
GRPC *OTelGRPC `description:"gRPC configuration for the OpenTelemetry collector." json:"grpc,omitempty" toml:"grpc,omitempty" yaml:"grpc,omitempty" label:"allowEmpty" file:"allowEmpty" export:"true"`
|
||||||
HTTP *OTelHTTP `description:"HTTP configuration for the OpenTelemetry collector." json:"http,omitempty" toml:"http,omitempty" yaml:"http,omitempty" label:"allowEmpty" file:"allowEmpty" export:"true"`
|
HTTP *OTelHTTP `description:"HTTP configuration for the OpenTelemetry collector." json:"http,omitempty" toml:"http,omitempty" yaml:"http,omitempty" label:"allowEmpty" file:"allowEmpty" export:"true"`
|
||||||
|
|
|
||||||
|
|
@ -116,7 +116,8 @@ type OTLP struct {
|
||||||
AddServicesLabels bool `description:"Enable metrics on services." json:"addServicesLabels,omitempty" toml:"addServicesLabels,omitempty" yaml:"addServicesLabels,omitempty" export:"true"`
|
AddServicesLabels bool `description:"Enable metrics on services." json:"addServicesLabels,omitempty" toml:"addServicesLabels,omitempty" yaml:"addServicesLabels,omitempty" export:"true"`
|
||||||
ExplicitBoundaries []float64 `description:"Boundaries for latency metrics." json:"explicitBoundaries,omitempty" toml:"explicitBoundaries,omitempty" yaml:"explicitBoundaries,omitempty" export:"true"`
|
ExplicitBoundaries []float64 `description:"Boundaries for latency metrics." json:"explicitBoundaries,omitempty" toml:"explicitBoundaries,omitempty" yaml:"explicitBoundaries,omitempty" export:"true"`
|
||||||
PushInterval types.Duration `description:"Period between calls to collect a checkpoint." json:"pushInterval,omitempty" toml:"pushInterval,omitempty" yaml:"pushInterval,omitempty" export:"true"`
|
PushInterval types.Duration `description:"Period between calls to collect a checkpoint." json:"pushInterval,omitempty" toml:"pushInterval,omitempty" yaml:"pushInterval,omitempty" export:"true"`
|
||||||
ServiceName string `description:"OTEL service name to use." json:"serviceName,omitempty" toml:"serviceName,omitempty" yaml:"serviceName,omitempty" export:"true"`
|
ServiceName string `description:"Defines the service name resource attribute." json:"serviceName,omitempty" toml:"serviceName,omitempty" yaml:"serviceName,omitempty" export:"true"`
|
||||||
|
ResourceAttributes map[string]string `description:"Defines additional resource attributes (key:value)." json:"resourceAttributes,omitempty" toml:"resourceAttributes,omitempty" yaml:"resourceAttributes,omitempty" export:"true"`
|
||||||
}
|
}
|
||||||
|
|
||||||
// SetDefaults sets the default values.
|
// SetDefaults sets the default values.
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue