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

Change rule expression to match endpoint types for receiver creator #2661

Merged
merged 7 commits into from
Mar 23, 2021

Conversation

bjsignalfx
Copy link
Contributor

@bjsignalfx bjsignalfx commented Mar 11, 2021

Description: Change the rule expression in receiver creator for matching endpoints types port, hostport and pod from type.port, type.hostport and type.pod respectively, to type == "port", type == "hostport" and type == "pod".

Testing: Fixed unit tests failing due to change

Documentation: Updated documentation to reflect change.

@bjsignalfx bjsignalfx requested a review from jrcamp as a code owner March 11, 2021 23:00
@bjsignalfx bjsignalfx requested a review from a team March 11, 2021 23:00
@codecov
Copy link

codecov bot commented Mar 11, 2021

Codecov Report

Merging #2661 (d1621fe) into main (c85ae53) will increase coverage by 0.02%.
The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##             main    #2661      +/-   ##
==========================================
+ Coverage   91.57%   91.59%   +0.02%     
==========================================
  Files         450      450              
  Lines       22192    22189       -3     
==========================================
+ Hits        20323    20325       +2     
+ Misses       1397     1394       -3     
+ Partials      472      470       -2     
Flag Coverage Δ
integration 69.09% <ø> (ø)
unit 90.53% <100.00%> (+0.02%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
receiver/receivercreator/rules.go 64.28% <ø> (ø)
extension/observer/endpoints.go 88.88% <100.00%> (-1.12%) ⬇️
receiver/receivercreator/observerhandler.go 68.18% <0.00%> (+4.54%) ⬆️
receiver/receivercreator/runner.go 57.14% <0.00%> (+7.14%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update c85ae53...d1621fe. Read the comment docs.

@bogdandrutu
Copy link
Member

/cc @jrcamp

@tigrannajaryan tigrannajaryan assigned jrcamp and unassigned bogdandrutu Mar 17, 2021
@tigrannajaryan
Copy link
Member

@jrcamp please review.

receiver/receivercreator/observerhandler_test.go Outdated Show resolved Hide resolved
receiver/receivercreator/rules.go Outdated Show resolved Hide resolved
extension/observer/endpoints.go Outdated Show resolved Hide resolved
receiver/receivercreator/README.md Outdated Show resolved Hide resolved
receiver/receivercreator/README.md Outdated Show resolved Hide resolved
@tigrannajaryan
Copy link
Member

Please resolve merge conflict.

@bjsignalfx bjsignalfx changed the title Change type.pod to type == "pod" in Receiver Creator config rules Change rule expression to match endpoint types for receiver creator Mar 23, 2021
@tigrannajaryan tigrannajaryan merged commit bf92d2f into open-telemetry:main Mar 23, 2021
@bjsignalfx bjsignalfx mentioned this pull request Mar 23, 2021
pmatyjasek-sumo referenced this pull request in pmatyjasek-sumo/opentelemetry-collector-contrib Apr 28, 2021
…2661)

Change the rule expression in receiver creator for matching endpoints types port, hostport and pod from type.port, type.hostport and type.pod respectively, to type == "port", type == "hostport" and type == "pod".

Testing: Fixed unit tests failing due to change

Documentation: Updated documentation to reflect change.
alexperez52 referenced this pull request in open-o11y/opentelemetry-collector-contrib Aug 18, 2021
Allows Summary metrics to be exported to Prometheus.
To walk through this feature, I created an adaptation of a Brian Brazil
tutorial for DropWizard, to create a Java server at
https://github.com/odeke-em/bugs/tree/master/opentelemetry-collector/2661
and it uses DropWizard, and exports out JVM statistics with Prometheus where the
*gc_collection_seconds are of the summary kind when scraped by visiting
http://localhost:1234/metrics which produced

```
 # HELP jvm_gc_collection_seconds Time spent in a given JVM garbage collector in seconds.
 # TYPE jvm_gc_collection_seconds summary
 jvm_gc_collection_seconds_count{gc="G1 Young Generation",} 4.0
 jvm_gc_collection_seconds_sum{gc="G1 Young Generation",} 0.026
 jvm_gc_collection_seconds_count{gc="G1 Old Generation",} 0.0
```

and then roundtripped the collector to scrape those metrics and then
export them to Prometheus

    VS

making Prometheus directly scrape that endpoint and then comparing
results.

Also added an end to end test to ensure that a mock DropWizard server
which produces JVM statistics can be scraped by the Prometheus receiver,
which will feed metrics to an active Prometheus exporter, and then we
scrape from the Prometheus exporter to ensure that the summary metrics
are written out and that they make sense.

    DropWizard -> Prometheus Receiver -> Prometheus Exporter -> HTTP scrape + Verify

Fixes #2661
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants