public class Context extends Object
Resource
and
includes utility methods for constructing Metric
s that automatically
attach the Resource
to the Metric
.Constructor and Description |
---|
Context(io.opencensus.proto.resource.v1.Resource resource,
String domain) |
Context(io.opencensus.proto.resource.v1.Resource resource,
String domain,
boolean debugEnabled) |
Context(String domain) |
Modifier and Type | Method and Description |
---|---|
io.opencensus.proto.metrics.v1.Metric |
buildMetric(MetricBuilderFacade builder)
Set the context for
MetricBuilderFacade and build a Metric |
String |
getDomain() |
io.opencensus.proto.resource.v1.Resource |
getResource()
Get the
Resource in this Context. |
boolean |
isDebugEnabled() |
public Context(String domain)
public Context(io.opencensus.proto.resource.v1.Resource resource, String domain)
public Context(io.opencensus.proto.resource.v1.Resource resource, String domain, boolean debugEnabled)
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 buildMetric(MetricBuilderFacade)
()} method to construct Metrics
.
public boolean isDebugEnabled()
public String getDomain()
public io.opencensus.proto.metrics.v1.Metric buildMetric(MetricBuilderFacade builder)
MetricBuilderFacade
and build a Metric