Skip to content

Prometheus unit test - #1461

Merged
ThomsonTan merged 17 commits into
open-telemetry:mainfrom
esigo:prometheus-unit-test
Jul 28, 2022
Merged

ThomsonTan merged 17 commits into
open-telemetry:mainfrom
esigo:prometheus-unit-test

Conversation

@esigo

@esigo esigo commented Jun 21, 2022

Copy link
Copy Markdown
Member

Fixes #1349 (issue)

Changes

Adds unit test for Prometheus.

For significant contributions please make sure you have completed the following items:

  • CHANGELOG.md updated for non-trivial changes
  • Unit tests have been added
  • Changes in public API reviewed

@esigo
esigo requested a review from a team June 21, 2022 14:36
@codecov

codecov Bot commented Jun 21, 2022

Copy link
Copy Markdown

Codecov Report

Merging #1461 (e26a828) into main (3a8f913) will increase coverage by 0.07%.
The diff coverage is n/a.

Impacted file tree graph

@@            Coverage Diff             @@
##             main    #1461      +/-   ##
==========================================
+ Coverage   84.61%   84.68%   +0.07%     
==========================================
  Files         155      155              
  Lines        4782     4782              
==========================================
+ Hits         4046     4049       +3     
+ Misses        736      733       -3     
Impacted Files Coverage Δ
ext/src/http/client/curl/http_client_curl.cc 81.07% <0.00%> (+1.14%) ⬆️

Comment thread exporters/prometheus/test/collector_test.cc Outdated
Comment thread exporters/prometheus/test/exporter_test.cc Outdated
ASSERT_EQ(res, code);
}

#endif // ENABLE_METRICS_PREVIEW

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: put the condition here in front of ENABLE_METRICS_PREVIEW? To imply that the previous block is in effect when ENABLE_METRICS_PREVIEW is not defined.

break;
}
case prometheus::MetricType::Untyped:
break;

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Put an ASSERT here as well to catch unexpected type?

Comment thread exporters/prometheus/test/prometheus_test_helper.h Outdated
Comment thread exporters/prometheus/test/prometheus_test_helper.h Outdated
Comment thread exporters/prometheus/test/prometheus_test_helper.h Outdated
Comment thread exporters/prometheus/test/prometheus_test_helper.h
Comment thread exporters/prometheus/test/prometheus_test_helper.h
@lalitb

lalitb commented Jun 24, 2022

Copy link
Copy Markdown
Member

Looks like merging #1454 is failing this PR, as the otlp PR adds AggregationTemporality as part of MetricData :(

@lalitb lalitb left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM :)

@ThomsonTan
ThomsonTan merged commit e4f3a9c into open-telemetry:main Jul 28, 2022
@esigo
esigo deleted the prometheus-unit-test branch July 28, 2022 14:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add unit test for Prometheus exporter

3 participants