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

Add support for Terraform version metric for Telemetry HTTP Endpoints #276

Open
2 tasks done
dikhan opened this issue Dec 21, 2020 · 0 comments
Open
2 tasks done

Comments

@dikhan
Copy link
Owner

dikhan commented Dec 21, 2020

Is your feature request related to a problem?

As an OpenAPI Terraform operator/maintainer
I want the OpenAPI provider to submit, if the telemetry configuration is enabled hot http endpoints, the Terraform version used to invoke the provider.
So that I have better knowledge of the different versions of Terraform users are using to make it easier to understand usage and help with deprecating features as needed.

Currently, the provider supports submitting the user's OpenAPI provider version used ("openapi_plugin_version:0_25_0"]) and the provider name, resource and operation executed ("provider_name:cdn", "resource_name":"cdn_v1", "terraform_operation":"create"]). More about how this is supported here.

Describe the solution you'd like

The provider can support this by leveraging the package helper/schema.Provider.TerraformVersion and meta.SDKVersionString() from the meta package.

See the example below:

fmt.Sprintf("HashiCorp Terraform/%s (+https://www.terraform.io) Terraform Plugin SDK/%s", version, meta.SDKVersionString())

The above packages could be used to submit a new metric extending the openapi/plugin_config_telemetry_handler.go SubmitPluginExecutionMetrics function which currently only submits the IncOpenAPIPluginVersionTotalRunsCounter and also submit another metric IncTerraformVersionTotalRunsCounter.

More info: https://www.terraform.io/docs/extend/guides/v2-upgrade-guide.html#removal-of-httpclient-package

Acceptance criteria

What's required to consider this feature request complete?

Example:

Scenario: Terraform version is submitted as a new metric to the HTTP endpoint when the provider is invoked
Given the http endpoint telemetry configured as per https://github.com/dikhan/terraform-provider-openapi/blob/master/docs/plugin_configuration_schema.md#http-endpoint-object
When the provider is executed
Then the http endpoint configured should receive a new metric containing the Terraform version that was used to execute the plugin

Describe alternatives you've considered

A clear and concise description of any alternative solutions or features you've considered.

Additional context

Add any other context or screenshots about the feature request here.

Checklist (for admin only)

Don't forget to go through the checklist to make sure the issue is created properly:

  • I have added a corresponding label (feature request) to the issue (right side menu)
  • I have added this issue to the 'API Terraform Provider' GitHub project (right side menu)
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

1 participant