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: maintain views as code #225

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

feat: maintain views as code #225

wants to merge 1 commit into from

Conversation

bripkens
Copy link
Member

Why

Sharing views with your team mates is very helpful to standardize workflows. Maintaining these views as code just helps go the extra mile.

What

Support the Dash0View custom resource and maintain is it within Dash0 via the API.

# Why
Sharing views with your team mates is very helpful to standardize
workflows. Maintaining these views as code just helps go the extra
mile.

# What
Support the `Dash0View` custom resource and maintain is it within
Dash0 via the API.
Copy link
Member

@basti1302 basti1302 left a comment

Choose a reason for hiding this comment

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

I know this is still a draft but I was curious and thought I might as well leave some early feedback while having a look. Of course I can also take over this effort, depending on what you prefer.

default: true
description: |-
If enabled, the operator will watch Dash0 view resources in this namespace and create corresponding views in Dash0 via the Dash0 API.
See https://github.com/dash0hq/dash0-operator/blob/main/helm-chart/dash0-operator/README.md#managing-dash0-check-rules-with-the-operator
Copy link
Member

Choose a reason for hiding this comment

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

issue: wrong link (points to check rules management)

Suggested change
See https://github.com/dash0hq/dash0-operator/blob/main/helm-chart/dash0-operator/README.md#managing-dash0-check-rules-with-the-operator
See https://github.com/dash0hq/dash0-operator/blob/main/helm-chart/dash0-operator/README.md#managing-dash0-views

Comment on lines +900 to +903
Furthermore, the custom resource definition for Dash0 views needs to be installed in the cluster. There are two
ways to achieve this:

**TODO**
Copy link
Member

Choose a reason for hiding this comment

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

suggestion: Since this wouldn't be a "foreign" resource type (like Prometheus rules or Perses dashboards) but a Dash0 resource type, we should rather create a Dash0View resource type in this repo (similar to Dash0Monitoring or Dash0OperatorConfiguration) and install it unconditionally via the operator Helm chart. You already added the Helm bits for that. We also need the corresponding Go type definitions in api/dash0monitoring/v1alpha/dash0view_types.go, similar to the existing _types.go files we already have there for our existing two Dash0 resource types.

Then we can remove this section, this particular precondition would always be satisfied when the operator is installed.

Unless, of course, there is an open-source, de-facto standard K8s resource type describing views, that roughly matches what we need. But I don't think that something like this exists.

@@ -0,0 +1,181 @@
---
Copy link
Member

Choose a reason for hiding this comment

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

remark: I assume you used one of the other Helm custom resource types as a blueprint. The way we usually would create and maintain the Helm definitions for custom resources would be Go-code first:

  • Describe the resource type in api/dash0monitoring/v1alpha/dash0view_types.go
  • Run make generate to have config/crd/bases/operator.dash0.com_dash0views.yaml generated
  • Copy that file over to helm-chart/dash0-operator/templates/operator/custom-resource-definition-dash0view.yaml

It is a bit cumbersome (due to the fact that the operator framework and tooling works with kustomize instead of Helm), but it ensures that actual instances of the resource type can be properly deserialized at runtime.

@@ -397,6 +405,34 @@ spec:
description: Shows results of synchronizing Prometheus rule resources
in this namespace via the Dash0 API.
type: object
viewSynchronizationResults:
Copy link
Member

Choose a reason for hiding this comment

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

suggestion: This change in the monitoring resource should also follow the Go-code first approach outlined above.

@basti1302 basti1302 force-pushed the main branch 3 times, most recently from 54965be to 9df120f Compare February 5, 2025 17:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants