Skip to content
This repository was archived by the owner on May 15, 2025. It is now read-only.

Conversation

@defelmnq
Copy link
Contributor

This PR aims to add a new coder module - named coder_monitoring which can be used to enable and customize monitoring of resources over the coder workspaces.

@defelmnq defelmnq self-assigned this Dec 10, 2024
@mtojek mtojek requested a review from matifali December 10, 2024 14:20
required_providers {
coder = {
source = "coder/coder"
version = ">= 0.11"

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why 0.11? We're on v2.0.2 now.

You'd need to add the coder_monitoring datasource to the terraform provider before we can merge this, do you have a PR in the works for this?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also is there an RFC design on how coder_monitoring will work.?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, I'll open it in a few minutes - I was just willing to open this one to have feedback too as I was not really sure if I was going on the right direction with writing the module this way. 🙏

```tf
module "monitoring" {
source = "registry.coder.com/modules/monitoring/coder"
version = "1.0.0"

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The versioning of modules right now follows the whole repo I believe, so it'd be v1.0.25.

default = ["/"]
}

variable "enabled" {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why do we have a variable for this?
Can use the terraform count to control if the module is added or not.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I imagined we can use this enabled parameter to let users keep the block but just change the enabled variable if they want, for some specific cases, disable it quickly without loosing their configuration, does it make sense ? Otherwise I can delete it and indeed rely on the terraform count (I need to read about it.)

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That's the same purpose the count argument can serve.
It can be set to 0 or 1 to enable or disable the whole module.
If someone is not using the module they can use the count on the data "coder_monitoring" too.
see: https://developer.hashicorp.com/terraform/language/meta-arguments/count

@defelmnq
Copy link
Contributor Author

Hey , thanks for the fast comments.

@matifali I resolved most of your points - just asking a question on the enabled one. ✅

@defelmnq
Copy link
Contributor Author

Closing until approvals on the design ✅ Still some points to validate together first.

@defelmnq defelmnq closed this Dec 10, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants