Skip to content

[receiver/tlscheck] Enable re-aggregation feature#47736

Open
alliasgher wants to merge 2 commits intoopen-telemetry:mainfrom
alliasgher:feat/46383-tlscheck-reaggregation
Open

[receiver/tlscheck] Enable re-aggregation feature#47736
alliasgher wants to merge 2 commits intoopen-telemetry:mainfrom
alliasgher:feat/46383-tlscheck-reaggregation

Conversation

@alliasgher
Copy link
Copy Markdown

Part of #45396.

Summary

Sets reaggregation_enabled: true in metadata.yaml and assigns requirement levels to the three x.509 certificate attributes:

Attribute Level Rationale
tlscheck.x509.cn recommended Enabled by default; identifies the cert subject
tlscheck.x509.issuer recommended Enabled by default; identifies the cert authority
tlscheck.x509.san opt_in Disabled by default; SANs can be many/verbose

The tlscheck.target is already a resource attribute so no metric attribute needs required level.

Generated metadata files with mdatagen.

Note

When running mdatagen with recommended/opt_in attributes but no required attribute, the generated generated_config.go imports "slices" unconditionally but never calls any slices.* function, causing a compile error. A fix has been submitted to the upstream mdatagen template: open-telemetry/opentelemetry-collector#15145. The files in this PR were generated with that fix applied.

Testing

All existing receiver/tlscheckreceiver tests pass with the changes applied:

```
ok github.com/open-telemetry/opentelemetry-collector-contrib/receiver/tlscheckreceiver
ok github.com/open-telemetry/opentelemetry-collector-contrib/receiver/tlscheckreceiver/internal/metadata
```

Part of open-telemetry#45396.

Sets reaggregation_enabled: true in metadata.yaml and assigns
requirement levels to the three x.509 certificate attributes:
- tlscheck.x509.cn: recommended (enabled by default, can be disabled)
- tlscheck.x509.issuer: recommended (enabled by default, can be disabled)
- tlscheck.x509.san: opt_in (disabled by default, can be enabled)

Regenerated metadata files with mdatagen.

Note: this change was generated with a patched mdatagen that fixes an
unused "slices" import when reaggregation is enabled but no attribute
carries requirement_level: required. The template fix is tracked in
open-telemetry/opentelemetry-collector.

Signed-off-by: Ali <alliasgher123@gmail.com>
@github-actions
Copy link
Copy Markdown
Contributor

Welcome, contributor! Thank you for your contribution to opentelemetry-collector-contrib.

Important reminders:

A maintainer will review your pull request soon. Thank you for helping make OpenTelemetry better!

- Use receiver/tls_check (the type name) not receiver/tlscheck as the
  chloggen component
- Run gci to fix import grouping in generated_package_test.go and
  generated_config_test.go

Signed-off-by: Ali <alliasgher123@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants