-
-
Notifications
You must be signed in to change notification settings - Fork 231
feat(provider): add Open telemetry implementation for virtual environ… #2372
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
base: main
Are you sure you want to change the base?
Conversation
…ment metrics resource Signed-off-by: Davide Frageri <davide.frag@gmail.com>
Summary of ChangesHello @daviFrag, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed! This pull request significantly enhances the Proxmox Terraform provider by integrating OpenTelemetry as a supported metrics server type. It extends the existing metrics server resource to allow for the configuration of OpenTelemetry endpoints, providing users with more options for collecting and exporting telemetry data from their virtual environments. The changes include schema updates, model adjustments, and thorough testing to ensure robust functionality. Highlights
Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either
Customization To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here. You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension. Footnotes
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Code Review
This pull request adds support for OpenTelemetry as a metrics server type in the Proxmox Terraform provider. The changes include updating the resource schema, model, and API types to accommodate the new opentelemetry type with its specific attributes opentelemetry_proto and opentelemetry_path. Documentation and examples are also updated accordingly. The implementation looks solid, but I have a couple of suggestions to improve completeness and robustness. I've pointed out that the associated datasource is not updated to expose the new OpenTelemetry-specific attributes, and its test is therefore incomplete. I've also suggested adding validation to prevent invalid combinations of attributes for the new OpenTelemetry server resource.
| "opentelemetry_path": schema.StringAttribute{ | ||
| Description: "OpenTelemetry endpoint path (e.g., `/v1/metrics`).", | ||
| Optional: true, | ||
| Default: nil, | ||
| }, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The opentelemetry_path attribute is only applicable for http and https protocols, and not for grpc. To improve user experience and prevent misconfiguration, consider adding a custom validator to enforce this. The validator should produce an error if opentelemetry_path is set when opentelemetry_proto is grpc.
| test.ResourceAttributes("data.proxmox_virtual_environment_metrics_server.acc_otel_server2", map[string]string{ | ||
| "id": "acc_example_otel_server2", | ||
| "name": "acc_example_otel_server2", | ||
| "port": "4318", | ||
| "server": "192.168.3.2", | ||
| "type": "opentelemetry", | ||
| }), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The test for the datasource is missing checks for the new opentelemetry_proto and opentelemetry_path attributes. The datasource should expose all configurable attributes of the resource.
Please update the metricsServerDatasourceModel and the datasource schema to include these new fields, and then update this test to verify their values.
… in resource_metrics_server open telemetry Signed-off-by: Davide Frageri <davide.frag@gmail.com>
…ment metrics resource
Contributor's Note
/docsfor any user-facing features or additions./fwprovider/testsfor any new or updated resources / data sources.make exampleto verify that the change works as expected.Proof of Work
Community Note
Closes #0000 | Relates #0000