Skip to content

Conversation

@strawgate
Copy link
Contributor

This package implements a Docker Stats input using the OpenTelemetry
Collector's dockerstats receiver, following the pattern established
in PR #14315.

Key features:

Type: integration with otelcol input (not content package)
Configurable collection interval, endpoint, and filtering
Comprehensive field definitions for container metrics
Full documentation and test policy
Resolves: #15731

@strawgate strawgate requested a review from a team as a code owner February 11, 2026 14:34
@strawgate
Copy link
Contributor Author

@claude how does this compare to the other feedback given to other input package PRs? as well as what has merged into main? any important discrepancies? It looks like some of the ways we're configuring collection are no longer available and use the metrics syntax: https://github.com/open-telemetry/opentelemetry-collector-contrib/blob/main/receiver/dockerstatsreceiver/README.md

Can you review the input package for other discrepancies?

@github-actions
Copy link
Contributor

github-actions bot commented Feb 11, 2026

Vale Linting Results

Summary: 2 warnings, 4 suggestions found

⚠️ Warnings (2)
File Line Rule Message
packages/docker_input_otel/_dev/build/docs/README.md 7 Elastic.Latinisms Latin terms and abbreviations are a common source of confusion. Use 'using' instead of 'via'.
packages/docker_input_otel/docs/README.md 7 Elastic.Latinisms Latin terms and abbreviations are a common source of confusion. Use 'using' instead of 'via'.
💡 Suggestions (4)
File Line Rule Message
packages/docker_input_otel/_dev/build/docs/README.md 11 Elastic.Versions Use 'or later' instead of 'or higher' when referring to versions.
packages/docker_input_otel/_dev/build/docs/README.md 20 Elastic.WordChoice Consider using 'refer to (if it's a document), view (if it's a UI element)' instead of 'see', unless the term is in the UI.
packages/docker_input_otel/docs/README.md 11 Elastic.Versions Use 'or later' instead of 'or higher' when referring to versions.
packages/docker_input_otel/docs/README.md 20 Elastic.WordChoice Consider using 'refer to (if it's a document), view (if it's a UI element)' instead of 'see', unless the term is in the UI.

The Vale linter checks documentation changes against the Elastic Docs style guide.

To use Vale locally or report issues, refer to Elastic style guide for Vale.

@github-actions
Copy link
Contributor

github-actions bot commented Feb 11, 2026

Claude finished @strawgate's task in 2m 52s —— View job


Reviewing Docker OTel Input Package

  • Gather repository context and understand input package patterns
  • Review other input package PRs and what merged into main
  • Fetch current OpenTelemetry dockerstatsreceiver documentation
  • Compare this PR's configuration with upstream OTel docs
  • Identify discrepancies and provide feedback

Summary

I've compared this PR against merged OTel input packages (hostmetrics_input_otel, nginx_input_otel, kubeletstats_input_otel, iis_input_otel) and the upstream dockerstatsreceiver documentation. Here are my findings:

⚠️ Key Discrepancies

1. Missing metrics Configuration Field

This is the issue you mentioned. The upstream receiver supports a metrics configuration block to enable/disable individual metrics:

receivers:
  docker_stats:
    metrics:
      container.cpu.usage.percpu:
        enabled: true
      container.memory.active_anon:
        enabled: true

The kubeletstats_input_otel package (merged recently) handles this with a type: yaml field for metrics:

# kubeletstats_input_otel pattern:
- name: metrics
  type: yaml
  title: Metrics Configuration
  description: |
    ## Example configuration for enabling optional metrics.
    # k8s.container.cpu.node.utilization:
    #   enabled: true

Recommendation: Add a metrics yaml field to allow users to enable optional metrics like container.cpu.usage.percpu, container.memory.active_anon, etc.

2. provide_per_core_cpu_metrics is Deprecated

The provide_per_core_cpu_metrics option is no longer documented in the upstream receiver. It has been replaced by the metrics syntax:

metrics:
  container.cpu.usage.percpu:
    enabled: true

Recommendation: Remove provide_per_core_cpu_metrics and use the metrics yaml field instead.

3. Missing initial_delay Field

The upstream receiver supports initial_delay (default: 1s), which is present in other OTel input packages (nginx_input_otel, iis_input_otel, kubeletstats_input_otel).

Recommendation: Add initial_delay field for consistency with other packages.

4. type: text vs type: duration for Interval Fields

Other merged packages use type: duration for time-based fields:

  • nginx_input_otel: type: duration for collection_interval and initial_delay
  • iis_input_otel: type: duration for collection_interval and initial_delay
  • kubeletstats_input_otel: type: duration for collection_interval and initial_delay

This PR uses type: text for period.

Recommendation: Use type: duration for period (or rename to collection_interval for consistency with upstream naming).

5. Missing source.license Field

Other merged OTel input packages include:

source:
  license: "Elastic-2.0"

This is missing from this package's manifest.

📋 Comparison Table

Field This PR nginx_input_otel kubeletstats_input_otel Upstream
collection_interval ✅ (as period)
endpoint
initial_delay ❌ Missing
timeout N/A N/A
api_version N/A N/A
excluded_images N/A N/A
metrics (yaml) ❌ Missing N/A
container_labels_to_metric_labels N/A N/A
env_vars_to_metric_labels N/A N/A
provide_per_core_cpu_metrics ⚠️ Deprecated N/A N/A ❌ Removed
source.license ❌ Missing N/A
type: duration for time fields type: text N/A

📁 Missing Package Structure Elements

Based on other merged packages, consider adding:

  1. _dev/build/build.yml - Build configuration (present in prometheus_input, sql_input, etc.)
  2. System tests - More comprehensive test policies (see kubeletstats_input_otel pattern with multiple test configs)

✅ What's Done Well

  • Good documentation in docs/README.md
  • Core configuration options are covered
  • Package structure follows the basic pattern
  • Uses otelcol input type correctly
  • Includes resourcedetection processor in the pipeline

Recommended Changes

  1. Add metrics yaml field to enable/disable specific metrics
  2. Remove provide_per_core_cpu_metrics (deprecated upstream)
  3. Add initial_delay field for consistency
  4. Change type: text to type: duration for time-based fields
  5. Add source.license: "Elastic-2.0" to manifest
  6. Consider renaming period to collection_interval to match upstream naming

--- |


Why is Claude responding? | Type @claude to interact further

Give us feedback! React with 🚀 if perfect, 👍 if helpful, 👎 if not.

Copy link
Contributor

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The package structure follows the OTel input pattern well. A few items need attention:

Policy testing: The test-docker-stats.yml needs a corresponding .expected file to verify the rendered policy output (see hostmetrics_input_otel and iis_input_otel for examples).

Consistency with other packages: The period variable is marked required but has a fallback in the template. Other OTel input packages use required: false with a default value, which also simplifies the template.

Please also verify that CI passes with the policy tests once the expected file is added.


Why is Claude responding? | Type @claude to interact further

Give us feedback! React with 🚀 if perfect, 👍 if helpful, 👎 if not.

changes:
- description: Initial draft of Docker Stats OpenTelemetry input package
type: enhancement
link: https://github.com/elastic/integrations/pull/15739
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 MEDIUM Changelog links to wrong PR

Why: The changelog references closed PR #15739 instead of this PR #17372, which will cause confusion in release notes

Suggested change
link: https://github.com/elastic/integrations/pull/15739
link: https://github.com/elastic/integrations/pull/17372

Why is Claude responding? | Type @claude to interact further

Give us feedback! React with 🚀 if perfect, 👍 if helpful, 👎 if not.

kibana:
version: "^9.2.0"
elastic:
subscription: "basic"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚪ LOW Missing source.license field

Why: Other OTel input packages include source.license to explicitly specify the license

Suggested change
subscription: "basic"
elastic:
subscription: "basic"
source:
license: "Elastic-2.0"

Why is Claude responding? | Type @claude to interact further

Give us feedback! React with 🚀 if perfect, 👍 if helpful, 👎 if not.

type: text
title: Collection Interval
description: How often to collect metrics (e.g., 10s, 1m). Default is 60s.
required: true
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 MEDIUM Period should have a default, not be required

Why: The template has a fallback default (60s), suggesting period is intended to be optional. Other OTel input packages use required: false with a default value. Having required: true means the template's else clause is unreachable code.

Suggested change
required: true
description: How often to collect metrics (e.g., 10s, 1m). Default is 60s.
required: false
default: 60s

Why is Claude responding? | Type @claude to interact further

Give us feedback! React with 🚀 if perfect, 👍 if helpful, 👎 if not.

receivers:
- docker_stats
processors:
- resourcedetection No newline at end of file
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚪ LOW Missing trailing newline

Why: Files should end with a newline per POSIX standard and common convention

Suggested change
- resourcedetection
- resourcedetection

Why is Claude responding? | Type @claude to interact further

Give us feedback! React with 🚀 if perfect, 👍 if helpful, 👎 if not.

description: Data stream namespace.
- name: '@timestamp'
type: date
description: Event timestamp. No newline at end of file
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚪ LOW Missing trailing newline

Why: Files should end with a newline per POSIX standard

Suggested change
description: Event timestamp.
description: Event timestamp.

Why is Claude responding? | Type @claude to interact further

Give us feedback! React with 🚀 if perfect, 👍 if helpful, 👎 if not.

@@ -0,0 +1,3 @@
vars:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 MEDIUM Missing .expected file for policy test

Why: Other OTel input packages (hostmetrics_input_otel, iis_input_otel, etc.) include .expected files that verify the rendered policy output. Without this, policy rendering issues won't be caught.


Why is Claude responding? | Type @claude to interact further

Give us feedback! React with 🚀 if perfect, 👍 if helpful, 👎 if not.

@@ -0,0 +1,48 @@
receivers:
docker_stats:
{{#if period}}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚪ LOW Simplify template after adding default to manifest

Why: If the manifest provides a default value for period, this conditional becomes unnecessary since period will always have a value.

Suggested change
{{#if period}}
collection_interval: {{period}}

Why is Claude responding? | Type @claude to interact further

Give us feedback! React with 🚀 if perfect, 👍 if helpful, 👎 if not.

description: Mapping of environment variables to metric labels (YAML format)
required: false
owner:
github: elastic/obs-infraobs-integrations
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Missing to update the .github/CODEOWNERS file , and probably this should be owned for the time being by elastic/ecosystem ?

Copy link

@jmmcorreia jmmcorreia Feb 11, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It was present on the prior PR, just synced the older changes on top of this one.

However, I added the owner as packages/docker_input_otel @elastic/obs-infraobs-integrations since it seems to match the remaining otel input packages.

Do you know how this is decided?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would it be possible to add some system test too?
And if it is possible, please create a new sample_event.json file via elastic-package test system --generate command.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could it be used for those system tests the same approach that it is used in the docker package ?
https://github.com/elastic/integrations/tree/main/packages/docker/_dev/deploy/docker


This integration uses the OpenTelemetry dockerstats receiver which is currently in **alpha** stability. The configuration and metrics may change between versions.

## Metrics
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Usually, we are adding a paragraph pointing out to the upstream configuration instead of adding these details here to avoid being outdated with respect to the upstream documentation.

Example:

https://github.com/elastic/integrations/tree/main/packages/nginx_input_otel/docs#metrics-reference

## Compatibility

This integration uses the OpenTelemetry dockerstats receiver which is currently in **alpha** stability. The configuration and metrics may change between versions.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it would be interesting to add a Configuration section as in the other input otel packages pointing to the actual upstream documentation.

Example:

https://github.com/elastic/integrations/tree/main/packages/hostmetrics_input_otel/docs#configuration-options

@mrodm mrodm requested review from a team February 11, 2026 14:45
@jmmcorreia
Copy link

@claude Review the PR for any discrepancies, any existing comments, compare against existing packages and make a TODO list with all the action items.

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Copy link
Contributor

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This PR adds a well-structured Docker Stats OpenTelemetry input package. The package passes lint and builds successfully.

Outstanding items from existing reviews:

  • @mrodm requested documentation changes to point to upstream OTel receiver docs rather than duplicating details inline (threads on _dev/build/docs/README.md lines 17, 22)
  • The period variable uses required: true with a default value, which differs from other OTel input packages that use required: false with a default

Notes:

  • The source.license field is already present (lines 5-6 in manifest.yml) - an existing comment suggested it was missing but this appears to be addressed
  • CODEOWNERS is correctly updated with @elastic/obs-infraobs-integrations ownership
  • Policy tests with expected files are now included and render correctly

Why is Claude responding? | Type @claude to interact further

Give us feedback! React with 🚀 if perfect, 👍 if helpful, 👎 if not.

@elasticmachine
Copy link

💚 Build Succeeded

History

@andrewkroh andrewkroh added New Integration Issue or pull request for creating a new integration package. documentation Improvements or additions to documentation. Applied to PRs that modify *.md files. labels Feb 11, 2026
Copy link
Contributor

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The package structure follows the established OTel input package patterns. The build and lint checks pass locally.

Existing feedback that still needs attention:

  • period variable has required: true with a default value. Other OTel input packages use required: false since the default makes it optional.
  • Documentation should include a Configuration section linking to upstream dockerstatsreceiver configuration to avoid duplication and stay current.

The source.license field and changelog link have been addressed since earlier comments. CODEOWNERS has been updated as discussed.


Why is Claude responding? | Type @claude to interact further

Give us feedback! React with 🚀 if perfect, 👍 if helpful, 👎 if not.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Improvements or additions to documentation. Applied to PRs that modify *.md files. New Integration Issue or pull request for creating a new integration package.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[OTel Docker Stats Receiver] Input Package

5 participants