dikhan / terraform-provider-openapi

OpenAPI Terraform Provider that configures itself at runtime with the resources exposed by the service provider (defined in a swagger file)
Apache License 2.0
275 stars 48 forks source link

Provider plugin submits tags as part of HTTP telemetry provider #219

Closed lillchan closed 4 years ago

lillchan commented 4 years ago

Is your feature request related to a problem?

As an OpenAPI Terraform Service Provider
I want to be able to setup the HTTP telemetry configuration with provider schema properties that will be sent to the corresponding HTTP endpoint
So that when terraform plan/apply is executed, the corresponding counter metrics will be shipped along with the specified provider schema properties

Describe the solution you'd like

I would like to define in the OpenAPI plugin configuration http endpoint telemetry some provider schema properties that the plugin will submit along with the http endpoint metrics.

Acceptance criteria

Scenario: Given a service provider configuration that can be configured with a some_token property:

provider "openapi" {
  some_token = "token_value"
}

And a plugin configuration file that uses the http endpoint telemetry with the provider_schema_properties populated matching the provider configuration property some_token:

version: '1'
services:
  openapi:
    telemetry:
      http_endpoint:
        url: http://host.com/v1/metrics
        provider_schema_properties: ["some_token"]
    swagger-url: %s
    insecure_skip_verify: true

When terraform plan/apply is executed

Then the http_endpoint located at http://host.com/v1/metrics should receive the counter metrics as well as a header with property some_token and value token_value

Checklist (for admin only)

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