You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Metrics and mapping rules are defined in the backend
Product simply "consumes" the backend, and define application plans
I encounter the following issue : the Product CRD fails to be processed with the following message :
'[spec.applicationPlans[free].limits[1].metricMethodRef: Invalid value: "callsToPremium": limit does not have valid local metric or method reference., spec.applicationPlans[payAsYouGo].pricingRules[0].metricMethodRef: Invalid value: "callsToPremium": Pricing rule does not have valid local metric or method reference., spec.applicationPlans[payAsYouGo].pricingRules[1].metricMethodRef: Invalid value: "callsToPremium": Pricing rule does not have valid local metric or method reference., spec.applicationPlans[payAsYouGo].pricingRules[2].metricMethodRef: Invalid value: "callsToV2": Pricing rule does not have valid local metric or method reference.]'
It requires to redefine the metrics on product-side, which is - in theory? - unnecessary
Backend CRD :
apiVersion: capabilities.3scale.net/v1beta1
kind: Backend
metadata:
name: micro-api-backend
namespace: api-gateways
spec:
mappingRules:
- httpMethod: GET
increment: 1
metricMethodRef: callsToPremium
pattern: '/{version}/premium-service'
- httpMethod: GET
increment: 1
metricMethodRef: callsToV2
pattern: /v2/
- httpMethod: GET
increment: 1
metricMethodRef: callsToV1
pattern: /v1/
metrics:
hits:
description: Number of API hits
friendlyName: Hits
unit: hit
callsToV2:
description: Number of calls to API V2
friendlyName: V2 Calls
unit: hit
callsToV1:
description: Number of calls to API V2
friendlyName: V1 Calls
unit: hit
callsToPremium:
description: Number of premium API calls
friendlyName: Premium Calls
unit: hit
name: MicroApi Backend
privateBaseURL: 'http://micro-api'
systemName: micro-api-backend
providerAccountRef:
name: threescale-provider-account
My guess is that it is missing the reference to the backend in the limit. Note that the first defined limit (request per day) has reference to backend. If backend is not referenced, the operator tries to link to a metric defined in the product itself. If the metric is not found in the product, raises the shown error.
Hello,
I have the following use case :
I encounter the following issue : the Product CRD fails to be processed with the following message :
It requires to redefine the metrics on product-side, which is - in theory? - unnecessary
Backend CRD :
Product CRD (failing version) :
Thanks,
The text was updated successfully, but these errors were encountered: