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

feat: Add website metrics to LogicMonitor [PC-15088] #359

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

dawidwisn
Copy link
Contributor

@dawidwisn dawidwisn commented Dec 11, 2024

Motivation

Support website metrics in LogicMonitor

Example main.tf

terraform {
  required_providers {
    nobl9 = {
      source = "nobl9.com/nobl9/nobl9"
      version = "0.26.0"
    }
  }
}

resource "nobl9_project" "project" {
  display_name = "LM-project Display"
  name         = "lm-project"
  description  = "Lorem ipsum project"
}

resource "nobl9_service" "service" {
  display_name = "LM-service Display"
  name         = "lm-service"
  project      =  nobl9_project.project.name
  description  = "Lorem ipsum service"

  label {
    key    = "env"
    values = ["dev", "prod"]
  }

  label {
    key    = "team"
    values = ["red"]
  }
}

resource "nobl9_agent" "agent" {
  name      = "lm-agent"
  logic_monitor_config {
    account = "account_name"
  }
  project   =  nobl9_project.project.name
  agent_type = "logic_monitor"
  release_channel = "beta"
  query_delay {
    unit = "Minute"
    value = 6
  }
}

resource "nobl9_direct_logic_monitor" "direct" {
  name = "lm-direct"
  project = nobl9_project.project.name
  description = "Lorem ipsum direct"
  account = "account_name"
  account_id = "secret"
  access_key = "secret"
  release_channel = "beta"
  query_delay {
    unit = "Minute"
    value = 6
  }
}


resource "nobl9_slo" "slo" {
  display_name = "LM-slo Display"
  name         = "lm-slo"
  project      = nobl9_project.project.name
  service      = nobl9_service.service.name

  label {
    key = "team"
    values = ["green","sapphire"]
  }

  label {
    key = "env"
    values = ["dev", "staging", "prod"]
  }

  budgeting_method = "Occurrences"

  objective {
    display_name = "obj1"
    name         = "tf-objective-1"
    target       = 0.7
    value        = 1
    op           = "lt"
    raw_metric {
      query {
        logic_monitor {
          query_type = "website_metrics"
          website_id = "1"
          checkpoint_id = "775430648"
          graph_name = "responseTime"
          line = "AVERAGE"
        }
      }
    }
  }

  time_window {
    count = 10
    is_rolling = true
    unit = "Minute"
  }

  indicator {
    name = nobl9_direct_logic_monitor.direct.name
    project = nobl9_project.project.name
    kind = "Direct"
    }
}

Related Changes

https://github.com/nobl9/n9/pull/16139
https://github.com/nobl9/commander/pull/52
nobl9/nobl9-go#593
https://github.com/nobl9/telegraf-n9/pull/1219

Testing

  • Describe how to check introduced code changes manually.
  • Take care of test coverage on unit, integration or end-to-end levels.

Release Notes

Support website metrics in LogicMonitor

@n9-machine-user n9-machine-user added the go Pull requests that update Go code label Dec 11, 2024
@dawidwisn dawidwisn changed the title PC-15088 Add website metrics to LogicMonitor feat: Add website metrics to LogicMonitor [PC-15088] Dec 11, 2024
@n9-machine-user n9-machine-user added enhancement New feature or request minor New functionality with at most minor breaking changes labels Dec 11, 2024
@dawidwisn dawidwisn marked this pull request as ready for review December 12, 2024 14:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request go Pull requests that update Go code minor New functionality with at most minor breaking changes
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants