Skip to content
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

[Prometheus Receiver] Modify existing tests to validate metrics using OTLP format instead of OpenCensus format #6151

Closed
PaurushGarg opened this issue Nov 5, 2021 · 2 comments
Assignees
Labels
comp:prometheus Prometheus related issues comp: receiver Receiver

Comments

@PaurushGarg
Copy link
Member

PaurushGarg commented Nov 5, 2021

Describe the Problem
Existing Prometheus Receiver test translates OTLP format metrics to OpenCensus format, and then uses these translated metrics for validation and assertions. Currently, Prometheus Receiver uses OpenCensus metricbuilder, but this is planned to be switched to OTLP metricbuilder, in the near future. After this change, staleNaN can be identified using data-point flags (MetricDataPointFlagNoRecordedValue).
See Issues:
open-telemetry/opentelemetry-proto#316
open-telemetry/opentelemetry-proto#310

In existing Prometheus Receiver tests, func TestEndtoEnd translates the OTLP format metrics to OpenCensus format before proceeding for test validations. The data-point flag to identify staleness markers, is not accessible using the OpenCensus format, and there are existing issues that cannot be resolved without datapoint flag for staleness markers.
See Issue:
open-telemetry/wg-prometheus#38

Describe the solution you'd like
Exiting Prometheus Receiver test receives metrics from the consumertest.MetricsSink in OTLP format. Modify this test to remove the translation from OTLP to OpenCensus format and modify all the existing functions associated with validations and assertions (as in the link) to accept OTLP format metrics instead of OpenCensus.

Additional context
Related to open-telemetry/wg-prometheus#57
Related Issues:
#6000
#6087
cc: @alolita @Aneurysm9

@PaurushGarg
Copy link
Member Author

@alolita please assign this issue to me. I would like to work on this one.

@alolita alolita added comp:prometheus Prometheus related issues comp: receiver Receiver labels Nov 10, 2021
bogdandrutu pushed a commit that referenced this issue Nov 17, 2021
… directly for validations and accept staleness markers (#6219)

* Modifies existing Prometheus Receiver Tests to use pdata directly for validation

* Removed dead code from helper file

* Fixed the lint issue

* Fixing the imports lint error

* Skipping start_timestamp check for histogram and summary in target1scrape2

* Resolved feedback

* Resolved review feedback comments

* Trimming the assert messages

* Fix to avoid panic situation in assertMetricPresent method

* Moved testing as first argument in doCompare method

* Removed bool propogation in comparators and changed setupMockPrometheus to avoid replaceall on config
@PaurushGarg PaurushGarg changed the title Modify existing Prometheus Receiver tests to validate metrics using OTLP format instead of OpenCensus format [Prometheus Receiver] Modify existing tests to validate metrics using OTLP format instead of OpenCensus format Nov 17, 2021
@alolita
Copy link
Member

alolita commented Nov 17, 2021

See issue #6360 for more details. Closing this issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
comp:prometheus Prometheus related issues comp: receiver Receiver
Projects
None yet
Development

No branches or pull requests

2 participants