Skip to content

Add docker_otel_input package#17372

Merged
strawgate merged 28 commits intomainfrom
docker_otel_input
Feb 13, 2026
Merged

Add docker_otel_input package#17372
strawgate merged 28 commits intomainfrom
docker_otel_input

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: 6 suggestions found

💡 Suggestions (6)
File Line Rule Message
packages/docker_input_otel/_dev/build/docs/README.md 22 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/_dev/build/docs/README.md 68 Elastic.WordChoice Consider using 'deactivate, deselect, hide, turn off' instead of 'disable', unless the term is in the UI.
packages/docker_input_otel/_dev/build/docs/README.md 70 Elastic.WordChoice Consider using 'deactivated, deselected, hidden, turned off, unavailable' instead of 'disabled', unless the term is in the UI.
packages/docker_input_otel/docs/README.md 22 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 68 Elastic.WordChoice Consider using 'deactivate, deselect, hide, turn off' instead of 'disable', unless the term is in the UI.
packages/docker_input_otel/docs/README.md 70 Elastic.WordChoice Consider using 'deactivated, deselected, hidden, turned off, unavailable' instead of 'disabled', 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.

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
Contributor

@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.

It was mentioned in the description that ecosystem should be the codeowners of these input packages for now.
#17131

Later on, I think these packages will change owners and probably to the team you mentioned.

Copy link
Contributor

Choose a reason for hiding this comment

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

@mrodm I had missed the issue #17131 mentioning that the codeowner should be ecosystem. Latest commit changes the code owner to ecosystem as requested

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

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

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.

@teresaromero teresaromero linked an issue Feb 12, 2026 that may be closed by this pull request
12 tasks
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.

Several issues need to be addressed before merge:

New issue found:

  • Variable name mismatch in system test (see inline comment)

Previously flagged issues (unresolved):

  • manifest.yml line 37: collection_interval should use required: false with default value
  • manifest.yml line 18: Missing source.license field (LOW priority)
  • Documentation should follow established patterns by pointing to upstream OTel receiver docs for metrics reference and configuration, rather than duplicating content that can become outdated

The package structure and test files otherwise look good and follow the established patterns for OTel input packages.


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.

Reviewed the Docker OpenTelemetry Input Package. The package structure follows established patterns from other OTel input packages (hostmetrics_input_otel, nginx_input_otel), passes lint validation, and includes appropriate test configurations.

The existing review feedback from @mrodm regarding documentation style (referencing upstream docs rather than duplicating configuration details) is valid and should be addressed for consistency with other OTel input packages.

No new blocking issues found.


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.

Previously flagged items requiring attention:

  1. manifest.yml line 37: collection_interval uses required: true while other OTel input packages use required: false with a default value. The current approach works but is inconsistent with the pattern in nginx_input_otel, kubeletstats_input_otel, etc.

  2. Documentation: @mrodm's feedback about adding a Configuration section that references upstream dockerstatsreceiver documentation is valid for maintainability.

Clarification on source.license: An earlier automated comment suggested this field was missing, but it is present at lines 5-6 in manifest.yml. That comment can be disregarded.

The package otherwise follows established OTel input patterns correctly. CI is passing.


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 implementation is well-structured and follows the established patterns from other OTel input packages (hostmetrics_input_otel, nginx_input_otel). The package passes linting, has correct test coverage, and the input template properly handles all configuration variables.

One existing thread remains unresolved: the reviewer has requested simplifying the documentation to follow the pattern of other OTel input packages by having a brief Configuration section that points to the upstream Docker Stats Receiver documentation rather than duplicating configuration details that could become outdated. See the thread at _dev/build/docs/README.md line 19.

No new technical issues identified. The package is ready to merge once the documentation feedback is addressed.


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

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

Copy link
Contributor

@jmmcorreia jmmcorreia left a comment

Choose a reason for hiding this comment

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

From my side, everything looks good. Will address additional comments, if any pop up.

@strawgate
Copy link
Contributor Author

@claude let's do one final review. We have two PRs up for packages like this #17396 and #17397 are we already following the recommendations in those guides?

@github-actions
Copy link
Contributor

github-actions bot commented Feb 12, 2026

Claude finished @strawgate's task in 1m 25s —— View job


Final Review: Comparing Against Guide PRs


Compliance Summary

I've compared this package against the guidelines in PR #17396 (OTel Input Packages Guide) and PR #17397 (CONTRIBUTING.md updates).

