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

Add Prometheus resource support #757

Merged
merged 11 commits into from
May 21, 2020
Merged

Conversation

jmacd
Copy link
Contributor

@jmacd jmacd commented May 21, 2020

Adds api/label.MergeIterator for combining two sorted label sets efficiently, and a benchmark. Uses the new code to merge metric labels and resource labels.

TODO: This leaves some questions about whether the specification firmly states which of (1) resources or (2) labels should override the other.

Resolves #553.

BEFORE

BenchmarkMergeResource_1-8    	 2612361	       455 ns/op	     368 B/op	       6 allocs/op
BenchmarkMergeResource_2-8    	 1880131	       642 ns/op	     608 B/op	       6 allocs/op
BenchmarkMergeResource_3-8    	 1411632	       838 ns/op	     848 B/op	       6 allocs/op
BenchmarkMergeResource_4-8    	 1000000	      1060 ns/op	    1088 B/op	       6 allocs/op
BenchmarkMergeResource_6-8    	  763972	      1507 ns/op	    1568 B/op	       6 allocs/op
BenchmarkMergeResource_8-8    	  606608	      1988 ns/op	    2048 B/op	       6 allocs/op
BenchmarkMergeResource_16-8   	  232756	      5072 ns/op	    4736 B/op	       7 allocs/op

AFTER

BenchmarkMergeResource_1-8    	 3116332	       378 ns/op	     272 B/op	       4 allocs/op
BenchmarkMergeResource_2-8    	 2444085	       491 ns/op	     416 B/op	       4 allocs/op
BenchmarkMergeResource_3-8    	 1828692	       635 ns/op	     560 B/op	       4 allocs/op
BenchmarkMergeResource_4-8    	 1597401	       748 ns/op	     704 B/op	       4 allocs/op
BenchmarkMergeResource_6-8    	 1222702	       966 ns/op	     992 B/op	       4 allocs/op
BenchmarkMergeResource_8-8    	  969420	      1216 ns/op	    1280 B/op	       4 allocs/op
BenchmarkMergeResource_16-8   	  411552	      2913 ns/op	    3200 B/op	       5 allocs/op

@jmacd jmacd added the area:metrics Part of OpenTelemetry Metrics label May 21, 2020
exporters/metric/prometheus/prometheus.go Show resolved Hide resolved
sdk/resource/resource.go Outdated Show resolved Hide resolved
@MrAlias MrAlias added this to the Beta v0.6 milestone May 21, 2020
@MrAlias MrAlias merged commit d6446f0 into open-telemetry:master May 21, 2020
@jmacd jmacd deleted the jmacd/prom_res branch June 8, 2020 06:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area:metrics Part of OpenTelemetry Metrics
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Support Resource in the Prometheus Exporter
3 participants