Skip to content

Conversation

@daviFrag
Copy link

…ment metrics resource

Contributor's Note

  • I have added / updated documentation in /docs for any user-facing features or additions.
  • I have added / updated acceptance tests in /fwprovider/tests for any new or updated resources / data sources.
  • I have ran make example to verify that the change works as expected.

Proof of Work

Community Note

  • Please vote on this pull request by adding a 👍 reaction to the original pull request comment to help the community and maintainers prioritize this request
  • Please do not leave "+1" or other comments that do not add relevant new information or questions, they generate extra noise for pull request followers and do not help prioritize the request

Closes #0000 | Relates #0000

…ment metrics resource

Signed-off-by: Davide Frageri <davide.frag@gmail.com>
@gemini-code-assist
Copy link
Contributor

Summary of Changes

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

  • New Feature: OpenTelemetry Metrics Server: This pull request introduces support for OpenTelemetry as a new type of metrics server within the proxmox_virtual_environment_metrics_server resource, allowing users to configure and manage OpenTelemetry endpoints.
  • Extended Resource Schema: The proxmox_virtual_environment_metrics_server resource now includes new optional attributes: opentelemetry_proto (to specify the protocol like http, https, or grpc) and opentelemetry_path (for the endpoint path).
  • Updated Documentation and Examples: The documentation for the virtual_environment_metrics_server resource has been updated to reflect the new OpenTelemetry type, including an example configuration. New example Terraform configurations have also been added to demonstrate its usage.
  • Comprehensive Testing: New acceptance tests have been added to validate the creation, import, and data source functionality for OpenTelemetry metrics servers, ensuring the stability and correctness of the new feature.
Using Gemini Code Assist

The 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 /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

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 .gemini/ folder in the base of the repository. Detailed instructions can be found here.

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

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

Copy link
Contributor

@gemini-code-assist gemini-code-assist bot left a 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.

Comment on lines +185 to +189
"opentelemetry_path": schema.StringAttribute{
Description: "OpenTelemetry endpoint path (e.g., `/v1/metrics`).",
Optional: true,
Default: nil,
},
Copy link
Contributor

Choose a reason for hiding this comment

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

medium

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.

Comment on lines 207 to 213
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",
}),
Copy link
Contributor

Choose a reason for hiding this comment

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

medium

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

1 participant