Submission Checklist from Guide (PR #17396)

Requirement Status Notes
manifest.yml has type: input and input: otelcol Lines 8, 28
manifest.yml includes opentelemetry in categories Line 13
manifest.yml has conditions.kibana.version: "^9.2.0" Line 16
input.yml.hbs includes resourcedetection processor Lines 30-34
Policy tests exist (_dev/test/policy/) Both test-default and test-docker-stats
Policy tests include .expected files Both present
System tests exist (_dev/test/system/) test-default-config.yml
docs/README.md documents the package Comprehensive docs
changelog.yml has entry for initial version Correctly links to #17372
Package icon exists in img/ docker_logo.svg
CODEOWNERS updated @elastic/obs-infraobs-integrations
source.license field present Lines 5-6 in manifest

Variable Types (from Guide)

Guideline Status Notes
Use duration for time intervals collection_interval, initial_delay, timeout all use duration
Use yaml for complex config metrics, container_labels_to_metric_labels, env_vars_to_metric_labels
Use text with multi: true for lists excluded_images

Template Development (from Guide)

Pattern Status Notes
Uses {{#if}} for optional fields Correct conditionals throughout
Uses {{#each}} for multi-value fields Line 13-15 for excluded_images
Includes resourcedetection processor Lines 30-34
Service pipeline correctly configured Lines 36-42

Documentation (from Guide)

Section Status Notes
Overview explaining what it does Present
How it works section Data flow explained
Configuration section All options documented
Link to upstream OTel receiver docs Multiple links included
Metrics reference points to upstream Line 66 links to upstream docs

PR Submission Requirements (from PR #17397)

Requirement Status Notes
elastic-package check passes CI is green
Changelog entry with correct PR link Links to #17372
CODEOWNERS updated Added correctly
Test coverage included Policy + System tests
sample_event.json present Generated file exists

Result: ✅ Package Fully Complies with Guidelines

This package follows all the recommendations from both guide PRs:

  1. Package structure matches the documented structure exactly
  2. Manifest configuration uses correct types (type: input, input: otelcol, categories, conditions)
  3. Variable definitions follow best practices (duration for time, yaml for complex config, multi: true for lists)
  4. Template patterns correctly use Handlebars conditionals and iteration
  5. Documentation is comprehensive and links to upstream OTel docs
  6. Testing includes both policy tests (with .expected files) and system tests
  7. CODEOWNERS and changelog are properly configured

The package is ready for merge from a guidelines compliance perspective.

--- | Branch: docker_otel_input


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

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

@strawgate strawgate enabled auto-merge (squash) February 12, 2026 17:43
@jmmcorreia jmmcorreia requested a review from mrodm February 12, 2026 19:44
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.

It was mentioned in the description that ecosystem should be the codeowners of these input packages for now.
#17131

Later on, I think these packages will change owners and probably to the team you mentioned.

Copy link
Collaborator

Choose a reason for hiding this comment

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

Copy link
Contributor

Choose a reason for hiding this comment

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

Good catch, thanks for raising this!

I tried to update the logo as best as I could by trying to modify the svg code. Let me know if it looks ok to you or if you spot something that could be improved.

Copy link
Collaborator

Choose a reason for hiding this comment

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

Logo looks ok, thanks!

@jmmcorreia jmmcorreia requested a review from mrodm February 13, 2026 11:07
@elasticmachine
Copy link

💚 Build Succeeded

History

Copy link
Collaborator

@mrodm mrodm left a comment

Choose a reason for hiding this comment

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

LGTM!

But it would be useful that the owners of the other docker packages do a review to this Pull Request too before merging if possible @elastic/obs-ds-hosted-services

@strawgate strawgate merged commit 25c29bd into main Feb 13, 2026
14 checks passed
@strawgate strawgate deleted the docker_otel_input branch February 13, 2026 14:14
@elastic-vault-github-plugin-prod

Package docker_input_otel - 0.1.0 containing this change is available at https://epr.elastic.co/package/docker_input_otel/0.1.0/

@andrewkroh andrewkroh added the Integration:docker_input_otel Docker OpenTelemetry Input Package label Feb 13, 2026
jakubgalecki0 pushed a commit to jakubgalecki0/integrations that referenced this pull request Feb 19, 2026
* Add docker_otel_input package following OpenTelemetry input pattern

This package implements a Docker Stats input using the OpenTelemetry
Collector's dockerstats receiver, following the pattern established
in PR elastic#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: elastic#15731

Co-authored-by: William Easton <strawgate@users.noreply.github.com>

* updates to match httpcheck

* Update manifest

* Add docker container stats input package

* Apply suggestion from @jsoriano

Co-authored-by: Jaime Soriano Pastor <jaime.soriano@elastic.co>

* Address review comments, add UT

* Update codeowners

* Fix package name and UT

* Fix doc and nitpicks

* Modify deprecated attribute and added readme

* Fix PR link

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

* Add integration test and allow support of metrics configuration

* Fix var

* Update README

* Change resource detection to system only

* Do not use Note that

---------

Co-authored-by: claude[bot] <41898282+claude[bot]@users.noreply.github.com>
Co-authored-by: William Easton <strawgate@users.noreply.github.com>
Co-authored-by: Jaime Soriano Pastor <jaime.soriano@elastic.co>
Co-authored-by: Joao <joao.correia@elastic.co>
Co-authored-by: João Correia <marquescorreiajoao@gmail.com>
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
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. Integration:docker_input_otel Docker OpenTelemetry Input Package 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.

Create Input Package: Docker stats receiver [OTel Docker Stats Receiver] Input Package

5 participants