Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[processor/resourcedetection] The ec2 detector does not retry on initial failure #35936

Open
atoulme opened this issue Oct 22, 2024 · 5 comments
Labels
bug Something isn't working processor/resourcedetection Resource detection processor Stale

Comments

@atoulme
Copy link
Contributor

atoulme commented Oct 22, 2024

Component(s)

processor/resourcedetection/internal/aws/ec2

What happened?

Description

The ec2 resource detection processor attempts to connect to the metadata endpoint of AWS to get ec2 machine information on startup of the collector. If the connection to the metadata endpoint fails, the detector gives up. In some cases, the collector may run ahead of the network being ready on the machine, which may cause the collector to fail to get the information.

Steps to Reproduce

Shut down the network interface of the EC2 AWS instance
Start the collector on the EC2 AWS instance
Notice the ec2 detector reports an error in logs
Start the network interface of the EC2 instance

Expected Result

The collector should eventually add resource attributes with ec2 metadata

Actual Result

The collector never changes the output

Collector version

0.112.0

Environment information

Environment

OS: (e.g., "Ubuntu 20.04")
Compiler(if manually compiled): (e.g., "go 14.2")

OpenTelemetry Collector configuration

No response

Log output

No response

Additional context

No response

@atoulme atoulme added bug Something isn't working needs triage New item requiring triage and removed needs triage New item requiring triage labels Oct 22, 2024
@github-actions github-actions bot added the processor/resourcedetection Resource detection processor label Oct 22, 2024
Copy link
Contributor

Pinging code owners:

See Adding Labels via Comments if you do not have permissions to add labels yourself.

@dashpole
Copy link
Contributor

Is this specific to ec2, or does this apply to other resource detectors as well?

@dmitryax
Copy link
Member

We have only seen this in ec2, but I assume it's something that potentially can be seen in other detectors.

The problem is that we assume that not all configured detectors are expected to provide data. We allow not applicable detectors to silently fail at the start time.

I believe the solution would be an additional backoff retry configuration option. If that's enabled, the processor will keep retrying. Maybe we should block the collector from starting until it succeeds or retries are exhausted.

@atoulme
Copy link
Contributor Author

atoulme commented Nov 3, 2024

Specifically in this case, the code triggered is:

if _, err = d.metadataProvider.InstanceID(ctx); err != nil {
d.logger.Debug("EC2 metadata unavailable", zap.Error(err))
return pcommon.NewResource(), "", nil
}

Copy link
Contributor

github-actions bot commented Jan 3, 2025

This issue has been inactive for 60 days. It will be closed in 60 days if there is no activity. To ping code owners by adding a component label, see Adding Labels via Comments, or if you are unsure of which component this issue relates to, please ping @open-telemetry/collector-contrib-triagers. If this issue is still relevant, please ping the code owners or leave a comment explaining why it is still relevant. Otherwise, please close it.

Pinging code owners:

See Adding Labels via Comments if you do not have permissions to add labels yourself.

@github-actions github-actions bot added the Stale label Jan 3, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working processor/resourcedetection Resource detection processor Stale
Projects
None yet
Development

No branches or pull requests

3 participants