Age | Commit message (Collapse) | Author |
|
|
|
This commit takes the approach of implementing Log4j's ContextDataInjector. It
inserts three keys into each log event: "`openCensusTraceId`", "`openCensusSpanId`",
and "`openCensusTraceSampled`". The tracing data can be accessed with
LogEvent.getContextData() or included in a layout. See
https://logging.apache.org/log4j/2.x/log4j-core/apidocs/org/apache/logging/log4j/core/ContextDataInjector.html.
Here is an example of a pattern layout that includes all three tracing fields
and a log entry that could be produced by the layout:
Pattern layout:
"`%d{HH:mm:ss.SSS} [%t] traceId=%X{openCensusTraceId} spanId=%X{openCensusSpanId} sampled=%X{openCensusTraceSampled} %-5level %logger{36} - %msg%n`"
Log entry:
"`20:45:52.929 [main] traceId=0af7a7bef890695f1c5e85a8e7290164 spanId=d3f07c467ec2fbb2 sampled=true WARN io.opencensus.contrib.logcorrelation.log4j.demo.OpenCensusLog4jLogCorrelationDemo - my log message`"
The ContextDataInjector implementation must be specified with a system property,
i.e.,
"`-Dlog4j2.contextDataInjector=io.opencensus.contrib.logcorrelation.log4j.OpenCensusTraceContextDataInjector`".
The system property
"`io.opencensus.contrib.logcorrelation.log4j.OpenCensusTraceContextDataInjector.spanSelection`"
controls whether tracing data is added to all spans, no spans, or only sampled spans.
|
|
OpenCensusTraceLoggingEnhancer. (#1386)
Avoiding accessing the OpenCensus tracing implementation early in initialization
is more robust. See the discussion in
https://github.com/census-instrumentation/opencensus-java/pull/1371#discussion_r211440915
and
https://github.com/census-instrumentation/opencensus-java/pull/1371#discussion_r211441000.
|
|
|
|
|
|
|
|
* Implement CurrentStatsState using atomic variables.
* Ignore findbugs warning and add changelog comments.
|
|
* Make an internal function static.
* Make other functions static too.
|
|
* Remove match pattern from MutableAggregation.
* Update comments in MutableAggregation.
|
|
|
|
|
|
* Update all targets to at least java7 and android14
* Change code to be android14 compatible.
* Select a specific version for each signature.
|
|
* Fix stats to metrics implementation.
* Fix imports and logic to handle gauges.
* Fix checker framework
* fix style.
|
|
|
|
This commit also merges new changes to checkstyle.xml and fixes new checkstyle
warnings related to Javadocs.
|
|
* Stats: Implement MetricProducer in Stats.
* Add unit tests.
* Remove MetricProduce from Stats API. Register it statically in the impl.
|
|
* Add implementation for gauges.
* Remove usage of internal class in implcore tests.
|
|
|
|
* Metrics: Implement ExportComponent, make ProducerManager abstract.
* Metrics: Add impl and impllite.
* Resolve two TODOs.
* Fix import path, leave a TODO for getMetricRegistry.
* Make NoopMetricProducerManager private. Add missing since tag.
|
|
|
|
* Metrics: Move to api.
* Update package-info to warn users on using metrics.
|
|
* Add support for Gauges in OpenCensus.
* Minor comment fix.
|
|
* Add Tracestate into SpanContext.
* Remove empty constructor from Tracestate.Builder
* Add info in the changelog.
|
|
Support recording `Metric`s in stats impl. This works as the following:
- When a `View` is registered, convert that `View` to a `MetricDescriptor` and register it;
- When a `Measurement` along with a `TagContext` are recorded, convert them into a data row consisting of `LabelValue`s and `Point`s;
- If `getMetrics()` is called, convert the `MetricDescriptor`s and data rows into `Metric`s. Then flush all data rows.
This PR only contains internal support in the impl. None of these changes are user-visible yet.
|
|
|
|
|
|
|
|
|
|
|
|
* Add the initial version of the TraceState class.
* Add builder pattern.
* Clean API and add tests.
* Rename addOrUpdate to set and apply trailing rules for value.
* Apply google java format.
* Fix check framework.
|
|
The stub file adds Nullable annotations to indicate that Context.Key.get can
return null when the key has no default or the key has a nullable value type.
|
|
|
|
|
|
709d97aa321d5729988fd63b960bbece04cfba10 modified the -AskipDefs argument to the
Checker Framework (a regular expression) in a way that caused it to skip
checking all files. This commit fixes the regular expression and the new
Checker Framework warnings.
|
|
* Metrics: Move Exemplar to be part of Bucket.
* Add tests on getExemplar.
|
|
|
|
|
|
|
|
* Cleanup: Move static util methods to util class.
* Fix checker framework.
|
|
|
|
|
|
|
|
added support for spring annotations
|
|
|
|
allocations. (#1336)
* Extract constant functions when used in match to reduce number of allocations.
* Fix names for non-constant functions. Fix deprecated warnings.
* Add more optimization and clean zipkin exporter.
* Use correct name format for RETURN_STRING.
* Fix formatting.
* Fix import for Nullable.
|
|
|
|
* Zipkin exporter: Use the correct attribute value.
* Add a unit test.
|
|
|
|
|
|
|