OpsMx Provider Configmap

OpsMx metric provider parameters can be specified in a configmap and you can call that configmap in the Analysis template under the job section.

Follow the procedure below to create OpsMx Provider Configmap.

Create a configmap with opsmx metric provider information which includes Log and Metric templates according to your requirements as shown below. Sample “OpsMx Provider Configmap” yaml file is available here.

For more information on how to create Log and Metric templates in ISD UI, refer here.

For more information on how to create Log and Metric templates in GitHub, refer here.

apiVersion: v1
kind: ConfigMap
metadata:
  name: opsmx-provider-config
data:
  providerConfig: |
    application: rollout-app
    user: admin
    gateUrl: 'https://isd-argofull.isd-dev.opsmx.net/'
    lifetimeMinutes: 30
    intervalTime: 10
    lookBackType: sliding
    gitops: true
    passScore: 80
    serviceList:
    - serviceName: rollout-app-svc
      metricScopeVariables: "${app_key},${host_key}"
      baselineMetricScope: "rollout-app,{{env.STABLE_POD_HASH}}"
      canaryMetricScope: "rollout-app,{{env.LATEST_POD_HASH}}"
      metricTemplateName: "newrelic-verifier"
      metricTemplateVersion: "v1.0"
      logTemplateName: elasticsearch-verifier
      logScopeVariables: "resource.labels.pod_name"
      baselineLogScope: ".*{{env.STABLE_POD_HASH}}.*"
      canaryLogScope: ".*{{env.LATEST_POD_HASH}}.*"
      logTemplateVersion: "v1.0"

The “providerConfig” has the following mandatory and optional parameters. Mandatory parameters control analysis execution. The rest of the parameters(Optional) provide the ability to customize at runtime.

  • profile(Optional): “profile” parameter is used to pass the name of the secrets file required to process the necessary configuration of Argo for using opsmx for analysis. If not given, the default secret file named “opsmx-profile” will be picked up.

  • gateUrl(Optional): “gate” parameter is used as an end-point url to ISD Service. If not given, the default end-point URL provided inside the secrets file will be used.

  • application: “application” parameter needs to be same as the name of application in use while operating from ArgoCD.

  • user(Optional): “user” parameter is used to pass the necessary identification details of the user for authorization purposes. If not given, the default user will be picked up from the secrets file provided.

  • baselineStartTime(Optional): “baselineStartTime” parameter is used to pass a DATETIME stamp of choice for the analysis of baseline. If not given, analysis will make use of the current DATETIME stamp(Format: YYYY-MM-DDTHH:MM:SSZ).

    • Sample for 10th August

      • 2022 13:55: 2022-08-10T13:15:00Z – ONLY GMT Time Accepted,

  • canaryStartTime(Optional): “canaryStartTime” parameter is used to pass a DATETIME stamp of choice for the analysis of the canary. If not given, analysis will make use of the current DATETIME stamp(Format: YYYY-MM-DDTHH:MM:SSZ).

    • Sample for 10th August 2022 13:55:

      • 2022-08-10T13:15:00Z – ONLY GMT Time Accepted.

  • gitops: gitops parameter is a boolean flag. The user is given the flexibility to create metric and log templates in ISD and also, to maintain them as config maps via GitOps.

    • If set to “true”, the metric provider prioritizes the presence of template as config map, and if not found, tries to load it from ISD. gitops: true

    • If set to “false”, the provider only loads it from ISD.

      Note: If you want to load the Log and Metric templates from ISD, do not specify the following parameters from the Analysis template.

           volumeMounts:
            - name: metric-config-volume
              mountPath: /etc/config/templates
      
           volumes:
            - name: metric-config-volume
              configMap:
                name: metrixtemplates

    Note: If you are specifying Log/Metric templates with the same template name for multiple services and the source of one template is ISD UI and the source of the other template is GitHub, always it is recommended to specify the template version number for the template which is being picked from ISD UI. It is not required to specify template version number for the template that is being picked from GitHub.

  • threshold: “threshold” parameter is used to declare the pass & marginal threshold value for the analysis to be evaluated.

  • pass: “pass” parameter is used to determine the threshold for passing the analysis-run. If the analysis score obtained is greater than or equal to the “pass” threshold that has been set, then the analysis-run is deemed as successful.

  • marginal: “marginal” parameter is used to determine the threshold below which the analysis-run will be deemed as failed. If the analysis score obtained is greater than or equal to the “marginal” threshold that has been set, but it is below pass threshold, then the analysis-run is deemed as Inconclusive.

  • serviceList: Multiple services can be defined to generate the score service wise. Although, OpsMx judges the analysis result based on aggregated score.

  • lifetimeMinutes(Optional): “lifetimeMinutes” parameter is used for determining the total duration for which the analysis run has to take place in minutes. If not given, lifetimeMinutes will be calculated using the “endTime” parameter. In case if you give both “lifetimeMinutes” & “endTime”, the “lifetimeMinutes” will be used.

  • endTime(Optional): “endTime” parameter is used to determine the date timestamp at which the analysis should stop. “endTime” parameter will be used only if “lifetimeMinutes” is not given. In case if you give both “lifetimeMinutes” & “endTime”, the “lifetimeMinutes” will be used. You are expected to pass either the lifetimeMinutes or the endTime parameter.

  • delay(Optional): “delay” parameter is used to introduce a specific delay before analysis begins. Delay works only if specified.

  • globalLogTemplate(Optional): “globalLogTemplate” parameter is used as a reference for “log template” to be used for services where log placeholder values are given but “log template” isn’t explicitly mentioned.

  • globalMetricTemplate(Optional): “globalMetricTemplate” parameter is used as a reference for “metric template” to be used for services where metric placeholder values are given but “metric template” isn’t explicitly mentioned.

  • serviceName(Optional): “serviceName” parameter is used to specify the name for specific services. If not given default service names will be used.

  • metricScopeVariables(Optional): “metricScopeVariables” parameter is used to specify the “Metric Scope Placeholder ” used in the metric template for the specific service. For example, in the configmap the metricScopeVariables parameter has two placeholders namely namespace_key and pod_key separated by a comma, these placeholders will be defined in the query as follows

    sum(kube_pod_status_ready{condition="false", namespace="namespace_key"})

    At runtime the value of these parameters would be replaced by what is declared in baselineMetricScope and canaryMetricScope in the query.

    metricScopeVariables: "namespace_key,pod_key"
    baselineMetricScope: "argocd,.*{{args.baseline-hash}}.*"
    canaryMetricScope: "argocd,.*{{args.canary-hash}}.*"

  • baselineMetricScope(Optional): “baselineMetricScope” parameter is used to pass the baseline values for metric analysis of the specific service.

  • canaryMetricScope(Optional): “canaryMetricScope” parameter is used to pass the canary values for metric analysis of the specific service.

  • metricTemplateName(Optional): “metricTemplateName” parameter is used to specify the metric template to be used for a specific service during the analysis Run. If not given, globalMetricTemplate will be used if metric placeholder values are given for a specific service.

  • metricTemplateVersion(Optional): “metricTemplateVersion” parameter is used to specify the metric template version to be used for a specific service during the analysis-run. If not given, the last template version used for this service will be used for the analysis-run.

  • logTemplateName(Optional): “logTemplateName” parameter is used to specify the log template to be used for a specific service during the analysis Run. If not given, globalLogTemplate will be used if log placeholder values are given for a specific service.

  • logTemplateVersion(Optional): “logTemplateVersion” parameter is used to specify the log template version to be used for a specific service during the analysis-run. If not given, the last template version used for this service will be used for the analysis-run.

  • logScopeVariables(Optional): “logScopeVariables” parameter is used to specify the “QueryFilterKey” used in the log template for the specific service.

  • baselineLogScope(Optional): “baselineLogScope” parameter is used to pass the baseline values for log analysis of the specific service.

  • canaryLogScope(Optional): “canaryLogScope” parameter is used to pass the canary values for log analysis of the specific service.

  • intervalTime: This field defines the length of each interval. The value of intervalTime can be less than or equal to lifetimeMinutes, not greater than that.

  • lookBackType: This field can carry two values, sliding or growing. The above example shows “lookBackType” as ‘growing’, the same can be set to ‘sliding’ to switch to sliding mode.

    • In case of “growing” window analysis, the duration of the interval keeps adding to the previous interval.

    • In case of “sliding” window analysis, the duration of the interval keeps shifting further starting from the end of the previous interval.

Last updated