# Code generated by KubeVela templates. DO NOT EDIT. Please edit the original cue file.
# Definition source cue file: vela-templates/definitions/registry/metrics.cue
apiVersion: core.oam.dev/v1beta1
kind: TraitDefinition
metadata:
  annotations:
    definition.oam.dev/description: Configures monitoring metrics for your service.
  name: metrics
  namespace: vela-system
spec:
  appliesToWorkloads:
    - deployments.apps
    - jobs.batch
  definitionRef:
    name: metricstraits.standard.oam.dev
  extension:
    install:
      helm:
        name: kube-prometheus-stack
        namespace: monitoring
        repo: prometheus-community
        url: https://prometheus-community.github.io/helm-charts
        version: 9.4.4
  schematic:
    cue:
      template: |
        outputs: metrics: {
        	apiVersion: "standard.oam.dev/v1alpha1"
        	kind:       "MetricsTrait"
        	spec: scrapeService: parameter
        }
        parameter: {
        	// +usage=Format of the metrics, default as prometheus
        	// +short=f
        	format: *"prometheus" | string
        	// +usage=The metrics path of the service
        	path: *"/metrics" | string
        	// +usage=The way to retrieve data which can take the values `http` or `https`
        	scheme:  *"http" | string
        	enabled: *true | bool
        	// +usage=The port for metrics, will discovery automatically by default
        	port: *0 | >=1024 & <=65535 & int
        	// +usage=The label selector for the pods, will discovery automatically by default
        	selector?: [string]: string
        }
  workloadRefPath: spec.workloadRef

