Skip to content

How to build Metrics using OpenTelemetry SDK? #5274

Discussion options

You must be logged in to vote

Got it, I was mixing up TracerProvider, Span & Histogram where I suppose to only instantiate 2 counter instances and have to send it to Otl-collector

e.g.

LongCounter counter1 = meter
				.counterBuilder("test_counter")
				.setDescription("test_counter jobs")
				.setUnit("1")
				.build();

LongCounter counter2 = meter
				.counterBuilder("test_counter")
				.setDescription("test_counter jobs")
				.setUnit("1")
				.build();

counter1.add(1, attributesSuccess);
counter2.add(1, attributesFailures);

Replies: 3 comments

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Answer selected by swapnil-kotwal-sp
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants