Skip to content

Commit

Permalink
Add store_id label to monitoring snippets. (#1450)
Browse files Browse the repository at this point in the history
  • Loading branch information
dzlier-gcp committed Jun 10, 2019
1 parent a746dbe commit f3d477a
Showing 1 changed file with 5 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@

package com.example.monitoring;

import com.google.api.LabelDescriptor;
import com.google.api.Metric;
import com.google.api.MetricDescriptor;
import com.google.api.MonitoredResource;
Expand Down Expand Up @@ -100,6 +101,10 @@ void createMetricDescriptor(String type) throws IOException {

MetricDescriptor descriptor = MetricDescriptor.newBuilder()
.setType(metricType)
.addLabels(LabelDescriptor
.newBuilder()
.setKey("store_id")
.setValueType(LabelDescriptor.ValueType.STRING))
.setDescription("This is a simple example of a custom metric.")
.setMetricKind(MetricDescriptor.MetricKind.GAUGE)
.setValueType(MetricDescriptor.ValueType.DOUBLE)
Expand Down

0 comments on commit f3d477a

Please sign in to comment.