hashicorp / terraform-provider-azurerm

Terraform provider for Azure Resource Manager
https://registry.terraform.io/providers/hashicorp/azurerm/latest/docs
Mozilla Public License 2.0
4.48k stars 4.56k forks source link

DCE/DCR not configured for Prometheus logging #23623

Closed jaywithersbrewin closed 5 months ago

jaywithersbrewin commented 9 months ago

Is there an existing issue for this?

Community Note

Terraform Version

1.3.8

AzureRM Provider Version

3.74.0

Affected Resource(s)/Data Source(s)

azurerm_kubernetes_cluster

Terraform Configuration Files

resource "azurerm_kubernetes_cluster" "example" {
  name                = "aks-lz-npd-weu-platform"
  location            = azurerm_resource_group.platform.location
  resource_group_name = azurerm_resource_group.platform.name
  dns_prefix          = "aks"

  default_node_pool {
    name       = "default"
    node_count = 1
    vm_size    = "Standard_D2_v2"
  }

  identity {
    type = "SystemAssigned"
  }

  monitor_metrics {}

  tags = {
    Environment = "Production"
  }
}

Debug Output/Panic Output

N/A

Expected Behaviour

MA_mon-lz-npd-weu-aks_westeurope_managed resource group created with Data Collection Endpoint (DCE) and Data Collection Rule (DCR) which are fully configured.

Actual Behaviour

The DCE and DCR don't have resources configured.

Steps to Reproduce

No response

Important Factoids

No response

References

No response

stephybun commented 5 months ago

Thanks for raising this issue @jaywithersbrewin.

Looking over the MSFT documentation, in order to configure Prometheus metrics on an AKS cluster the Azure Monitor Workspace (which creates the MA_* resource group, as well as the DCE and DCR) needs to be created beforehand. The Rest API does not handle the automatic creation of it just from enabling it.

For guidance on how to setup Prometheus logging on your cluster the MSFT docs have a great guide with example Terraform modules.

I'm going to close this issue since there aren't any changes we can make to the resource for this. The linked guide should provide clarity on how to setup Prometheus logging and for any further configuration questions the Community Discuss forum is a good place to look through.

jaywithersbrewin commented 4 months ago

Thanks, @stephybun

github-actions[bot] commented 3 months ago

I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues. If you have found a problem that seems similar to this, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.