-
Notifications
You must be signed in to change notification settings - Fork 129
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add new Sampler and SpanProcessor to allow for generating metrics from 100% of spans without impacting sampling #789
Comments
+1, I support this component's implementation in the X-ray contrib. |
One thing we are evaluating is: where exactly should these components go? We originally thought they would live in |
thpierce
added a commit
to bjrara/opentelemetry-java-contrib
that referenced
this issue
Mar 29, 2023
ResourceHolder provides generic utility for other components in the awsxray package, and could be more broadly used. In this commit, we are breaking out the ResourceHolder inner class to it's own class, and exposing the functionality of getResource, so that other classes can rely on it. Related issue: open-telemetry#789
thpierce
added a commit
to bjrara/opentelemetry-java-contrib
that referenced
this issue
Mar 29, 2023
… without impacting sampling In this commit, we are adding several new components to the awsxray package: * AlwaysRecordSampler - A simple aggregate sampler that always ensures spans are "recorded" (i.e. sent to span processors). This allows us to generate metrics from 100% of spans without impacting true sampling rate. * SpanMetricsProcessor - A span processor that will generate specific metrics pertaining to latency, faults, and errors. Relies on a MetricAttributeGenerator to build attributes for the metrics, and wraps these metric attributes around the span attributes before passing the span to a delegate span processor for further processing/exporting. * MetricAttributeGenerator - A generic interface for components that consume spans and resources and export attributes for metrics generated from these spans. * AwsMetricAttributeGenerator - A specific implementation of MetricAttributeGenerator, used for generating AWS-specific attributes. * SpanMetricsProcessorBuilder - A builder class for SpanMetricsProcessor Related issue: open-telemetry#789
thpierce
added a commit
to bjrara/opentelemetry-java-contrib
that referenced
this issue
Mar 29, 2023
ResourceHolder provides generic utility for other components in the awsxray package, and could be more broadly used. In this commit, we are breaking out the ResourceHolder inner class to it's own class, and exposing the functionality of getResource, so that other classes can rely on it. Related issue: open-telemetry#789
thpierce
added a commit
to bjrara/opentelemetry-java-contrib
that referenced
this issue
Mar 30, 2023
… without impacting sampling In this commit, we are adding several new components to the awsxray package: * AlwaysRecordSampler - A simple aggregate sampler that always ensures spans are "recorded" (i.e. sent to span processors). This allows us to generate metrics from 100% of spans without impacting true sampling rate. * SpanMetricsProcessor - A span processor that will generate specific metrics pertaining to latency, faults, and errors. Relies on a MetricAttributeGenerator to build attributes for the metrics, and wraps these metric attributes around the span attributes before passing the span to a delegate span processor for further processing/exporting. * MetricAttributeGenerator - A generic interface for components that consume spans and resources and export attributes for metrics generated from these spans. * AwsMetricAttributeGenerator - A specific implementation of MetricAttributeGenerator, used for generating AWS-specific attributes. * SpanMetricsProcessorBuilder - A builder class for SpanMetricsProcessor Related issue: open-telemetry#789
This was referenced Mar 30, 2023
thpierce
added a commit
to bjrara/opentelemetry-java-contrib
that referenced
this issue
Apr 3, 2023
ResourceHolder provides generic utility for other components in the awsxray package, and could be more broadly used. In this commit, we are breaking out the ResourceHolder inner class to it's own class, and exposing the functionality of getResource, so that other classes can rely on it. Further, we are deprecating the original ResourceHolder, which we believe was not originally intended to be widely visible/accessible. Related issue: open-telemetry#789
thpierce
added a commit
to bjrara/opentelemetry-java-contrib
that referenced
this issue
Apr 3, 2023
ResourceHolder provides generic utility for other components in the awsxray package, and could be more broadly used. In this commit, we are breaking out the ResourceHolder inner class to it's own class, and exposing the functionality of getResource, so that other classes can rely on it. Further, we are deprecating the original ResourceHolder, which we believe was not originally intended to be widely visible/accessible. Related issue: open-telemetry#789
trask
pushed a commit
that referenced
this issue
Apr 3, 2023
**Description:** ResourceHolder provides generic utility for other components in the awsxray package, and could be more broadly used. In this commit, we are breaking out the ResourceHolder inner class to it's own class, and exposing the functionality of getResource, so that other classes can rely on it. Specifically, we are working on new components to meet the needs of #789, which will require the use of this ResourceHolder. Opening up ResourceHolder seems to us to be the best path forward. **Existing Issue(s):** Tangentially related: #789 **Testing:** * Added unit tests, validated they all pass * `./gradlew clean assemble` succeeds **Documentation:** Unclear if any documentation is required here, can help contribute this as needed. ResourceHolder is a new independent component that can be used to retrieve the Resource from autoconfiguration. **Outstanding items:** None
This was referenced Apr 27, 2023
thpierce
added a commit
to bjrara/opentelemetry-java-contrib
that referenced
this issue
Apr 27, 2023
… without impacting sampling In this commit, we are adding several new components to the awsxray package: * AlwaysRecordSampler - A simple aggregate sampler that always ensures spans are "recorded" (i.e. sent to span processors). This allows us to generate metrics from 100% of spans without impacting true sampling rate. * SpanMetricsProcessor - A span processor that will generate specific metrics pertaining to latency, faults, and errors. Relies on a MetricAttributeGenerator to build attributes for the metrics, and wraps these metric attributes around the span attributes before passing the span to a delegate span processor for further processing/exporting. * MetricAttributeGenerator - A generic interface for components that consume spans and resources and export attributes for metrics generated from these spans. * AwsMetricAttributeGenerator - A specific implementation of MetricAttributeGenerator, used for generating AWS-specific attributes. * SpanMetricsProcessorBuilder - A builder class for SpanMetricsProcessor Related issue: open-telemetry#789
thpierce
added a commit
to bjrara/opentelemetry-java-contrib
that referenced
this issue
Apr 28, 2023
… without impacting sampling In this commit, we are adding several new components to the awsxray package: * AlwaysRecordSampler - A simple aggregate sampler that always ensures spans are "recorded" (i.e. sent to span processors). This allows us to generate metrics from 100% of spans without impacting true sampling rate. * AwsSpanMetricsProcessor - A span processor that will generate specific metrics pertaining to latency, faults, and errors. Relies on a MetricAttributeGenerator to build attributes for the metrics, and wraps these metric attributes around the span attributes before passing the span to a delegate span processor for further processing/exporting. * MetricAttributeGenerator - A generic interface for components that consume spans and resources and export attributes for metrics generated from these spans. * AwsMetricAttributeGenerator - A specific implementation of MetricAttributeGenerator, used for generating AWS-specific attributes. * AwsSpanMetricsProcessorBuilder - A builder class for SpanMetricsProcessor Related issue: open-telemetry#789
thpierce
added a commit
to bjrara/opentelemetry-java-contrib
that referenced
this issue
Apr 28, 2023
… without impacting sampling In this commit, we are adding several new components to the awsxray package: * AlwaysRecordSampler - A simple aggregate sampler that always ensures spans are "recorded" (i.e. sent to span processors). This allows us to generate metrics from 100% of spans without impacting true sampling rate. * AwsSpanMetricsProcessor - A span processor that will generate specific metrics pertaining to latency, faults, and errors. Relies on a MetricAttributeGenerator to build attributes for the metrics, and wraps these metric attributes around the span attributes before passing the span to a delegate span processor for further processing/exporting. * MetricAttributeGenerator - A generic interface for components that consume spans and resources and export attributes for metrics generated from these spans. * AwsMetricAttributeGenerator - A specific implementation of MetricAttributeGenerator, used for generating AWS-specific attributes. * AwsSpanMetricsProcessorBuilder - A builder class for AwsSpanMetricsProcessor Related issue: open-telemetry#789
thpierce
added a commit
to bjrara/opentelemetry-java-contrib
that referenced
this issue
May 9, 2023
… without impacting sampling In this commit, we are adding several new components to the awsxray package: * AlwaysRecordSampler - A simple aggregate sampler that always ensures spans are "recorded" (i.e. sent to span processors). This allows us to generate metrics from 100% of spans without impacting true sampling rate. * AwsSpanMetricsProcessor - A span processor that will generate specific metrics pertaining to latency, faults, and errors. Relies on a MetricAttributeGenerator to build attributes for the metrics. * AwsMetricAttributesSpanExporter - A span exporter that relies on MetricAttributeGenerator to wraps metric attributes around the span attributes before passing the span to a delegate span exporter for export. * MetricAttributeGenerator - A generic interface for components that consumes spans and resources and produces attributes for metrics generated from these spans. * AwsMetricAttributeGenerator - A specific implementation of MetricAttributeGenerator, used for generating AWS-specific attributes. * AwsSpanMetricsProcessorBuilder - A builder class for AwsSpanMetricsProcessor. * AwsMetricAttributesSpanExporterBuilder - A builder class for AwsMetricAttributesSpanExporter. Related issue: open-telemetry#789
thpierce
added a commit
to bjrara/opentelemetry-java-contrib
that referenced
this issue
May 9, 2023
… without impacting sampling In this commit, we are adding several new components to the awsxray package: * AlwaysRecordSampler - A simple aggregate sampler that always ensures spans are "recorded" (i.e. sent to span processors). This allows us to generate metrics from 100% of spans without impacting true sampling rate. * AwsSpanMetricsProcessor - A span processor that will generate specific metrics pertaining to latency, faults, and errors. Relies on a MetricAttributeGenerator to build attributes for the metrics. * AwsMetricAttributesSpanExporter - A span exporter that relies on MetricAttributeGenerator to wraps metric attributes around the span attributes before passing the span to a delegate span exporter for export. * MetricAttributeGenerator - A generic interface for components that consumes spans and resources and produces attributes for metrics generated from these spans. * AwsMetricAttributeGenerator - A specific implementation of MetricAttributeGenerator, used for generating AWS-specific attributes. * AwsSpanMetricsProcessorBuilder - A builder class for AwsSpanMetricsProcessor. * AwsMetricAttributesSpanExporterBuilder - A builder class for AwsMetricAttributesSpanExporter. Related issue: open-telemetry#789
Yes! Resolving now, ty for help getting these merged. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Is your feature request related to a problem? Please describe.
Yes. We wish to generate key metrics from OTEL auto-instrumented spans. I had previously engaged the community to discuss this, and after some conversations, decided that the best approach would be to implement a Sampler and a Span Processor to the
contrib
repositories.The major requirements for our project are as follows:
http.route
).I am raising this issue to garner attention for this change before I raise a PR, and perhaps run conversations in parallel with implementation, which is ongoing. Please note there may be some differences in the final implementation, but the broad strokes should remain the same.
Describe the solution you'd like
All contributions would go to opentelemetry-java-contrib/aws-xray/src/main/java/io/opentelemetry/contrib/awsxray.
AlwaysRecordSampler
.shouldSample()
will call the root sampler and, if theSampleDecision
isRECORD_AND_SAMPLE
orRECORD_ONLY
, it simply returns the result. However, if theSampleDecision
isDROP
, it will instead create a new result withSampleDecision
set toRECORD_ONLY
(all other result behaviour unchanged).AwsSpanMetricsProcessor
.MeterProvider
and a downstream SpanProcessor (akin to the MultiSpanProcessor)onEnd()
andisEndRequired()
will passthrough to the downstream SpanProcessor, as needed.isEndRequired
will return true, andonEnd()
will:ReadableSpan
identical to the original span, but with metric attributes embedded into span attributes.downstreamSpanProcessor.onEnd()
with span, if required.Describe alternatives you've considered
We have evaluated a couple different options here:
RECORD_ONLY
spans, and no default SpanProcessor offers that functionality, so we would end up having to write a SpanProcessor anyways. No major value was seen in this approach.Additional context
aws-xray
.The text was updated successfully, but these errors were encountered: