Sign up and get started with Confidence today! Create your account
Sign up and get started with Confidence today! Create your account
Create a metric. A metric is a general description of how to aggregate a measurement from a fact table to an entity. For example, averaging the number of seconds a user has been on a page, from a fact table of page views.
curl --request POST \
--url https://metrics.eu.confidence.dev/v1/metrics \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"displayName": "<string>",
"entity": "<string>",
"factTable": "<string>",
"typeSpec": {},
"name": "<string>",
"description": "<string>",
"aggregationWindow": {},
"exposureOffset": {},
"measurementConfig": {
"openWindow": {}
},
"varianceReductionConfig": {
"disabled": true,
"aggregationWindowOverride": {}
},
"nullHandling": {
"replaceMeasureNullWithZero": true,
"replaceEntityNullWithZero": true
},
"preferredDirection": "PREFERRED_DIRECTION_UNSPECIFIED",
"defaultEffectSize": {
"value": "<string>"
},
"filterString": "<string>",
"labels": [
{}
],
"owner": "<string>",
"etag": "<string>",
"measurement": "<string>"
}
'{
"displayName": "<string>",
"entity": "<string>",
"factTable": "<string>",
"typeSpec": {
"averageMetricSpec": {
"aggregation": {
"type": "AGGREGATION_TYPE_UNSPECIFIED",
"threshold": {
"threshold": {
"value": "<string>"
},
"direction": "AGGREGATION_THRESHOLD_DIRECTION_UNSPECIFIED"
},
"cap": {
"min": {
"value": "<string>"
},
"max": {
"value": "<string>"
}
}
},
"measurement": {
"name": "<string>",
"type": "COLUMN_TYPE_UNSPECIFIED",
"repeated": true
}
},
"ratioMetricSpec": {
"numeratorAggregation": {
"type": "AGGREGATION_TYPE_UNSPECIFIED",
"threshold": {
"threshold": {
"value": "<string>"
},
"direction": "AGGREGATION_THRESHOLD_DIRECTION_UNSPECIFIED"
},
"cap": {
"min": {
"value": "<string>"
},
"max": {
"value": "<string>"
}
}
},
"denominatorAggregation": {
"type": "AGGREGATION_TYPE_UNSPECIFIED",
"threshold": {
"threshold": {
"value": "<string>"
},
"direction": "AGGREGATION_THRESHOLD_DIRECTION_UNSPECIFIED"
},
"cap": {
"min": {
"value": "<string>"
},
"max": {
"value": "<string>"
}
}
},
"numerator": {
"name": "<string>",
"type": "COLUMN_TYPE_UNSPECIFIED",
"repeated": true
},
"denominator": {
"name": "<string>",
"type": "COLUMN_TYPE_UNSPECIFIED",
"repeated": true
},
"numeratorFilter": {
"criteria": [
{}
],
"expression": {
"ref": "<string>",
"not": {},
"and": {
"operands": [
{}
]
},
"or": {
"operands": [
{}
]
}
}
}
}
},
"createTime": {},
"updateTime": {},
"creator": "<string>",
"updater": "<string>",
"name": "<string>",
"description": "<string>",
"aggregationWindow": {},
"exposureOffset": {},
"measurementConfig": {
"closedWindow": {
"aggregationWindow": {},
"exposureOffset": {}
},
"semiOpenWindow": {
"aggregationWindow": {},
"exposureOffset": {}
},
"openWindow": {}
},
"varianceReductionConfig": {
"disabled": true,
"aggregationWindowOverride": {}
},
"nullHandling": {
"replaceMeasureNullWithZero": true,
"replaceEntityNullWithZero": true
},
"derivedUnit": {
"numerator": {
"baseUnitMultiplier": 123,
"baseUnit": "BASE_UNIT_UNSPECIFIED",
"currencyCode": "<string>",
"customUnit": "<string>",
"entity": "<string>",
"factTable": "<string>"
},
"denominator": {
"baseUnitMultiplier": 123,
"baseUnit": "BASE_UNIT_UNSPECIFIED",
"currencyCode": "<string>",
"customUnit": "<string>",
"entity": "<string>",
"factTable": "<string>"
}
},
"preferredDirection": "PREFERRED_DIRECTION_UNSPECIFIED",
"defaultEffectSize": {
"value": "<string>"
},
"filter": {
"criteria": [
{}
],
"expression": {
"ref": "<string>",
"not": {},
"and": {
"operands": [
{}
]
},
"or": {
"operands": [
{}
]
}
}
},
"filterString": "<string>",
"deleteTime": {},
"labels": [
{}
],
"systemCreated": true,
"owner": "<string>",
"etag": "<string>",
"measurement": "<string>"
}Documentation Index
Fetch the complete documentation index at: https://confidence.spotify.com/llms.txt
Use this file to discover all available pages before exploring further.
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
The id to the give the created metric. If a not set a random one will be generated.
Human friendly name of the metric.
Resource name of the entity that the metric is defined on.
Resource name of the fact table that the metric is based on.
The kind of metric.
Show child attributes
Unique identifier of the metric.
For example: metrics/0smva5nxuhv4yts6paxt
Description of the metric.
Size of the window that the measurements are aggregated within the user.
Offset relative to the first exposure that measurements should start to be collected.
Defines on what time window measurements are aggregated on.
Show child attributes
Configuration for variance reduction of the metric.
Show child attributes
Determines how NULLs should be handled.
Show child attributes
The preferred direction for this metric.
PREFERRED_DIRECTION_UNSPECIFIED, INCREASE, DECREASE The default relative effect size (MDE/NIM) for this metric. Will be used to auto-populate with the effect size when creating a new experiment.
Show child attributes
An optional metric filter that will be used to filter the fact table the metric is derived from.
Show child attributes
A SQL string version of the metric filter. Set either this or filter when updating the metric.
Custom labels for this metric.
Show child attributes
The owner of the resource. If not set will default to the creator.
The etag for this metric. Used for optimistic concurrency control.
Reference to the measurement that this metric is based on.
Returns a Metric.
A general description of how to aggregate a measurement from a fact table across entities.
Human friendly name of the metric.
Resource name of the entity that the metric is defined on.
Resource name of the fact table that the metric is based on.
The kind of metric.
Show child attributes
Time when the metric was first created.
Time when the metric was last updated.
Reference to the identity that created this metric.
Reference to the identity that last updated this metric.
Unique identifier of the metric.
For example: metrics/0smva5nxuhv4yts6paxt
Description of the metric.
Size of the window that the measurements are aggregated within the user.
Offset relative to the first exposure that measurements should start to be collected.
Defines on what time window measurements are aggregated on.
Show child attributes
Configuration for variance reduction of the metric.
Show child attributes
Determines how NULLs should be handled.
Show child attributes
The unit inferred for this metric based on the input units of the measures.
Show child attributes
The preferred direction for this metric.
PREFERRED_DIRECTION_UNSPECIFIED, INCREASE, DECREASE The default relative effect size (MDE/NIM) for this metric. Will be used to auto-populate with the effect size when creating a new experiment.
Show child attributes
An optional metric filter that will be used to filter the fact table the metric is derived from.
Show child attributes
A SQL string version of the metric filter. Set either this or filter when updating the metric.
Time when the metric was deleted.
Custom labels for this metric.
Show child attributes
If this metric is an automatically created internal metric.
The owner of the resource. If not set will default to the creator.
The etag for this metric. Used for optimistic concurrency control.
Reference to the measurement that this metric is based on.
Was this page helpful?
curl --request POST \
--url https://metrics.eu.confidence.dev/v1/metrics \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"displayName": "<string>",
"entity": "<string>",
"factTable": "<string>",
"typeSpec": {},
"name": "<string>",
"description": "<string>",
"aggregationWindow": {},
"exposureOffset": {},
"measurementConfig": {
"openWindow": {}
},
"varianceReductionConfig": {
"disabled": true,
"aggregationWindowOverride": {}
},
"nullHandling": {
"replaceMeasureNullWithZero": true,
"replaceEntityNullWithZero": true
},
"preferredDirection": "PREFERRED_DIRECTION_UNSPECIFIED",
"defaultEffectSize": {
"value": "<string>"
},
"filterString": "<string>",
"labels": [
{}
],
"owner": "<string>",
"etag": "<string>",
"measurement": "<string>"
}
'{
"displayName": "<string>",
"entity": "<string>",
"factTable": "<string>",
"typeSpec": {
"averageMetricSpec": {
"aggregation": {
"type": "AGGREGATION_TYPE_UNSPECIFIED",
"threshold": {
"threshold": {
"value": "<string>"
},
"direction": "AGGREGATION_THRESHOLD_DIRECTION_UNSPECIFIED"
},
"cap": {
"min": {
"value": "<string>"
},
"max": {
"value": "<string>"
}
}
},
"measurement": {
"name": "<string>",
"type": "COLUMN_TYPE_UNSPECIFIED",
"repeated": true
}
},
"ratioMetricSpec": {
"numeratorAggregation": {
"type": "AGGREGATION_TYPE_UNSPECIFIED",
"threshold": {
"threshold": {
"value": "<string>"
},
"direction": "AGGREGATION_THRESHOLD_DIRECTION_UNSPECIFIED"
},
"cap": {
"min": {
"value": "<string>"
},
"max": {
"value": "<string>"
}
}
},
"denominatorAggregation": {
"type": "AGGREGATION_TYPE_UNSPECIFIED",
"threshold": {
"threshold": {
"value": "<string>"
},
"direction": "AGGREGATION_THRESHOLD_DIRECTION_UNSPECIFIED"
},
"cap": {
"min": {
"value": "<string>"
},
"max": {
"value": "<string>"
}
}
},
"numerator": {
"name": "<string>",
"type": "COLUMN_TYPE_UNSPECIFIED",
"repeated": true
},
"denominator": {
"name": "<string>",
"type": "COLUMN_TYPE_UNSPECIFIED",
"repeated": true
},
"numeratorFilter": {
"criteria": [
{}
],
"expression": {
"ref": "<string>",
"not": {},
"and": {
"operands": [
{}
]
},
"or": {
"operands": [
{}
]
}
}
}
}
},
"createTime": {},
"updateTime": {},
"creator": "<string>",
"updater": "<string>",
"name": "<string>",
"description": "<string>",
"aggregationWindow": {},
"exposureOffset": {},
"measurementConfig": {
"closedWindow": {
"aggregationWindow": {},
"exposureOffset": {}
},
"semiOpenWindow": {
"aggregationWindow": {},
"exposureOffset": {}
},
"openWindow": {}
},
"varianceReductionConfig": {
"disabled": true,
"aggregationWindowOverride": {}
},
"nullHandling": {
"replaceMeasureNullWithZero": true,
"replaceEntityNullWithZero": true
},
"derivedUnit": {
"numerator": {
"baseUnitMultiplier": 123,
"baseUnit": "BASE_UNIT_UNSPECIFIED",
"currencyCode": "<string>",
"customUnit": "<string>",
"entity": "<string>",
"factTable": "<string>"
},
"denominator": {
"baseUnitMultiplier": 123,
"baseUnit": "BASE_UNIT_UNSPECIFIED",
"currencyCode": "<string>",
"customUnit": "<string>",
"entity": "<string>",
"factTable": "<string>"
}
},
"preferredDirection": "PREFERRED_DIRECTION_UNSPECIFIED",
"defaultEffectSize": {
"value": "<string>"
},
"filter": {
"criteria": [
{}
],
"expression": {
"ref": "<string>",
"not": {},
"and": {
"operands": [
{}
]
},
"or": {
"operands": [
{}
]
}
}
},
"filterString": "<string>",
"deleteTime": {},
"labels": [
{}
],
"systemCreated": true,
"owner": "<string>",
"etag": "<string>",
"measurement": "<string>"
}