public class Context
extends java.lang.Object
Resource
and
includes utility methods for constructing Metric
s that automatically
attach the Resource
to the Metric
.Constructor and Description |
---|
Context() |
Context(io.opencensus.proto.resource.v1.Resource resource) |
Context(io.opencensus.proto.resource.v1.Resource resource,
boolean debugEnabled) |
Context(io.opencensus.proto.resource.v1.Resource resource,
boolean debugEnabled,
boolean duplicateResourceLabelsOnTimeseries) |
Modifier and Type | Method and Description |
---|---|
io.opencensus.proto.resource.v1.Resource |
getResource()
Get the
Resource in this Context. |
boolean |
isDebugEnabled() |
io.opencensus.proto.metrics.v1.Metric |
metricWithSinglePointTimeseries(java.lang.String name,
io.opencensus.proto.metrics.v1.MetricDescriptor.Type type,
java.util.Map<java.lang.String,java.lang.String> metricLabels,
io.opencensus.proto.metrics.v1.Point point)
Build a
Metric associated with this context's Resource having a single
timeseries containing a single point. |
io.opencensus.proto.metrics.v1.Metric |
metricWithSinglePointTimeseries(java.lang.String name,
io.opencensus.proto.metrics.v1.MetricDescriptor.Type type,
java.util.Map<java.lang.String,java.lang.String> metricLabels,
io.opencensus.proto.metrics.v1.Point point,
com.google.protobuf.Timestamp startTimestamp)
Build a
Metric associated with this context's Resource having a single
timeseries containing a single point. |
io.confluent.telemetry.MetricBuilderFacade |
newMetricBuilder()
Create a new
MetricBuilderFacade pre-populated with this Context's Resource |
public Context()
public Context(io.opencensus.proto.resource.v1.Resource resource)
public Context(io.opencensus.proto.resource.v1.Resource resource, boolean debugEnabled)
public Context(io.opencensus.proto.resource.v1.Resource resource, boolean debugEnabled, boolean duplicateResourceLabelsOnTimeseries)
public io.opencensus.proto.resource.v1.Resource getResource()
Resource
in this Context.
The Resource
represents the entity for which telemetry is being collected.
The Resource
must be set on every Metric
collected and reported.
This can be enforced by using the newMetricBuilder()
method to construct Metrics
.
public boolean isDebugEnabled()
public io.opencensus.proto.metrics.v1.Metric metricWithSinglePointTimeseries(java.lang.String name, io.opencensus.proto.metrics.v1.MetricDescriptor.Type type, java.util.Map<java.lang.String,java.lang.String> metricLabels, io.opencensus.proto.metrics.v1.Point point)
Metric
associated with this context's Resource
having a single
timeseries containing a single point.MetricBuilderFacade.addSinglePointTimeseries(Point)
public io.opencensus.proto.metrics.v1.Metric metricWithSinglePointTimeseries(java.lang.String name, io.opencensus.proto.metrics.v1.MetricDescriptor.Type type, java.util.Map<java.lang.String,java.lang.String> metricLabels, io.opencensus.proto.metrics.v1.Point point, com.google.protobuf.Timestamp startTimestamp)
Metric
associated with this context's Resource
having a single
timeseries containing a single point.MetricBuilderFacade.addSinglePointTimeseries(Point, Timestamp)
public io.confluent.telemetry.MetricBuilderFacade newMetricBuilder()
MetricBuilderFacade
pre-populated with this Context's Resource