diff --git a/extension/observer/dockerobserver/README.md b/extension/observer/dockerobserver/README.md index 66c77fd5aa64..280686aa24f4 100644 --- a/extension/observer/dockerobserver/README.md +++ b/extension/observer/dockerobserver/README.md @@ -32,7 +32,7 @@ extensions: # list of container image names to exclude excluded_images: ['redis', 'another_image_name'] # client API version, default to 1.24 - api_version: 1.25 + api_version: "1.25" # max amount of time to wait for a response from Docker API , default to 5s timeout: 15s @@ -63,9 +63,9 @@ default: `5s` ### `api_version` -The client API version. If using one with a terminating zero, input as a string to prevent undesired truncation (e.g. `"1.40"` instead of `1.40`, which is parsed as `1.4`). +The client API version. Make sure you input it as a string instead of a float (e.g. `"1.4"` instead of `1.4`). -default: `1.24` +default: `"1.24"` ### `excluded_images` diff --git a/extension/observer/dockerobserver/config_test.go b/extension/observer/dockerobserver/config_test.go index bc6e0a971d12..768cf8aa1a47 100644 --- a/extension/observer/dockerobserver/config_test.go +++ b/extension/observer/dockerobserver/config_test.go @@ -43,16 +43,6 @@ func TestLoadConfig(t *testing.T) { DockerAPIVersion: version, }, }, - { - id: component.NewIDWithName(metadata.Type, "unsupported_api_version"), - expected: &Config{ - Endpoint: "unix:///var/run/docker.sock", - CacheSyncInterval: time.Hour, - Timeout: 5 * time.Second, - DockerAPIVersion: "1.4", - }, - expectedError: `"api_version" 1.4 must be at least 1.24`, - }, } for _, tt := range tests { t.Run(tt.id.String(), func(t *testing.T) { diff --git a/extension/observer/dockerobserver/testdata/config.yaml b/extension/observer/dockerobserver/testdata/config.yaml index 1e27aa54fdf0..1f82c45dfc12 100644 --- a/extension/observer/dockerobserver/testdata/config.yaml +++ b/extension/observer/dockerobserver/testdata/config.yaml @@ -16,6 +16,3 @@ docker_observer/ignore_non_host_bindings: ignore_non_host_bindings: true docker_observer/exclude_nginx: excluded_images: ["nginx"] -docker_observer/unsupported_api_version: - # intentionally a float since it will be parsed as 1.4 - api_version: 1.40 diff --git a/receiver/dockerstatsreceiver/README.md b/receiver/dockerstatsreceiver/README.md index 4057046fad9f..f7de56c72f7d 100644 --- a/receiver/dockerstatsreceiver/README.md +++ b/receiver/dockerstatsreceiver/README.md @@ -40,7 +40,7 @@ only unmatched container image names should be excluded. - Globs are non-regex items (e.g. `/items/`) containing any of the following: `*[]{}?`. Negations are supported: `!my*container` will exclude all containers whose image name doesn't match the blob `my*container`. - `timeout` (default = `5s`): The request timeout for any docker daemon query. -- `api_version` (default = `1.25`): The Docker client API version (must be 1.25+). If using one with a terminating zero, input as a string to prevent undesired truncation (e.g. `"1.40"` instead of `1.40`, which is parsed as `1.4`). [Docker API versions](https://docs.docker.com/engine/api/). +- `api_version` (default = `"1.25"`): The Docker client API version (must be 1.25+). Must be input as a string, not a float (e.g. `"1.40"` instead of `1.40`). [Docker API versions](https://docs.docker.com/engine/api/). - `metrics` (defaults at [./documentation.md](./documentation.md)): Enables/disables individual metrics. See [./documentation.md](./documentation.md) for full detail. Example: @@ -51,7 +51,7 @@ receivers: endpoint: http://example.com/ collection_interval: 2s timeout: 20s - api_version: 1.24 + api_version: "1.24" container_labels_to_metric_labels: my.container.label: my-metric-label my.other.container.label: my-other-metric-label