Configurations in the Flogo App’s YAML File

To register an app with the Flogo Enterprise Monitoring app, provide the following configuration details in the app's YAML file.

  • Labels: The deployment must have a label with the same value provided in the FLOGO_APP_SELECTOR environment variable. For example, if FLOGO_APP_SELECTOR has the value as appType=flogo, the Flogo app must have a label with the key as appType and Name as flogo. The Flogo Enterprise Monitoring app attempts to register the app with this label only. If the label is not provided, the app is ignored.
  • Annotations: The following annotations are mandatory:
    • app.tibco.com/metrics: Setting this annotation to true registers the app with the Flogo Enterprise Monitoring app and enables the metrics collection on the app. Setting the annotation to false deregisters it from the Flogo Enterprise Monitoring app and turns off the metrics collection.
    • app.tibco.com/metrics-port: Provide the HTTP port for the app. This port must be the same as the one specified by the FLOGO_HTTP_SERVICE_PORT environment variable. If an invalid value is set, the app is ignored.

Sample YAML File

App

apiVersion: v1
kind: Service
metadata:
  name: flogoapp
  labels:
    app: flogoapp
spec:
  type: LoadBalancer
  ports:
    - port: 9999
      protocol: TCP
      name: appport
      targetPort: 9999
  selector:
    app: flogoapp
---
apiVersion: apps/v1
kind: Deployment
metadata:
  name: flogoapp
spec:
  selector:
    matchLabels:
      app: flogoapp
  replicas: 2
  template:
    metadata:
      labels:
        app: flogoapp
        appType: flogo
      annotations:
        app.tibco.com/metrics: 'true'
        app.tibco.com/metrics-port: '7777'
    spec:
      containers:
        - name: flogoapp
          image: flogoapp:v1
          imagePullPolicy: Never
          ports:
            - containerPort: 9999
            - containerPort: 7777
          env:
            - name: "FLOGO_HTTP_SERVICE_PORT"
              value: "7777"