@@ -47,57 +47,6 @@ func resourceLoggingMetric() *schema.Resource {
4747 Description : `An advanced logs filter (https://cloud.google.com/logging/docs/view/advanced-filters) which
4848is used to match log entries.` ,
4949 },
50- "metric_descriptor" : {
51- Type : schema .TypeList ,
52- Required : true ,
53- Description : `The metric descriptor associated with the logs-based metric.` ,
54- MaxItems : 1 ,
55- Elem : & schema.Resource {
56- Schema : map [string ]* schema.Schema {
57- "metric_kind" : {
58- Type : schema .TypeString ,
59- Required : true ,
60- ValidateFunc : validateEnum ([]string {"DELTA" , "GAUGE" , "CUMULATIVE" }),
61- Description : `Whether the metric records instantaneous values, changes to a value, etc.
62- Some combinations of metricKind and valueType might not be supported.
63- For counter metrics, set this to DELTA. Possible values: ["DELTA", "GAUGE", "CUMULATIVE"]` ,
64- },
65- "value_type" : {
66- Type : schema .TypeString ,
67- Required : true ,
68- ValidateFunc : validateEnum ([]string {"BOOL" , "INT64" , "DOUBLE" , "STRING" , "DISTRIBUTION" , "MONEY" }),
69- Description : `Whether the measurement is an integer, a floating-point number, etc.
70- Some combinations of metricKind and valueType might not be supported.
71- For counter metrics, set this to INT64. Possible values: ["BOOL", "INT64", "DOUBLE", "STRING", "DISTRIBUTION", "MONEY"]` ,
72- },
73- "display_name" : {
74- Type : schema .TypeString ,
75- Optional : true ,
76- Description : `A concise name for the metric, which can be displayed in user interfaces. Use sentence case
77- without an ending period, for example "Request count". This field is optional but it is
78- recommended to be set for any metrics associated with user-visible concepts, such as Quota.` ,
79- },
80- "labels" : {
81- Type : schema .TypeSet ,
82- Optional : true ,
83- Description : `The set of labels that can be used to describe a specific instance of this metric type. For
84- example, the appengine.googleapis.com/http/server/response_latencies metric type has a label
85- for the HTTP response code, response_code, so you can look at latencies for successful responses
86- or just for responses that failed.` ,
87- Elem : loggingMetricMetricDescriptorLabelsSchema (),
88- // Default schema.HashSchema is used.
89- },
90- "unit" : {
91- Type : schema .TypeString ,
92- Optional : true ,
93- Description : `The unit in which the metric value is reported. It is only applicable if the valueType is
94- 'INT64', 'DOUBLE', or 'DISTRIBUTION'. The supported units are a subset of
95- [The Unified Code for Units of Measure](http://unitsofmeasure.org/ucum.html) standard` ,
96- Default : "1" ,
97- },
98- },
99- },
100- },
10150 "name" : {
10251 Type : schema .TypeString ,
10352 Required : true ,
@@ -218,6 +167,61 @@ have an associated extractor expression in this map. The syntax of the extractor
218167the same as for the valueExtractor field.` ,
219168 Elem : & schema.Schema {Type : schema .TypeString },
220169 },
170+ "metric_descriptor" : {
171+ Type : schema .TypeList ,
172+ Computed : true ,
173+ Optional : true ,
174+ Description : `The optional metric descriptor associated with the logs-based metric.
175+ If unspecified, it uses a default metric descriptor with a DELTA metric kind,
176+ INT64 value type, with no labels and a unit of "1". Such a metric counts the
177+ number of log entries matching the filter expression.` ,
178+ MaxItems : 1 ,
179+ Elem : & schema.Resource {
180+ Schema : map [string ]* schema.Schema {
181+ "metric_kind" : {
182+ Type : schema .TypeString ,
183+ Required : true ,
184+ ValidateFunc : validateEnum ([]string {"DELTA" , "GAUGE" , "CUMULATIVE" }),
185+ Description : `Whether the metric records instantaneous values, changes to a value, etc.
186+ Some combinations of metricKind and valueType might not be supported.
187+ For counter metrics, set this to DELTA. Possible values: ["DELTA", "GAUGE", "CUMULATIVE"]` ,
188+ },
189+ "value_type" : {
190+ Type : schema .TypeString ,
191+ Required : true ,
192+ ValidateFunc : validateEnum ([]string {"BOOL" , "INT64" , "DOUBLE" , "STRING" , "DISTRIBUTION" , "MONEY" }),
193+ Description : `Whether the measurement is an integer, a floating-point number, etc.
194+ Some combinations of metricKind and valueType might not be supported.
195+ For counter metrics, set this to INT64. Possible values: ["BOOL", "INT64", "DOUBLE", "STRING", "DISTRIBUTION", "MONEY"]` ,
196+ },
197+ "display_name" : {
198+ Type : schema .TypeString ,
199+ Optional : true ,
200+ Description : `A concise name for the metric, which can be displayed in user interfaces. Use sentence case
201+ without an ending period, for example "Request count". This field is optional but it is
202+ recommended to be set for any metrics associated with user-visible concepts, such as Quota.` ,
203+ },
204+ "labels" : {
205+ Type : schema .TypeSet ,
206+ Optional : true ,
207+ Description : `The set of labels that can be used to describe a specific instance of this metric type. For
208+ example, the appengine.googleapis.com/http/server/response_latencies metric type has a label
209+ for the HTTP response code, response_code, so you can look at latencies for successful responses
210+ or just for responses that failed.` ,
211+ Elem : loggingMetricMetricDescriptorLabelsSchema (),
212+ // Default schema.HashSchema is used.
213+ },
214+ "unit" : {
215+ Type : schema .TypeString ,
216+ Optional : true ,
217+ Description : `The unit in which the metric value is reported. It is only applicable if the valueType is
218+ 'INT64', 'DOUBLE', or 'DISTRIBUTION'. The supported units are a subset of
219+ [The Unified Code for Units of Measure](http://unitsofmeasure.org/ucum.html) standard` ,
220+ Default : "1" ,
221+ },
222+ },
223+ },
224+ },
221225 "value_extractor" : {
222226 Type : schema .TypeString ,
223227 Optional : true ,
0 commit comments