Repository navigation
Conversation
Adds TargetAttributes and DecodeOptions::target_attributes so ArrowDecoder emits an OTAP ResourceAttrs (ArrowPayloadType = 1) batch attached to resource id 0 on every non-empty decode. Maps Prometheus job and instance labels to OpenTelemetry service.name and service.instance.id alongside extra non-reserved target labels, lets explicit resource attributes override mapped labels, and caches the encoded RecordBatch in TargetAttributes across streaming chunks and repeated scrapes. Towards #35. Signed-off-by: Bartek Plotka <bwplotka@gmail.com>
…bounded memory Checks MetricPayloadType::ResourceAttrs discriminant parity, validates decoder-emitted ResourceAttrs against upstream OTAP schemas, verifies downstream apply_attribute_transform upserts on top of pre-populated ResourceAttrs, and exercises cached TargetAttributes in the dhat bounded-memory loop. Signed-off-by: Bartek Plotka <bwplotka@gmail.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Towards prometheus/scrape.rs#35.
Adds
TargetAttributesandDecodeOptions::target_attributessoArrowDecoderemits an OTAPResourceAttrs(ArrowPayloadType = 1) batch attached toparent_id = 0(matchingUnivariateMetrics.resource.id = 0from prometheus/scrape.rs#38) on every non-empty decode and streaming chunk. Prometheusjobandinstancetarget labels map to OpenTelemetryservice.nameandservice.instance.idalongside extra non-reserved target labels, while explicit resource attributes take precedence and the encodedRecordBatchis cached inTargetAttributesacross chunks and repeated scrapes.Note that
DecodeOptionsnow holdsOption<Arc<TargetAttributes>>, so it implementsCloneinstead ofCopywhileDecodeOptions::new()staysconst.Commits in order:
023cdef:arrow: emit target ResourceAttrs and map job/instance target labels16ce7f9:tests/otap-compat: verify ResourceAttrs schema, OTLP round-trip, and bounded memoryBenchmarks (benchfmt.rs / benchstat)
Command:
Comparison between
5b8b21d(before) and16ce7f9(after). Heap bytes and allocation counts are identical (+0.00%); the small+2.26%geomean latency shift reflects one extraOption<RecordBatch>field inOtapMetricRecordsand shared VM noise.