-
Notifications
You must be signed in to change notification settings - Fork 821
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
feat: Collector Metric Exporter[2/x] Create CollectorMetricExporterBase #1258
Conversation
Codecov Report
@@ Coverage Diff @@
## master #1258 +/- ##
==========================================
+ Coverage 93.01% 93.03% +0.01%
==========================================
Files 131 132 +1
Lines 3696 3735 +39
Branches 747 755 +8
==========================================
+ Hits 3438 3475 +37
- Misses 258 260 +2
|
This PR: #1254 reverted my proto change, so I'm doing it again. |
packages/opentelemetry-exporter-collector/src/CollectorMetricExporterBase.ts
Outdated
Show resolved
Hide resolved
packages/opentelemetry-exporter-collector/src/CollectorMetricExporterBase.ts
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good thanks for the contribution
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: hostname
is one word, other than that and apparent lack of code coverage lgtm
packages/opentelemetry-exporter-collector/src/CollectorMetricExporterBase.ts
Outdated
Show resolved
Hide resolved
packages/opentelemetry-exporter-collector/src/CollectorMetricExporterBase.ts
Outdated
Show resolved
Hide resolved
packages/opentelemetry-exporter-collector/test/common/CollectorMetricExporter.test.ts
Outdated
Show resolved
Hide resolved
packages/opentelemetry-exporter-collector/test/common/CollectorMetricExporter.test.ts
Outdated
Show resolved
Hide resolved
packages/opentelemetry-exporter-collector/test/common/CollectorMetricExporter.test.ts
Outdated
Show resolved
Hide resolved
@naseemkullah Actually, I realized that |
At a quick glance, imho, we can remove edit: It's just weird in Node's case that the value of |
All that to say I'm ok with removing |
Thanks @naseemkullah! For now, I just changed |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As this i based already on CollectorTraceExporter can you please align name ignore I see you already didhostName
in both places so it will be also hostname
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm
Nit: please rename CollectorExporter
in tests into CollectorTraceExporter
Summary
This PR addresses Issue #1109.
Currently, the Collector Exporter only sends traces to the collector. In Python, Java, and Go, for example, metric exporting already exists for the collector. This PR adds that feature. I created two versions, one for Node and the other for browser. The node version uses gRPC, and the browser uses Beacon or XHR. It's up to date with all previous collector exporter commits.
What this PR does
This is the 2nd part of this long PR.
This PR creates
CollectorMetricExporterBase
, modeled offCollectorTraceExporterBase
. I also create unit tests and add two mock metrics to test with, a mock counter and a mock observer. The base class does nothing, so this won't break anything.Next Steps
The next diffs will be as follows