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

Suggestions on ensuring consistent instanceId #29582

Closed
mike9421 opened this issue Nov 30, 2023 · 7 comments
Closed

Suggestions on ensuring consistent instanceId #29582

mike9421 opened this issue Nov 30, 2023 · 7 comments

Comments

@mike9421
Copy link

Component(s)

cmd/opampsupervisor, extension/opamp

Describe the issue you're reporting

According to opampsupervisor document, the current approach is: supervisor generate instance_uid, and The value is injected into the Collector config in opamp extension's instance_uid setting and as service.instance.id attribute under the service.telemetry.resource setting. In this way, it will not work if the opamp extension is not enabled.

According to otel source code, after OTEL starts, it will read the configuration item (service.telemetry.resource.service.instance.id) of the configuration file. If the configuration item does not exist, it will be randomly generated. Why not write it to the configuration item when opampsupervisor generates instance_uid? after all OTEL is started by opampsupervisor

Copy link
Contributor

Pinging code owners:

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

@crobert-1 crobert-1 added the enhancement New feature or request label Nov 30, 2023
@tigrannajaryan
Copy link
Member

Why not write it to the configuration item when opampsupervisor generates instance_uid?

I think that's exactly what Supervisor does:

What is the problem that you see?

@mike9421
Copy link
Author

mike9421 commented Dec 4, 2023

@tigrannajaryan Thanks for your answer.

Why not write it to the configuration item when opampsupervisor generates instance_uid?

I think that's exactly what Supervisor does:

Yes, the instanceId generated by opampsupervisor will be merged into the OTEL configuration file only when opampsupervisor does not have local configuration (effective.yaml) or receives remote configuration.

But if the user provides 'effective.yaml' and the opamp extension is not enabled, in this case the instanceId and OTEL's service.instance.id will be consistent only until the user remotely configures it.

When opampsupervisor generates instance_uid, this value is written into OTEL's configuration item (service.telemetry.resource.service.instance.id). This may not cause this problem?

@tigrannajaryan
Copy link
Member

As far as I can see from the code the instance id is always generated by the supervisor and written into the Collector's config file. I am not sure I understand what is the problem.

@mike9421
Copy link
Author

mike9421 commented Dec 6, 2023

As far as I can see from the code the instance id is always generated by the supervisor and written into the Collector's config file. I am not sure I understand what is the problem.

According to the discuss, opampsupervisor should merge the default configuration (eg. noop configuration)

But according to loadAgentEffectiveConfig, If the file corresponding to the "effectiveConfigFilePath" path exists(eg. the user configures), opampsupervisor will not merge configurations when starting otel for the first time.

But if the user provides 'effective.yaml' and the opamp extension is not enabled, in this case the instanceId and OTEL's service.instance.id will be consistent only until the user remotely configures it.

There would be a problem unless the user could not customize the contents of the file corresponding to the "effectiveConfigFilePath" path before launching the program.

@atoulme atoulme removed the needs triage New item requiring triage label Dec 6, 2023
Copy link
Contributor

github-actions bot commented Feb 5, 2024

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 Feb 5, 2024
Copy link
Contributor

github-actions bot commented Apr 5, 2024

This issue has been closed as inactive because it has been stale for 120 days with no activity.

@github-actions github-actions bot closed this as not planned Won't fix, can't repro, duplicate, stale Apr 5, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants