Skip to content
This repository was archived by the owner on Mar 6, 2025. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
51 changes: 51 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
name: Validate PR

on:
pull_request:
paths:
- '**.tf'
- '**.go'

jobs:
terraform-fmt:
name: Terraform Format Check
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Setup Terraform
uses: hashicorp/setup-terraform@v1
- name: Terraform FMT Check
run: |
terraform init
terraform fmt -check

terraform-lint:
name: Terraform Lint Check
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Install tflint
run: |
wget https://github.com/terraform-linters/tflint/releases/download/v0.31.0/tflint_linux_amd64.zip
unzip tflint_linux_amd64.zip
sudo mv tflint /usr/local/bin/
- name: Run tflint
run: tflint

go-lint:
name: Go Best Practices Lint Check
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Setup Go
uses: actions/setup-go@v2
with:
go-version: 1.21
- name: Install golangci-lint
run: |
wget -O- -nv https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s v1.42.0
- name: Run golangci-lint
run: ./bin/golangci-lint run
45 changes: 45 additions & 0 deletions .golangci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
linters-settings:
govet:
check-shadowing: true
golint:
min-confidence: 0.8
gofmt:
simplify: true
goimports:
local-prefixes: github.com/lightstep/integrations
maligned:
suggest-new: true
misspell:
locale: US

linters:
enable:
- unused
- gosimple
- structcheck
- varcheck
- ineffassign
- deadcode
- gofmt
- goimports
- golint
- govet
- errcheck
- staticcheck
- typecheck
disable:
- megacheck

issues:
exclude-rules:
# Exclude some linters from running on test files.
- path: _test\.go$
linters:
- gosimple
- staticcheck

# Exclude some directories from linting.
exclude-use-default: false

run:
timeout: 5m
4 changes: 2 additions & 2 deletions azure/apimanagement_service/dashboards/overview/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@ output "dashboard_url" {
}

resource "lightstep_dashboard" "otel_collector_dashboard" {
project_name = var.lightstep_project
dashboard_name = "API Management Service Metrics"
project_name = var.lightstep_project
dashboard_name = "API Management Service Metrics"
dashboard_description = "Monitor API Management Service with this metrics overview dashboard."

chart {
Expand Down
6 changes: 3 additions & 3 deletions azure/apimanagement_service/examples/tf/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -4,16 +4,16 @@ provider "azurerm" {

variable "prefix" {
description = "A prefix used for all resources in this example"
default = "ex-apimgmt"
default = "ex-apimgmt"
}

resource "azurerm_resource_group" "example" {
name = "${var.prefix}"
name = var.prefix
location = "East US"
}

resource "azurerm_api_management" "example" {
name = "${var.prefix}"
name = var.prefix
location = azurerm_resource_group.example.location
resource_group_name = azurerm_resource_group.example.name
publisher_name = "My Company"
Expand Down
4 changes: 2 additions & 2 deletions azure/compute_disks/dashboards/overview/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@ output "dashboard_url" {
}

resource "lightstep_dashboard" "otel_collector_dashboard" {
project_name = var.lightstep_project
dashboard_name = "Compute Disks Metrics"
project_name = var.lightstep_project
dashboard_name = "Compute Disks Metrics"
dashboard_description = "Monitor Compute Disks with this metrics overview dashboard."

chart {
Expand Down
26 changes: 13 additions & 13 deletions azure/compute_disks/examples/tf/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,11 @@ provider "azurerm" {

variable "prefix" {
description = "A prefix used for all resources in this example"
default = "ex-compute-disks"
default = "ex-compute-disks"
}

resource "azurerm_resource_group" "example" {
name = "${var.prefix}"
name = var.prefix
location = "East US"
}

Expand Down Expand Up @@ -47,9 +47,9 @@ resource "azurerm_network_interface" "primary" {
}

resource "azurerm_network_interface" "internal" {
name = "${var.prefix}-internal-net"
resource_group_name = azurerm_resource_group.example.name
location = azurerm_resource_group.example.location
name = "${var.prefix}-internal-net"
resource_group_name = azurerm_resource_group.example.name
location = azurerm_resource_group.example.location

ip_configuration {
name = "internal"
Expand Down Expand Up @@ -81,16 +81,16 @@ resource "azurerm_network_interface_security_group_association" "example" {
}

resource "azurerm_virtual_machine" "vm" {
name = "${var.prefix}-vm1"
location = azurerm_resource_group.example.location
resource_group_name = azurerm_resource_group.example.name
vm_size = "Standard_A1_v2"
name = "${var.prefix}-vm1"
location = azurerm_resource_group.example.location
resource_group_name = azurerm_resource_group.example.name
vm_size = "Standard_A1_v2"
network_interface_ids = [
azurerm_network_interface.primary.id,
azurerm_network_interface.internal.id
]
primary_network_interface_id = azurerm_network_interface.primary.id

delete_os_disk_on_termination = true

storage_image_reference {
Expand All @@ -101,9 +101,9 @@ resource "azurerm_virtual_machine" "vm" {
}

storage_os_disk {
caching = "ReadWrite"
name = "osdisk1"
create_option = "FromImage"
caching = "ReadWrite"
name = "osdisk1"
create_option = "FromImage"
managed_disk_type = "Standard_LRS"
}

Expand Down
4 changes: 2 additions & 2 deletions azure/compute_virtualmachines/dashboards/overview/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@ output "dashboard_url" {
}

resource "lightstep_dashboard" "otel_collector_dashboard" {
project_name = var.lightstep_project
dashboard_name = "Compute Virtual Machines Metrics"
project_name = var.lightstep_project
dashboard_name = "Compute Virtual Machines Metrics"
dashboard_description = "Monitor Compute Virtual Machines with this metrics overview dashboard."

chart {
Expand Down
26 changes: 13 additions & 13 deletions azure/compute_virtualmachines/examples/tf/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,11 @@ provider "azurerm" {

variable "prefix" {
description = "A prefix used for all resources in this example"
default = "ex-compute-vm"
default = "ex-compute-vm"
}

resource "azurerm_resource_group" "example" {
name = "${var.prefix}"
name = var.prefix
location = "East US"
}

Expand Down Expand Up @@ -47,9 +47,9 @@ resource "azurerm_network_interface" "primary" {
}

resource "azurerm_network_interface" "internal" {
name = "${var.prefix}-internal-net"
resource_group_name = azurerm_resource_group.example.name
location = azurerm_resource_group.example.location
name = "${var.prefix}-internal-net"
resource_group_name = azurerm_resource_group.example.name
location = azurerm_resource_group.example.location

ip_configuration {
name = "internal"
Expand Down Expand Up @@ -81,16 +81,16 @@ resource "azurerm_network_interface_security_group_association" "example" {
}

resource "azurerm_virtual_machine" "vm" {
name = "${var.prefix}-vm1"
location = azurerm_resource_group.example.location
resource_group_name = azurerm_resource_group.example.name
vm_size = "Standard_A1_v2"
name = "${var.prefix}-vm1"
location = azurerm_resource_group.example.location
resource_group_name = azurerm_resource_group.example.name
vm_size = "Standard_A1_v2"
network_interface_ids = [
azurerm_network_interface.primary.id,
azurerm_network_interface.internal.id
]
primary_network_interface_id = azurerm_network_interface.primary.id

delete_os_disk_on_termination = true

storage_image_reference {
Expand All @@ -101,9 +101,9 @@ resource "azurerm_virtual_machine" "vm" {
}

storage_os_disk {
caching = "ReadWrite"
name = "osdisk1"
create_option = "FromImage"
caching = "ReadWrite"
name = "osdisk1"
create_option = "FromImage"
managed_disk_type = "Standard_LRS"
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@ output "dashboard_url" {
}

resource "lightstep_dashboard" "otel_collector_dashboard" {
project_name = var.lightstep_project
dashboard_name = "Container Registry Metrics"
project_name = var.lightstep_project
dashboard_name = "Container Registry Metrics"
dashboard_description = "Monitor Container Registry with this metrics overview dashboard."

chart {
Expand Down
8 changes: 4 additions & 4 deletions azure/containerregistry_registries/examples/tf/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -4,17 +4,17 @@ provider "azurerm" {

variable "prefix" {
description = "A prefix used for all resources in this example"
default = "exContainerRegistry"
default = "exContainerRegistry"
}

resource "azurerm_resource_group" "example" {
name = "${var.prefix}"
name = var.prefix
location = "East US"
}

resource "azurerm_container_registry" "example" {
name = "${var.prefix}registry"
resource_group_name = "${azurerm_resource_group.example.name}"
location = "${azurerm_resource_group.example.location}"
resource_group_name = azurerm_resource_group.example.name
location = azurerm_resource_group.example.location
sku = "Standard"
}
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@ output "dashboard_url" {
}

resource "lightstep_dashboard" "otel_collector_dashboard" {
project_name = var.lightstep_project
dashboard_name = "Container Service Managed Clusters Metrics"
project_name = var.lightstep_project
dashboard_name = "Container Service Managed Clusters Metrics"
dashboard_description = "Monitor Container Service Managed Clusters with this metrics overview dashboard."

chart {
Expand Down
4 changes: 2 additions & 2 deletions azure/containerservice_managedclusters/examples/tf/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,11 @@ provider "azurerm" {

variable "prefix" {
description = "A prefix used for all resources in this example"
default = "ex-container-cluster"
default = "ex-container-cluster"
}

resource "azurerm_resource_group" "example" {
name = "${var.prefix}"
name = var.prefix
location = "East US"
}

Expand Down
4 changes: 2 additions & 2 deletions azure/dbformariadb_servers/dashboards/overview/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@ output "dashboard_url" {
}

resource "lightstep_dashboard" "otel_collector_dashboard" {
project_name = var.lightstep_project
dashboard_name = "MariaDB Servers Metrics"
project_name = var.lightstep_project
dashboard_name = "MariaDB Servers Metrics"
dashboard_description = "Monitor MariaDB Servers with this metrics overview dashboard."

chart {
Expand Down
4 changes: 2 additions & 2 deletions azure/dbformariadb_servers/examples/tf/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,11 @@ provider "azurerm" {

variable "prefix" {
description = "A prefix used for all resources in this example"
default = "ex-maria"
default = "ex-maria"
}

resource "azurerm_resource_group" "example" {
name = "${var.prefix}"
name = var.prefix
location = "East US"
}

Expand Down
4 changes: 2 additions & 2 deletions azure/dbformysql_flexibleservers/dashboards/overview/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@ output "dashboard_url" {
}

resource "lightstep_dashboard" "otel_collector_dashboard" {
project_name = var.lightstep_project
dashboard_name = "MySQL Flexible Servers Metrics"
project_name = var.lightstep_project
dashboard_name = "MySQL Flexible Servers Metrics"
dashboard_description = "Monitor MySQL Flexible Servers with this metrics overview dashboard."

chart {
Expand Down
4 changes: 2 additions & 2 deletions azure/dbformysql_flexibleservers/examples/tf/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,11 @@ provider "azurerm" {

variable "prefix" {
description = "A prefix used for all resources in this example"
default = "ex-mysql-flexible"
default = "ex-mysql-flexible"
}

resource "azurerm_resource_group" "example" {
name = "${var.prefix}"
name = var.prefix
location = "East US"
}

Expand Down
4 changes: 2 additions & 2 deletions azure/dbformysql_servers/dashboards/overview/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@ output "dashboard_url" {
}

resource "lightstep_dashboard" "otel_collector_dashboard" {
project_name = var.lightstep_project
dashboard_name = "MySQL Servers Metrics"
project_name = var.lightstep_project
dashboard_name = "MySQL Servers Metrics"
dashboard_description = "Monitor MySQL Servers with this metrics overview dashboard."

chart {
Expand Down
Loading