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